Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssessmentRequirement ¶
type Capability ¶
type Catalog ¶
type Catalog struct {
Metadata Metadata `json:"metadata,omitempty" yaml:"metadata,omitempty"`
ControlFamilies []ControlFamily `json:"control-families,omitempty" yaml:"control-families,omitempty"`
Threats []Threat `json:"threats,omitempty" yaml:"threats,omitempty"`
Capabilities []Capability `json:"capabilities,omitempty" yaml:"capabilities,omitempty"`
ImportedControls []Mapping `json:"imported-controls,omitempty" yaml:"imported-controls,omitempty"`
ImportedThreats []Mapping `json:"imported-threats,omitempty" yaml:"imported-threats,omitempty"`
ImportedCapabilities []Mapping `json:"imported-capabilities,omitempty" yaml:"imported-capabilities,omitempty"`
}
func (*Catalog) LoadFile ¶
LoadFile loads data from a single YAML or JSON file at the provided path. sourcePath is expected to be a file or https URI in the form file:///path/to/file.yaml or https://example.com/file.yaml. If run multiple times for the same data type, this method will override previous data.
func (*Catalog) LoadFiles ¶
LoadFiles loads data from any number of YAML or JSON files at the provided paths. sourcePath are expected to be file or https URIs in the form file:///path/to/file.yaml or https://example.com/file.yaml. If run multiple times, this method will append new data to previous data.
func (*Catalog) LoadNestedCatalog ¶ added in v0.6.0
LoadNestedCatalog loads a YAML file containing a nested catalog. Only supports a single layer of nesting. Accepts file URIs with the 'file:///' prefix. Throws an error if the URL is not https. TODO: Consider validating/sanitizing inputs to reduce injection risks.
func (*Catalog) ToOSCAL ¶ added in v0.4.0
ToOSCAL converts a Catalog to OSCAL Catalog format. Parameters:
- controlHREF: URL template for linking to controls. Uses format: controlHREF(version, controlID) Example: "https://baseline.openssf.org/versions/%s#%s"
The function automatically:
- Uses the catalog's internal version from Metadata.Version
- Uses the ControlFamily.Id as the OSCAL group ID
- Generates a unique UUID for the catalog
type Control ¶
type Control struct {
Id string `json:"id" yaml:"id"`
Title string `json:"title" yaml:"title"`
Objective string `json:"objective" yaml:"objective"`
AssessmentRequirements []AssessmentRequirement `json:"assessment-requirements" yaml:"assessment-requirements"`
GuidelineMappings []Mapping `json:"guideline-mappings,omitempty" yaml:"guideline-mappings,omitempty"`
ThreatMappings []Mapping `json:"threat-mappings,omitempty" yaml:"threat-mappings,omitempty"`
}
type ControlFamily ¶
type Mapping ¶
type Mapping struct {
ReferenceId string `json:"reference-id" yaml:"reference-id"`
Entries []MappingEntry `json:"entries" yaml:"entries"`
Remarks string `json:"remarks,omitempty" yaml:"remarks,omitempty"`
}
type MappingEntry ¶
type MappingReference ¶
type Metadata ¶
type Metadata struct {
Id string `json:"id" yaml:"id"`
Title string `json:"title" yaml:"title"`
Description string `json:"description" yaml:"description"`
Version string `json:"version,omitempty" yaml:"version,omitempty"`
LastModified string `json:"last-modified,omitempty" yaml:"last-modified,omitempty"`
ApplicabilityCategories []Category `json:"applicability-categories,omitempty" yaml:"applicability-categories,omitempty"`
MappingReferences []MappingReference `json:"mapping-references,omitempty" yaml:"mapping-references,omitempty"`
}
Resuable types //
type Threat ¶
type Threat struct {
Id string `json:"id" yaml:"id"`
Title string `json:"title" yaml:"title"`
Description string `json:"description" yaml:"description"`
Capabilities []Mapping `json:"capabilities" yaml:"capabilities"`
ExternalMappings []Mapping `json:"external-mappings,omitempty" yaml:"external-mappings,omitempty"`
}