Documentation
¶
Overview ¶
Package labels renders the human-facing security-* label vocabulary the issue projection stamps on tracking issues: source, advisories, the finding's phase, severity, priority, and the investigation's verdict. The Finding custom resource is the state machine. These labels are a one-way projection for humans and issue searches, never parsed back into state.
GitHub caps label names at 50 characters, so Render truncates; anything a label abbreviates lives in full on the Finding.
Index ¶
Constants ¶
const ( KeySource = "security-source" KeyAdvisory = "security-advisory" KeyFinding = "security-finding" KeySeverity = "security-severity" KeyPriority = "security-priority" KeyRecommendation = "security-recommendation" KeyContext = "security-context" )
Label keys. Every patchy label is "<key>: <value>"; the multi-valued advisory key emits one label per value. This is the full human-facing vocabulary the issue projection renders. The Finding CR holds the state, so no machine or usage labels exist.
const MaxLen = 50
MaxLen is GitHub's label-name length cap; Render never emits a longer name.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Recommendation ¶
type Recommendation string
Recommendation is the investigation's verdict, in the same vocabulary the agent writes in its report frontmatter (internal/report.Recommendation).
const ( RecommendationRemediate Recommendation = "remediate" RecommendationIgnore Recommendation = "ignore" RecommendationManual Recommendation = "manual" )
The investigation verdicts.
type Set ¶
type Set struct {
Source string
Advisories []string
Finding State
Severity Level
Priority Level
Recommendation Recommendation
// Context carries enhancer attributes, one "security-context: k=v" label
// per entry.
Context map[string]string
}
Set is the typed view of one issue's patchy labels. Zero fields render no label.
func Parse ¶
Parse builds a Set from raw GitHub label names. It is tolerant: labels without a "key:" form, unknown keys, and security-context values with no "=" are ignored, and other values are kept as written without validation. Issues carry human labels too, and a foreign security-* label must never wedge the pipeline.