A finding reported with severity "High" is stored as-is, so it is missing from severity counts and min_severity channels drop it
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 22/100
Direzione di ricerca
Start in db/finding_traffic.go at RecordFindingTx (lines near 417, 438 and 454), where in.Severity is written unchanged to the node payload, the findings row and the notification snapshot, and check how agent/tools.go fills it. Also look at db.ValidSeverity and the SeverityRank/AtLeast comparison used by notify.Match. Done means severity is normalized to lowercase and trimmed before storage, and the regression test shows a high finding reaching a min_severity=high channel. A linked pull request (#651) already exists, so this is claimed work.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
report_finding passes the model's severity text straight to the database. The tool schema says critical|high|medium|low, but nothing normalizes or checks the value on this path. A finding reported as "High", "Critical" or " high " is stored with that exact text.
Everything that reads the severity compares exact lowercase values:
- Notification channels:
notify.MatchcallsAtLeast(s.Severity, f.MinSeverity), andSeverityRank("High")is 0. A channel withmin_severity: "high"(or any threshold) never receives the finding. No error and no "skipped" row; it is just not delivered. - Severity counters:
COUNT(*) FILTER (WHERE severity='high')indb/findings.go:445,db/task_outcome.go:79,db/exploration.go:1646and the archive aggregates. The finding is in the total but in no severity bucket.
The HTTP path is strict (PATCH /api/findings/{id} rejects anything db.ValidSeverity does not accept), and scan_ingest.go lowercases nuclei severities. Only the agent path keeps the raw text.
Reproduce
Against a test database (ARTEX_PG_DSN set), in package db:
ch := newTestChannel(t, d, notify.KindDingTalk, NotifyModeRealtime, `{"min_severity":"high"}`)
tk, _ := d.CreateTask("severity case", "goal", nil, 0, 0)
f, _ := d.Exploration(tk.ExplorationID).RecordFinding(ctx, RecordFindingInput{
TaskID: tk.ID, Worker: "test", VulnClass: "SQL injection", Severity: " High ", Summary: "s",
})
d.FanOutPendingEvents(ctx, 1000)
// SELECT severity FROM findings WHERE id=f.FindingID -> " High "
// deliveries for (ch.ID, f.FindingID) -> 0
Output on main (b8cd251), from the regression test in the fix (the second line with the first check skipped):
stored severity = " High ", want "high"
a high finding must reach the min_severity=high channel, got 0 deliveries
Expected: the finding is stored as high, counted as high, and delivered to the channel.
Cause
db/finding_traffic.go:417, :438 and :454 (RecordFindingTx) write in.Severity unchanged into the node payload, the findings row and the notification snapshot. agent/tools.go:1782 fills it from the tool input as given.
Version: main at b8cd251.
A tested fix is ready on branch chaitanya0305:fix/finding-severity-case.
- Lingua principale
- Go
- Stelle
- 18.7k
- Fork
- 7k
- Merge medio
- 10h 41m
- PR unite (30g)
- 342
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di BaaRai/ARTEX
-
Task retarget keeps the old host in task scope and adds the new host in a form that matches nothingForse già presa @chaitanya0305 l’ha presa oggi. Apertabug P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
BaaRai/ARTEX#652 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
feature
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
BaaRai/ARTEX#648 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Stateful guard misreads curl flags: `curl -f` GET is refused, `--json` / `-d@file` / `-T` POSTs skip the leaseForse già presa @chaitanya0305 l’ha presa oggi. Apertabug P1
Difficoltà 2/5 1-3 ore Idoneità per principianti 30/100
BaaRai/ARTEX#644 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
question
Difficoltà 4/5 1-2 giorni Idoneità per principianti 20/100
BaaRai/ARTEX#620 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
TrojanApertaquestion
Difficoltà 2/5 1-3 ore Idoneità per principianti 38/100
BaaRai/ARTEX#614 · 1 commento · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di BaaRai/ARTEX
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
compiler-explorer/compiler-explorer#9710 ·
I maintainer di solito rispondono entro 1 giorno
-
Add govulncheck workflowApertaenhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
losisin/helm-values-schema-json#437 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
kubernetes-sigs/controller-runtime#3704 ·
I maintainer di solito rispondono entro 1 giorno