catalog

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package catalog provides types and loading for the control catalog.

The catalog is the authoritative set of controls the platform implements. Controls are organized into groups (technical, organizational) defined in YAML files under catalog/.

Index

Constants

View Source
const (
	ControlValidated  = "validated"   // all findings resolved with evidence
	ControlVerified   = "verified"    // all findings resolved, some lack evidence
	ControlInProgress = "in_progress" // at least one finding is being worked on
	ControlToDo       = "to_do"       // findings exist but none are resolved or active
)

ControlStatus constants for derived control states.

Variables

This section is empty.

Functions

func DeriveControlStatuses added in v0.3.1

func DeriveControlStatuses(cat *Catalog, audits *audit.AuditSet)

DeriveControlStatuses populates DerivedStatus on controls based on linked audit findings. It is safe to call multiple times (idempotent).

func EffectiveStatus added in v0.3.1

func EffectiveStatus(ctrl *Control) string

EffectiveStatus returns DerivedStatus if set, otherwise Status.

Types

type Catalog

type Catalog struct {
	Groups   []Group
	Controls map[string]*Control // keyed by control ID
}

Catalog holds all loaded control groups indexed by group and control ID.

func Load

func Load(catalogDir string, subdirs ...string) (*Catalog, error)

Load reads all catalog YAML files from the given directory.

type Control

type Control struct {
	ID                     string   `yaml:"id"`
	Title                  string   `yaml:"title"`
	Description            string   `yaml:"description"`
	Category               string   `yaml:"category"`     // technical | policy | process | physical
	CSFFunction            string   `yaml:"csf_function"` // identify | protect | detect | respond | recover | govern
	Status                 string   `yaml:"status"`       // verified | to_do | in_progress | validated
	Owner                  string   `yaml:"owner"`        // platform | operator | shared
	Components             []string `yaml:"components,omitempty"`
	References             []string `yaml:"references,omitempty"`
	OperatorResponsibility string   `yaml:"operator_responsibility,omitempty"`

	// DerivedStatus is computed by the derive step — not persisted in YAML.
	// It is set when all findings for this control are resolved with evidence.
	DerivedStatus string `yaml:"-"`
}

Control represents a single security control.

type FrameworkCatalog

type FrameworkCatalog struct {
	Framework struct {
		ID      string `yaml:"id"`
		Title   string `yaml:"title"`
		Version string `yaml:"version"`
		Source  string `yaml:"source"`
	} `yaml:"framework"`
	Requirements []FrameworkRequirement           `yaml:"requirements"`
	ByID         map[string]*FrameworkRequirement `yaml:"-"`
}

FrameworkCatalog holds the normative requirement text for a framework.

func LoadFrameworkCatalog

func LoadFrameworkCatalog(catalogDir, name string) (*FrameworkCatalog, error)

LoadFrameworkCatalog reads a framework catalog YAML (e.g. catalog/frameworks/eudi-secreq.yaml).

type FrameworkRequirement

type FrameworkRequirement struct {
	ID          string `yaml:"id"`
	Title       string `yaml:"title"`
	Section     string `yaml:"section"`
	Description string `yaml:"description"`
}

FrameworkRequirement holds the normative text for one framework requirement.

type Group

type Group struct {
	ID        string    `yaml:"id"`
	Title     string    `yaml:"title"`
	Controls  []Control `yaml:"-"`
	SourceDir string    `yaml:"-"` // subdir the group was loaded from (e.g. "technical", "organizational")
}

Group is a named collection of controls.

type GroupFile

type GroupFile struct {
	Group    Group     `yaml:"group"`
	Controls []Control `yaml:"controls"`
}

GroupFile is the top-level structure of a catalog YAML file. In the real YAML, `group:` and `controls:` are siblings at the top level.

type Metadata

type Metadata struct {
	Version string `yaml:"version"`
	Groups  []struct {
		ID   string `yaml:"id"`
		File string `yaml:"file"`
	} `yaml:"groups"`
}

Metadata is the top-level catalog descriptor.

Jump to

Keyboard shortcuts

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