Documentation
¶
Overview ¶
Package rules loads bumper's declarative rule set. Rules are authored in YAML with a CEL expression as the predicate; this package compiles each predicate once at load time so the engine can evaluate it against every change cheaply.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Rule ¶
type Rule struct {
ID string `yaml:"id"`
Severity string `yaml:"severity"`
Resource string `yaml:"resource"` // resource-type filter, e.g. aws_security_group ("" = any)
On []string `yaml:"on"` // change actions this rule applies to ("" = any)
When string `yaml:"when"` // CEL predicate, must evaluate to bool
Title string `yaml:"title"`
Fix string `yaml:"fix"`
Refs []string `yaml:"refs"`
// Provenance — where this rule came from.
Source string `yaml:"source"` // "custom" | "trivy"
AVD string `yaml:"avd"` // original Trivy/AVD id, e.g. AVD-AWS-0180 ("" for custom)
Provider string `yaml:"provider"` // "aws" | "gcp" | ... ("" = infer from resource prefix)
// contains filtered or unexported fields
}
Rule is one declarative check. When (a CEL expression) is evaluated against a normalized resource change; if it returns true, the engine emits a finding.
type Set ¶
type Set struct {
Rules []*Rule
// contains filtered or unexported fields
}
Set is a loaded, compiled collection of rules with an id index for O(1) lookup (used by `explain` and findings provenance).
Click to show internal directories.
Click to hide internal directories.