Merge pull request #20 from safing/feature/portscan_detection

minor general changes: debugmessages, comments, TODOs
This commit is contained in:
Dave Gson 2019-08-23 09:56:27 +00:00 committed by GitHub
commit c65d830fc5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 1 deletions

View file

@ -146,6 +146,7 @@ func handlePacket(pkt packet.Packet) {
pkt.PermanentAccept() pkt.PermanentAccept()
return return
} }
// TODO: Howto handle NetBios?
} }
// log.Debugf("firewall: pkt %s has ID %s", pkt, pkt.GetLinkID()) // log.Debugf("firewall: pkt %s has ID %s", pkt, pkt.GetLinkID())
@ -268,6 +269,7 @@ func initialHandler(pkt packet.Packet, link *network.Link) {
// link.StopFirewallHandler() // link.StopFirewallHandler()
// permanentVerdict(pkt, network.VerdictAccept) // permanentVerdict(pkt, network.VerdictAccept)
case link.Inspect: case link.Inspect:
log.Tracer(pkt.Ctx()).Trace("firewall: start inspecting")
link.SetFirewallHandler(inspectThenVerdict) link.SetFirewallHandler(inspectThenVerdict)
inspectThenVerdict(pkt, link) inspectThenVerdict(pkt, link)
default: default:

View file

@ -64,7 +64,7 @@ func RunInspectors(pkt packet.Packet, link *network.Link) (network.Verdict, bool
continue continue
} }
action := inspectors[key](pkt, link) action := inspectors[key](pkt, link) // Actually run inspector
switch action { switch action {
case DO_NOTHING: case DO_NOTHING:
if verdict < network.VerdictAccept { if verdict < network.VerdictAccept {

View file

@ -14,6 +14,7 @@ type Threat struct {
MitigationLevel uint8 // Recommended Security Level to switch to for mitigation MitigationLevel uint8 // Recommended Security Level to switch to for mitigation
Started int64 Started int64
Ended int64 Ended int64
// TODO: add locking
} }
// AddOrUpdateThreat adds or updates a new threat in the system status. // AddOrUpdateThreat adds or updates a new threat in the system status.