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

+99
View File
@@ -0,0 +1,99 @@
// Comando demo gera os dados de demonstração das capturas de tela do Urutau:
// uma base de geolocalização MMDB (city + asn) e logs de 30 dias (Traefik,
// auth.log, fail2ban.log), tudo com endereços e domínios reservados para
// documentação. Veja scripts/screenshots.sh.
//
// demo geo <dir> grava dbip-city-lite-*.mmdb e dbip-asn-lite-*.mmdb
// demo logs <dir> <edge-1|edge-2> [seed] grava access.log, auth.log e fail2ban.log
// demo live <segundos> <dir>:<host>... acrescenta eventos ao vivo, até o tempo acabar
// demo check <arquivo>... falha se achar IP fora das faixas reservadas
package main
import (
"fmt"
"net/netip"
"os"
"regexp"
"strconv"
"strings"
"time"
)
func main() {
if err := run(os.Args[1:]); err != nil {
fmt.Fprintln(os.Stderr, "demo:", err)
os.Exit(1)
}
}
func run(a []string) error {
if len(a) < 2 {
return fmt.Errorf("uso: demo geo|logs|live|check ...")
}
switch a[0] {
case "geo":
return writeGeo(a[1])
case "logs":
if len(a) < 3 {
return fmt.Errorf("uso: demo logs <dir> <edge-1|edge-2> [seed]")
}
seed := int64(1)
if len(a) > 3 {
seed, _ = strconv.ParseInt(a[3], 10, 64)
}
return writeLogs(a[1], a[2], seed)
case "live":
secs, err := strconv.Atoi(a[1])
if err != nil {
return err
}
var dirs, hosts []string
for _, p := range a[2:] {
d, h, ok := strings.Cut(p, ":")
if !ok {
return fmt.Errorf("esperado <dir>:<host>, recebi %q", p)
}
dirs, hosts = append(dirs, d), append(hosts, h)
}
return live(dirs, hosts, time.Duration(secs)*time.Second)
case "check":
return check(a[1:])
}
return fmt.Errorf("subcomando desconhecido %q", a[0])
}
var ipRe = regexp.MustCompile(`\b(?:\d{1,3}\.){3}\d{1,3}\b|\b(?:[0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}\b`)
// check procura endereços IP em arquivos de texto e falha se algum estiver fora
// das faixas reservadas.
func check(files []string) error {
bad := 0
for _, f := range files {
b, err := os.ReadFile(f)
if err != nil {
return err
}
txt := string(b)
for _, loc := range ipRe.FindAllStringIndex(txt, -1) {
m := txt[loc[0]:loc[1]]
if loc[0] > 0 && txt[loc[0]-1] == '/' && strings.HasSuffix(m, ".0.0.0") {
continue // versão de navegador (Chrome/130.0.0.0), não um endereço
}
ip, err := netip.ParseAddr(m)
if err != nil || reserved(ip) {
continue
}
if ip.Is4() && strings.HasPrefix(m, "0.") {
continue
}
fmt.Printf("%s: %s fora das faixas reservadas\n", f, m)
if bad++; bad > 20 {
return fmt.Errorf("muitos endereços fora das faixas")
}
}
}
if bad > 0 {
return fmt.Errorf("%d endereços fora das faixas reservadas", bad)
}
return nil
}