Documentation
¶
Index ¶
- Constants
- func BackMatterToMap(backMatter oscalTypes_1_1_2.BackMatter) (resourceMap map[string]string)
- func CompareControls(a, b string) bool
- func CompareControlsInt(a, b string) int
- func ComponentFromCatalog(command string, source string, catalog *oscalTypes_1_1_2.Catalog, ...) (*oscalTypes_1_1_2.ComponentDefinition, error)
- func ControlImplementationstToRequirementsMap(controlImplementations *[]oscalTypes_1_1_2.ControlImplementationSet) (requirementMap map[string]Requirement)
- func ControlToImplementedRequirement(control *oscalTypes_1_1_2.Control, targetRemarks []string) (...)
- func ConvertOSCALToBytes(model *oscalTypes_1_1_2.OscalModels, fileExt string) ([]byte, error)
- func CreateObservation(method string, relevantEvidence *[]oscalTypes_1_1_2.RelevantEvidence, ...) oscalTypes_1_1_2.Observation
- func CreateResult(findingMap map[string]oscalTypes_1_1_2.Finding, ...) (oscalTypes_1_1_2.Result, error)
- func EvaluateResults(thresholdResult *oscalTypes_1_1_2.Result, newResult *oscalTypes_1_1_2.Result) (bool, map[string]result.ResultComparisonMap, error)
- func FilterControlImplementations(componentDefinition *oscalTypes_1_1_2.ComponentDefinition) (controlMap map[string][]oscalTypes_1_1_2.ControlImplementationSet)
- func FilterResults(resultMap map[string]*oscalTypes_1_1_2.AssessmentResults) map[string]EvalResult
- func GenerateAssessmentResults(results []oscalTypes_1_1_2.Result) (*oscalTypes_1_1_2.AssessmentResults, error)
- func GetOscalModel(model *oscalTypes_1_1_2.OscalModels) (modelType string, err error)
- func GetProp(name string, namespace string, props *[]oscalTypes_1_1_2.Property) (bool, string)
- func InjectIntoOSCALModel(target *oscalTypes_1_1_2.OscalModels, values map[string]interface{}, ...) (*oscalTypes_1_1_2.OscalModels, error)
- func MakeAssessmentResultsDeterministic(assessment *oscalTypes_1_1_2.AssessmentResults)
- func MakeComponentDeterminstic(component *oscalTypes_1_1_2.ComponentDefinition)
- func MergeAssessmentResults(original *oscalTypes_1_1_2.AssessmentResults, ...) (*oscalTypes_1_1_2.AssessmentResults, error)
- func MergeComponentDefinitions(original *oscalTypes_1_1_2.ComponentDefinition, ...) (*oscalTypes_1_1_2.ComponentDefinition, error)
- func MergeOscalModels(existingModel *oscalTypes_1_1_2.OscalModels, ...) (*oscalTypes_1_1_2.OscalModels, error)
- func NewAssessmentResults(data []byte) (*oscalTypes_1_1_2.AssessmentResults, error)
- func NewCatalog(data []byte) (catalog *oscalTypes_1_1_2.Catalog, err error)
- func NewOscalComponentDefinition(data []byte) (componentDefinition *oscalTypes_1_1_2.ComponentDefinition, err error)
- func NewOscalModel(data []byte) (*oscalTypes_1_1_2.OscalModels, error)
- func OverwriteOscalModel(filePath string, model *oscalTypes_1_1_2.OscalModels) error
- func UpdateProps(name string, namespace string, value string, ...)
- func ValidOSCALModelAtPath(path string) (bool, error)
- func WriteOscalModel(filePath string, model *oscalTypes_1_1_2.OscalModels) error
- type EvalResult
- type Requirement
Constants ¶
const ( LULA_NAMESPACE = "https://docs.lula.dev/oscal/ns" LULA_KEYWORD = "lula" )
const OSCAL_VERSION = "1.1.2"
Variables ¶
This section is empty.
Functions ¶
func BackMatterToMap ¶
func BackMatterToMap(backMatter oscalTypes_1_1_2.BackMatter) (resourceMap map[string]string)
Returns a map of the uuid - description of the back-matter resources
func CompareControls ¶ added in v0.6.0
CompareControls compares two control titles, handling both XX-##.## formats and regular strings. true sorts a before b; false sorts b before a
func CompareControlsInt ¶ added in v0.8.0
CompareControlsInt compares two controls by their title, handling both XX-##.## formats and regular strings. returns -1 if a < b, 0 if a == b, and 1 if a > b TODO: add tests for this function
func ComponentFromCatalog ¶ added in v0.3.0
func ComponentFromCatalog(command string, source string, catalog *oscalTypes_1_1_2.Catalog, componentTitle string, targetControls []string, targetRemarks []string, framework string) (*oscalTypes_1_1_2.ComponentDefinition, error)
Creates a component-definition from a catalog and identified (or all) controls. Allows for specification of what the content of the remarks section should contain.
func ControlImplementationstToRequirementsMap ¶ added in v0.4.5
func ControlImplementationstToRequirementsMap(controlImplementations *[]oscalTypes_1_1_2.ControlImplementationSet) (requirementMap map[string]Requirement)
func ControlToImplementedRequirement ¶ added in v0.3.0
func ControlToImplementedRequirement(control *oscalTypes_1_1_2.Control, targetRemarks []string) (implementedRequirement oscalTypes_1_1_2.ImplementedRequirementControlImplementation, err error)
Consume a control - Identify statements - iterate through parts in order to create a description
func ConvertOSCALToBytes ¶ added in v0.9.0
func ConvertOSCALToBytes(model *oscalTypes_1_1_2.OscalModels, fileExt string) ([]byte, error)
ConvertOSCALToBytes returns a byte slice representation of an OSCAL model
func CreateObservation ¶ added in v0.4.0
func CreateObservation(method string, relevantEvidence *[]oscalTypes_1_1_2.RelevantEvidence, validation *types.LulaValidation, resourcesHref string, descriptionPattern string, descriptionArgs ...any) oscalTypes_1_1_2.Observation
Helper function to create observation
func CreateResult ¶ added in v0.4.5
func CreateResult(findingMap map[string]oscalTypes_1_1_2.Finding, observations []oscalTypes_1_1_2.Observation) (oscalTypes_1_1_2.Result, error)
Creates a result from findings and observations
func EvaluateResults ¶ added in v0.4.0
func EvaluateResults(thresholdResult *oscalTypes_1_1_2.Result, newResult *oscalTypes_1_1_2.Result) (bool, map[string]result.ResultComparisonMap, error)
func FilterControlImplementations ¶ added in v0.4.5
func FilterControlImplementations(componentDefinition *oscalTypes_1_1_2.ComponentDefinition) (controlMap map[string][]oscalTypes_1_1_2.ControlImplementationSet)
func FilterResults ¶ added in v0.4.5
func FilterResults(resultMap map[string]*oscalTypes_1_1_2.AssessmentResults) map[string]EvalResult
filterResults consumes many assessment-results objects and builds out a map of EvalResults filtered by target this function looks at the target prop as the key in the map
func GenerateAssessmentResults ¶
func GenerateAssessmentResults(results []oscalTypes_1_1_2.Result) (*oscalTypes_1_1_2.AssessmentResults, error)
func GetOscalModel ¶ added in v0.4.0
func GetOscalModel(model *oscalTypes_1_1_2.OscalModels) (modelType string, err error)
func InjectIntoOSCALModel ¶ added in v0.7.0
func InjectIntoOSCALModel(target *oscalTypes_1_1_2.OscalModels, values map[string]interface{}, path string) (*oscalTypes_1_1_2.OscalModels, error)
InjectIntoOSCALModel takes a model target and a map[string]interface{} of values to inject into the model
func MakeAssessmentResultsDeterministic ¶ added in v0.4.4
func MakeAssessmentResultsDeterministic(assessment *oscalTypes_1_1_2.AssessmentResults)
func MakeComponentDeterminstic ¶ added in v0.4.4
func MakeComponentDeterminstic(component *oscalTypes_1_1_2.ComponentDefinition)
func MergeAssessmentResults ¶ added in v0.3.0
func MergeAssessmentResults(original *oscalTypes_1_1_2.AssessmentResults, latest *oscalTypes_1_1_2.AssessmentResults) (*oscalTypes_1_1_2.AssessmentResults, error)
func MergeComponentDefinitions ¶ added in v0.3.0
func MergeComponentDefinitions(original *oscalTypes_1_1_2.ComponentDefinition, latest *oscalTypes_1_1_2.ComponentDefinition) (*oscalTypes_1_1_2.ComponentDefinition, error)
This function should perform a merge of two component-definitions where maintaining the original component-definition is the primary concern.
func MergeOscalModels ¶ added in v0.3.0
func MergeOscalModels(existingModel *oscalTypes_1_1_2.OscalModels, newModel *oscalTypes_1_1_2.OscalModels, modelType string) (*oscalTypes_1_1_2.OscalModels, error)
func NewAssessmentResults ¶
func NewAssessmentResults(data []byte) (*oscalTypes_1_1_2.AssessmentResults, error)
NewAssessmentResults creates a new assessment results object from the given data.
func NewCatalog ¶ added in v0.3.0
func NewCatalog(data []byte) (catalog *oscalTypes_1_1_2.Catalog, err error)
NewCatalog creates a new catalog object from the given data.
func NewOscalComponentDefinition ¶
func NewOscalComponentDefinition(data []byte) (componentDefinition *oscalTypes_1_1_2.ComponentDefinition, err error)
NewOscalComponentDefinition consumes a byte array and returns a new single OscalComponentDefinitionModel object Standard use is to read a file from the filesystem and pass the []byte to this function
func NewOscalModel ¶ added in v0.3.0
func NewOscalModel(data []byte) (*oscalTypes_1_1_2.OscalModels, error)
func OverwriteOscalModel ¶ added in v0.8.0
func OverwriteOscalModel(filePath string, model *oscalTypes_1_1_2.OscalModels) error
OverwriteOscalModel takes a path and writes content to a file - does not check for existing content supports both json and yaml
func UpdateProps ¶ added in v0.4.0
func UpdateProps(name string, namespace string, value string, props *[]oscalTypes_1_1_2.Property)
UpdateProps updates a property in a slice of properties or adds if not exists
func ValidOSCALModelAtPath ¶ added in v0.9.0
ValidOSCALModelAtPath takes a path and returns a bool indicating if the model exists/is valid bool = T/F that oscal model exists, error = if not nil OSCAL model is invalid
func WriteOscalModel ¶ added in v0.3.0
func WriteOscalModel(filePath string, model *oscalTypes_1_1_2.OscalModels) error
WriteOscalModel takes a path and writes content to a file while performing checks for existing content supports both json and yaml
Types ¶
type EvalResult ¶ added in v0.4.5
type EvalResult struct {
Threshold *oscalTypes_1_1_2.Result
Results []*oscalTypes_1_1_2.Result
Latest *oscalTypes_1_1_2.Result
}
type Requirement ¶ added in v0.4.0
type Requirement struct {
ImplementedRequirement *oscalTypes_1_1_2.ImplementedRequirementControlImplementation
ControlImplementation *oscalTypes_1_1_2.ControlImplementationSet
}