feat: 1.2.0 attack intelligence, replay, 30-day history and new interface
CI / Docker image (build and smoke test) (push) Skipped
CI / Format and vet (push) Successful in 27s
CI / Dependency audit (push) Successful in 18s
CI / Tests (Linux, race detector) (push) Successful in 58s
Release / Plan (reuse the published image?) (push) Successful in 4s
Release / ci (push) Skipped
Release / Build image (amd64) (push) Skipped
Release / Build image (arm64) (push) Skipped
Release / Publish tags (push) Successful in 13s
Release / Gitea release (push) Successful in 5s

Intelligence: attack families mapped to MITRE ATT&CK, network type from
ASN/rDNS without external APIs, request cadence, sessions with
recon/probe/exploit/access/banned stages, campaigns across IPs, verdict
with reasons, recommended actions, exposure detection (2xx with a body
on sensitive paths), STIX 2.1 export, FCrDNS for search engine bots,
optional Tor exit list.

Data: 30-day retention, twelve ranges plus custom from/to, an on-disk
event log (daily files, hourly gzip members, size cap, corruption and
disk-full tolerant), /events, /period, /metrics with stable per-hour
metrics, an extended /ip/{ip}, and peer /period merged on the hub.

Interface: layout system with fixed card sizes, range picker in the
URL, IP analysis page, Replay page, Geography down to state and city
(Natural Earth admin-1), Live page redesigned with stable metrics and a
reusable attack map. Demo data and documentation screenshots.

Security: bounded and deadline-limited period computations, linear
campaign clustering, singleflight caches, sanitized peer studies, event
query budgets, gzip bomb guard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lucas RayanandClaude Opus 5.5 committed 2026-11-14 21:45:59 -03:00
1 parent 8f1ac462d1
commit b7462c14fa
325 files changed
+19117 -1307

No files matched your search

+31
View File
@@ -112,7 +112,9 @@ func Merge(host string, parts []Summary) Summary {
var ipLists [][]IPSummary
var paths, doms, uas, users, ctry [][]Count
var recent []FeedEvent
var rates []Rates
for _, p := range parts {
rates = append(rates, p.Rates)
if p.Generated > out.Generated {
out.Generated = p.Generated
}
@@ -170,6 +172,12 @@ func Merge(host string, parts []Summary) Summary {
out.Totals.UniqueIPs = p.Totals.UniqueIPs
}
}
out.Rates = mergeRates(rates, out.Totals.Malicious, out.Timeline, hostile)
for i, p := range parts {
_ = i
out.Rates.ActiveAttackers = max(out.Rates.ActiveAttackers, p.Rates.ActiveAttackers)
out.Rates.NewAttackers = max(out.Rates.NewAttackers, p.Rates.NewAttackers)
}
if len(out.IPs) > summaryIPs {
out.IPs = out.IPs[:summaryIPs]
}
@@ -183,3 +191,26 @@ func Merge(host string, parts []Summary) Summary {
out.Recent = recent
return out
}
// mergeRates adds the per-host rates up. Attacker counts cannot be added
// exactly (the same address can hit several hosts) so the caller takes the
// larger of the merged list and the busiest host.
func mergeRates(parts []Rates, malicious uint64, tl Timeline, _ int) Rates {
var out Rates
var prevOK bool
for _, p := range parts {
out.Last15m += p.Last15m
out.Last1h += p.Last1h
out.Last24h += p.Last24h
out.PerHourAvg7d += p.PerHourAvg7d
out.PrevPeriod += p.PrevPeriod
prevOK = prevOK || p.ChangePct != nil
}
out.PerHourAvg24h = avg1(out.Last24h, 24)
out.PerHourAvg7d = round1(out.PerHourAvg7d)
if prevOK {
out.ChangePct = pct(malicious, out.PrevPeriod)
}
out.PeakHour = PeakOf(tl)
return out
}