Documentation
¶
Overview ¶
Command cwssgen rewrites the "cwss" metadata line of every rule in internal/sast/rules from the rule's own severity, CWEs and tags, using the shared derivation in vdb-sca-match/cwss.
It exists because the vectors the rules shipped were not CWSS. Across 1208 rules there were only 11 distinct strings, and nine of their sixteen metrics used values CWSS 1.0.1 does not define — AS:L, IN:L and SC:N in every one of them, plus CONF and T, which are not CWSS metrics at all. Scored as CWSS they all landed between 0.47 and 0.74, so a rule declaring "critical" and one declaring "low" both came out "low".
Run via:
just gen-cwss # go run ./internal/sast/cwssgen
internal/sast's TestRuleCWSSVectorsAreValid fails the build if a rule's vector stops being valid CWSS, so a hand-edited rule cannot reintroduce the problem.