Documentation
¶
Index ¶
- Constants
- type Control
- type EvidenceIndex
- type EvidenceRef
- type Framework
- type GapReport
- type Mapping
- type MappingOptions
- type MappingReport
- type MappingResult
- type MappingSummary
- type Rule
- type RuleControlResult
- type RuleMappingOptions
- type RuleMappingReport
- type RuleMappingSummary
- type RuleSet
- type RuleStatus
- type RuleView
- type Status
Constants ¶
View Source
const GapSchemaVersion = "agentprovenance.compliance_gaps/v1"
View Source
const RuleMappingSchemaVersion = "agentprovenance.compliance_rule_mapping/v1"
View Source
const SchemaVersion = "agentprovenance.compliance_mapping/v1"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Control ¶
type Control struct {
ID string `json:"id" yaml:"id"`
Title string `json:"title" yaml:"title"`
Description string `json:"description" yaml:"description"`
Evidence []string `json:"evidence" yaml:"evidence"`
Partial []string `json:"partial,omitempty" yaml:"partial"`
NotApplies []string `json:"not_applicable,omitempty" yaml:"not_applicable"`
Gap string `json:"gap" yaml:"gap"`
NextStep string `json:"recommended_next_step" yaml:"recommended_next_step"`
}
type EvidenceIndex ¶
type EvidenceIndex struct {
// contains filtered or unexported fields
}
func ResolveEvidence ¶
func ResolveEvidence(db *sql.DB, runID string) (EvidenceIndex, error)
func (EvidenceIndex) Refs ¶
func (i EvidenceIndex) Refs(kinds ...string) []EvidenceRef
func (EvidenceIndex) RequiredRefs ¶
func (i EvidenceIndex) RequiredRefs(kinds ...string) ([]EvidenceRef, bool)
type EvidenceRef ¶
type Framework ¶
type Framework struct {
ID string `json:"id" yaml:"id"`
Title string `json:"title" yaml:"title"`
Description string `json:"description" yaml:"description"`
Disclaimer string `json:"disclaimer" yaml:"disclaimer"`
Controls []Control `json:"controls" yaml:"controls"`
}
func Frameworks ¶
type GapReport ¶
type GapReport struct {
SchemaVersion string `json:"schema_version"`
Framework string `json:"framework"`
FrameworkName string `json:"framework_name"`
RunID string `json:"run_id"`
Summary MappingSummary `json:"summary"`
Items []MappingResult `json:"items"`
}
type MappingOptions ¶
type MappingReport ¶
type MappingReport struct {
SchemaVersion string `json:"schema_version"`
Framework string `json:"framework"`
FrameworkName string `json:"framework_name"`
RunID string `json:"run_id"`
Disclaimer string `json:"disclaimer"`
Summary MappingSummary `json:"summary"`
Items []MappingResult `json:"items"`
}
func MapRun ¶
func MapRun(db *sql.DB, opts MappingOptions) (MappingReport, error)
func (MappingReport) JSON ¶
func (r MappingReport) JSON() ([]byte, error)
type MappingResult ¶
type MappingResult struct {
Framework string `json:"framework"`
ItemID string `json:"item_id"`
ControlID string `json:"control_id"`
Title string `json:"title"`
Status Status `json:"status"`
EvidenceRefs []EvidenceRef `json:"evidence_refs"`
Gap string `json:"gap"`
RecommendedNextStep string `json:"recommended_next_step"`
Reason string `json:"reason"`
}
func FindItem ¶
func FindItem(report MappingReport, itemID string) (MappingResult, bool)
type MappingSummary ¶
type Rule ¶
type Rule struct {
ID string `json:"id" yaml:"id"`
Title string `json:"title" yaml:"title"`
Description string `json:"description" yaml:"description"`
Evidence []string `json:"evidence" yaml:"evidence"`
Partial []string `json:"partial,omitempty" yaml:"partial"`
NotApplies []string `json:"not_applicable,omitempty" yaml:"not_applicable"`
Gap string `json:"gap" yaml:"gap"`
NextStep string `json:"recommended_next_step" yaml:"recommended_next_step"`
}
type RuleControlResult ¶ added in v0.4.0
type RuleControlResult struct {
ControlID string `json:"control_id"`
Title string `json:"title"`
Description string `json:"description"`
Status RuleStatus `json:"status"`
Rules []RuleView `json:"rules"`
EvidenceRefs []EvidenceRef `json:"evidence_refs"`
Gap string `json:"gap"`
NextStep string `json:"recommended_next_step"`
Reason string `json:"reason"`
}
type RuleMappingOptions ¶ added in v0.4.0
type RuleMappingOptions struct {
Framework string
RunID string
// Rules is the detection rule set to map from. When nil it defaults to
// security.DefaultRules(). A deployment running a custom YAML engine should
// pass that engine's rules so custom rules (with their own controls: tags)
// participate in the mapping.
Rules []security.Rule
}
type RuleMappingReport ¶ added in v0.4.0
type RuleMappingReport struct {
SchemaVersion string `json:"schema_version"`
Framework string `json:"framework"`
FrameworkName string `json:"framework_name"`
RunID string `json:"run_id"`
Disclaimer string `json:"disclaimer"`
Summary RuleMappingSummary `json:"summary"`
Items []RuleControlResult `json:"items"`
}
func MapRunRules ¶ added in v0.4.0
func MapRunRules(db *sql.DB, opts RuleMappingOptions) (RuleMappingReport, error)
MapRunRules maps the configured detection rules onto a framework's controls for one run and reports the four-state coverage above.
type RuleMappingSummary ¶ added in v0.4.0
type RuleSet ¶
type RuleSet struct {
SchemaVersion string `json:"schema_version" yaml:"schema_version"`
ID string `json:"id" yaml:"id"`
Title string `json:"title" yaml:"title"`
Description string `json:"description" yaml:"description"`
Disclaimer string `json:"disclaimer" yaml:"disclaimer"`
Frameworks []Framework `json:"frameworks" yaml:"frameworks"`
Rules []Rule `json:"rules" yaml:"rules"`
Mappings []Mapping `json:"mappings" yaml:"mappings"`
}
func LoadRuleSet ¶
type RuleStatus ¶ added in v0.4.0
type RuleStatus string
const ( RuleStatusEnforced RuleStatus = "enforced" RuleStatusDetected RuleStatus = "detected" RuleStatusNotTriggered RuleStatus = "not_triggered" RuleStatusNoRule RuleStatus = "no_rule" )
type RuleView ¶ added in v0.4.0
type RuleView struct {
ID string `json:"id"`
Reason string `json:"reason"`
Mode string `json:"mode"` // enforce | detect
Intended string `json:"intended_decision"` // deny | quarantine | kill
Fired int `json:"fired"`
Enforced bool `json:"enforced"`
}
RuleView is one detection rule mapped to a control, plus how it behaved this run. Mode/Intended come from the rule definition; Fired/Enforced from the run's policy_decisions.
Click to show internal directories.
Click to hide internal directories.