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

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:
Lucas RayanandClaude Opus 5.5 committed 2026-11-15 00:21:43 -03:00
1 parent f27d8441a9
commit 432f521ed1
40 files changed
+927 -136

No files matched your search

+13 -2
View File
@@ -55,7 +55,10 @@ func CampaignsOf(p PeriodOut) CampaignsOut {
if list[i].IPsN != list[j].IPsN {
return list[i].IPsN > list[j].IPsN
}
return list[i].First.Before(list[j].First)
if !list[i].First.Equal(list[j].First) {
return list[i].First.Before(list[j].First)
}
return list[i].ID < list[j].ID
})
out := CampaignsOut{Range: p.Range, Enabled: p.Enabled, Truncated: p.Truncated, Total: len(list)}
seen := map[string]bool{}
@@ -74,6 +77,7 @@ func CampaignsOf(p PeriodOut) CampaignsOut {
list = list[:MaxCampaignsOut]
}
out.Campaigns = list
out.Total = len(list) // what can be paged through (the cap above applies)
if out.Campaigns == nil {
out.Campaigns = []intel.Campaign{}
}
@@ -257,7 +261,14 @@ func FunnelOf(p PeriodOut, counts *StageCounts) FunnelOut {
if a != b {
return a > b
}
return f.Sessions[i].Start.After(f.Sessions[j].Start)
x, y := f.Sessions[i], f.Sessions[j]
if !x.Start.Equal(y.Start) {
return x.Start.After(y.Start)
}
if x.IP != y.IP {
return x.IP < y.IP
}
return x.End.After(y.End)
})
return f
}
+3
View File
@@ -23,6 +23,9 @@ func IntelClassifier(ev core.Event) (string, []string, string) {
marker = intel.Marker(ev.Path)
}
}
if ev.Source == "probe" {
fam = intel.FamPortScan
}
tech := intel.Techniques(string(ev.Cat), fam, intel.TechCtx{Tool: ev.UA, Path: ev.Path})
return fam, tech, marker
}
+13 -1
View File
@@ -162,6 +162,9 @@ type FeedEvent struct {
Bytes int64 `json:"bytes,omitempty"`
DurMS int64 `json:"dur_ms,omitempty"`
Flags string `json:"flags,omitempty"` // S strong, W weak, G forged, F framed, X soft
// Network probe (Source "probe"): destination port and transport.
Port int `json:"port,omitempty"`
Proto string `json:"proto,omitempty"`
}
// SetAttribution sets the credit line shown in the dashboard footer (geo data licence).
@@ -574,7 +577,7 @@ func (s *Store) feedOf(ev core.Event, ts int64, fam string, tech []string, marke
return FeedEvent{T: ts, IP: ev.IP, Cat: string(ev.Cat), Source: ev.Source, Host: s.cfg.Name, Domain: ev.Domain,
Method: ev.Method, Path: ev.Path, User: ev.User, Jail: ev.Jail, Status: ev.Status, Unban: ev.Unban, Forged: ev.Forged, CC: ev.E.CC,
UA: clipS(ev.UA, 200), ID: s.ids.Add(1), Fam: clipS(fam, 40), Tech: tech, Marker: clipS(marker, 80),
Bytes: ev.Bytes, DurMS: ev.DurationNS / 1e6, Flags: flags}
Bytes: ev.Bytes, DurMS: ev.DurationNS / 1e6, Flags: flags, Port: int(ev.Port), Proto: probeProto(ev)}
}
// listedRule is the blocklist rule: score of 50, a strong signal and not an admin.
@@ -979,3 +982,12 @@ func (s *Store) Monitoring(t time.Time) {
hs.Mon++
s.mu.Unlock()
}
// probeProto is the transport of a network probe; the Proto of an HTTP event
// (HTTP/1.1...) is not exported.
func probeProto(ev core.Event) string {
if ev.Source == "probe" {
return ev.Proto
}
return ""
}
+4 -3
View File
@@ -221,10 +221,11 @@ func SortIPs(l []IPSummary, key string, desc bool) {
return a.Last < b.Last
}
sort.SliceStable(l, func(i, j int) bool {
if desc {
return less(l[j], l[i])
a, b := l[i], l[j]
if lt, gt := less(a, b), less(b, a); lt || gt { // equal keys fall back to the address: pages never shuffle
return lt != desc
}
return less(l[i], l[j])
return a.IP < b.IP
})
}