Documentation
¶
Overview ¶
Package suppress holds the shared "ignore rule" matching logic used by every scanner pipeline (SAST family, SCA, license, malscan) to drop findings that an org-level or local Suppression covers, before report output is generated.
A rule is anchored by one or more of: rego rule id (the rego file id), a finding id (CVE/vuln id), or a file path. A finding is suppressed when every anchor the rule specifies matches the finding and the rule is active and unexpired.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RepoFullName ¶
RepoFullName derives "owner/repo" from the first parseable git remote URL. Supports scp-style (git@github.com:owner/repo.git) and URL-style (https://host/owner/repo.git) remotes. Returns "" when none parse.
Types ¶
type Rule ¶
type Rule struct {
UUID string
RuleID string
Category string
Type string
Reason string
FindingID string
FilePath string
LineRange string
RepositoryFullName string
Branch string
ExpiresAt int64
IsActive bool
}
Rule is the normalized form a Set matches against. It is produced from a memory.SuppressionRecord (local) or a backend Suppression (remote).
func FromMemory ¶
func FromMemory(recs []memory.SuppressionRecord) []Rule
FromMemory converts local suppression records to matcher rules.
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set is a matchable collection of rules.
func (*Set) Suppresses ¶
Suppresses is Match without the matched rule.