requirement

package
v0.0.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactSet

type ArtifactSet struct {
	Catalogs map[string]*gemara.ControlCatalog
	Policies map[string]*gemara.Policy
	Guidance map[string]*gemara.GuidanceCatalog
	Mappings map[string]*gemara.MappingDocument
}

ArtifactSet holds classified artifacts keyed by metadata.id.

func Classify

func Classify(data ...[]byte) (*ArtifactSet, error)

Classify detects and unmarshals raw artifact data into an ArtifactSet.

func ClassifyBundle

func ClassifyBundle(b *bundle.Bundle) (*ArtifactSet, error)

ClassifyBundle classifies a bundle's files and imports into an ArtifactSet.

func NewArtifactSet

func NewArtifactSet() *ArtifactSet

NewArtifactSet returns an initialized ArtifactSet.

func (*ArtifactSet) Merge

func (as *ArtifactSet) Merge(other *ArtifactSet) error

Merge combines another ArtifactSet into this one. Returns an error if any artifact ID appears in both sets.

type DeltaReport added in v0.0.4

type DeltaReport struct {
	PolicyID         string                `json:"policy"`
	CatalogsCompared []string              `json:"catalogs_compared"`
	Comparisons      []ParameterComparison `json:"comparisons"`
}

DeltaReport is the result of gathering parameter comparisons across a resolved policy.

func AnalyzeDelta added in v0.0.4

func AnalyzeDelta(rp *ResolvedPolicy, set *ArtifactSet) (*DeltaReport, error)

AnalyzeDelta gathers L3 parameter values alongside the L1/L2 requirement text they map to. Returns structured pairs for the caller to interpret — no verdicts or heuristics.

type ParameterComparison added in v0.0.4

type ParameterComparison struct {
	// RequirementID is the assessment requirement this comparison targets (e.g. "CTL-TLS-001-AR1").
	RequirementID string `json:"requirement_id"`
	// Label is the parameter name from the policy's assessment plan (e.g. "tls_minimum_version").
	Label string `json:"label"`
	// PolicyValue is the concrete value the L3 policy sets for this parameter.
	PolicyValue string `json:"policy_value"`
	// PolicySource is the ID of the policy that provides the parameter value.
	PolicySource string `json:"policy_source"`
	// RequirementText is the L1/L2 assessment requirement text from the catalog.
	RequirementText string `json:"requirement_text"`
	// CatalogSource is the ID of the catalog that defines the requirement.
	CatalogSource string `json:"catalog_source"`
}

ParameterComparison pairs a structured L3 parameter with the L1/L2 requirement text it maps to. The caller interprets the relationship — the engine does not judge.

type ResolvedPolicy

type ResolvedPolicy struct {
	Policy           gemara.Policy
	ControlCatalogs  []gemara.ControlCatalog
	GuidanceCatalogs []gemara.GuidanceCatalog
	Unresolved       []string
	// contains filtered or unexported fields
}

ResolvedPolicy is a fully resolved policy with eagerly built indexes.

func ResolvePolicy

func ResolvePolicy(policy gemara.Policy, set *ArtifactSet) (*ResolvedPolicy, error)

ResolvePolicy resolves a policy's imports against the artifact set.

func (*ResolvedPolicy) ControlCatalog

func (rp *ResolvedPolicy) ControlCatalog(id string) *gemara.ControlCatalog

ControlCatalog returns the resolved catalog with the given ID, or nil.

func (*ResolvedPolicy) ControlIDs

func (rp *ResolvedPolicy) ControlIDs() []string

ControlIDs returns all control IDs across resolved catalogs.

func (*ResolvedPolicy) GuidanceCatalog

func (rp *ResolvedPolicy) GuidanceCatalog(id string) *gemara.GuidanceCatalog

GuidanceCatalog returns the resolved guidance catalog with the given ID, or nil.

func (*ResolvedPolicy) ImportedGuidanceIDs added in v0.0.4

func (rp *ResolvedPolicy) ImportedGuidanceIDs() []string

ImportedGuidanceIDs returns the metadata IDs of guidance catalogs imported by this policy. Guidance catalogs loaded in the artifact set but not in this list are "under evaluation" — available for crosswalk but not mandated.

func (*ResolvedPolicy) ParametersForRequirement

func (rp *ResolvedPolicy) ParametersForRequirement(reqID string) []gemara.Parameter

ParametersForRequirement returns parameters from assessment plans for the given requirement ID.

func (*ResolvedPolicy) RequirementsForControl

func (rp *ResolvedPolicy) RequirementsForControl(controlID string) []gemara.AssessmentRequirement

RequirementsForControl returns assessment requirements for the given control ID.

Jump to

Keyboard shortcuts

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