compliance

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const GapSchemaVersion = "agentprovenance.compliance_gaps/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 EvidenceRef struct {
	Ref     string `json:"ref"`
	Kind    string `json:"kind"`
	ID      string `json:"id"`
	Summary string `json:"summary,omitempty"`
}

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

func Frameworks(ruleSets ...RuleSet) []Framework

func GetFramework

func GetFramework(id string, ruleSets ...RuleSet) (Framework, bool)

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"`
}

func Gaps

func Gaps(report MappingReport, missingOnly bool, limit int) GapReport

type Mapping

type Mapping struct {
	Framework       string   `json:"framework" yaml:"framework"`
	Rules           []string `json:"rules" yaml:"rules"`
	BuiltinControls []string `json:"builtin_controls" yaml:"builtin_controls"`
}

type MappingOptions

type MappingOptions struct {
	Framework string
	RunID     string
	RuleSet   *RuleSet
	Only      []string
	Exclude   []string
}

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 MappingSummary struct {
	Covered       int `json:"covered"`
	Partial       int `json:"partial"`
	Missing       int `json:"missing"`
	NotApplicable int `json:"not_applicable"`
	Total         int `json:"total"`
}

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 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

func LoadRuleSet(path string) (RuleSet, error)

func (RuleSet) Validate

func (r RuleSet) Validate() error

type Status

type Status string
const (
	StatusCovered       Status = "covered"
	StatusPartial       Status = "partial"
	StatusMissing       Status = "missing"
	StatusNotApplicable Status = "not_applicable"
)

Jump to

Keyboard shortcuts

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