cwssgen

command
v4.24.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL