feat: 1.4.1 pagination, network probes, survival by blocker, report polish
Release / Publish tags (push) Successful in 18s
Release / Plan (reuse the published image?) (push) Successful in 5s
Release / ci (push) Successful in 1m47s
Release / Build image (amd64) (push) Successful in 21s
Release / Build image (arm64) (push) Successful in 28s
CI / Format and vet (push) Successful in 23s
CI / Tests (Linux, race detector) (push) Successful in 1m24s
CI / Dependency audit (push) Successful in 24s
CI / Docker image (build and smoke test) (push) Skipped
Release / Gitea release (push) Successful in 5s
Release / Publish tags (push) Successful in 18s
Release / Plan (reuse the published image?) (push) Successful in 5s
Release / ci (push) Successful in 1m47s
Release / Build image (amd64) (push) Successful in 21s
Release / Build image (arm64) (push) Successful in 28s
CI / Format and vet (push) Successful in 23s
CI / Tests (Linux, race detector) (push) Successful in 1m24s
CI / Dependency audit (push) Successful in 24s
CI / Docker image (build and smoke test) (push) Skipped
Release / Gitea release (push) Successful in 5s
Backend pagination with one pager for sessions, IPs, campaigns and events; network probe source (port-scan, T1046, second firewall reason port-scan); host kit logs inbound probes; urutau call on the report cover. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f27d8441a9
commit
432f521ed1
40 files changed
+927
-136
No files matched your search
@@ -95,6 +95,7 @@ type aevt struct {
|
||||
type ipState struct {
|
||||
ev []aevt
|
||||
ssh []int64
|
||||
probes map[uint32]int64 // proto<<16|port -> last seen (unix)
|
||||
legit int64
|
||||
uas []string
|
||||
lastAttack int64
|
||||
@@ -384,6 +385,9 @@ func (e *Engine) process(ev core.Event, fam string) {
|
||||
}
|
||||
return
|
||||
case ev.Cat == core.SSHFail:
|
||||
case ev.Source == "probe" && ev.Cat == core.Scanner:
|
||||
e.processProbe(a, ev, now)
|
||||
return
|
||||
case CountsAsAttack(ev):
|
||||
default:
|
||||
return
|
||||
@@ -721,3 +725,32 @@ func (e *Engine) saveState() {
|
||||
e.dirty = true
|
||||
e.mu.Unlock()
|
||||
}
|
||||
|
||||
// processProbe counts the distinct ports a network probe touched in Window; a
|
||||
// scan of PortScanPorts or more is a ban. Probes never count as web attacks.
|
||||
func (e *Engine) processProbe(a netip.Addr, ev core.Event, now time.Time) {
|
||||
ts := ev.Time.Unix()
|
||||
cut := now.Add(-Window).Unix()
|
||||
if ts < cut || ev.Port == 0 {
|
||||
return
|
||||
}
|
||||
st := e.stateOf(a)
|
||||
st.lastAttack = max(st.lastAttack, ts)
|
||||
if st.probes == nil {
|
||||
st.probes = map[uint32]int64{}
|
||||
}
|
||||
var proto uint32
|
||||
if ev.Proto == "udp" {
|
||||
proto = 1
|
||||
}
|
||||
k := proto<<16 | uint32(ev.Port)
|
||||
st.probes[k] = max(st.probes[k], ts)
|
||||
for key, t := range st.probes {
|
||||
if t < cut {
|
||||
delete(st.probes, key)
|
||||
}
|
||||
}
|
||||
in := Input{Now: now, Probes: len(st.probes), Exclude: e.excl.Excluded(a)}
|
||||
e.fill(a, st, &in, now)
|
||||
e.apply(a, st, Decide(in, Params{Threshold: e.cfg.Threshold}), "local", now)
|
||||
}
|
||||
Reference in new issue
Block a user