Documentation ¶
Index ¶
- Variables
- type Certification
- type Control
- type Justifications
- func (justifications *Justifications) Add(standardKey string, controlKey string, componentKey string, ...)
- func (justifications *Justifications) Get(standardKey string, controlKey string) Verifications
- func (justifications *Justifications) GetAndApply(standardKey string, controlKey string, ...)
- func (justifications *Justifications) LoadMappings(component base.Component)
- type OpenControl
- func (openControl *OpenControl) LoadCertification(certificationFile string) error
- func (openControl *OpenControl) LoadComponent(componentDir string) error
- func (openControl *OpenControl) LoadComponents(directory string) []error
- func (openControl *OpenControl) LoadStandard(standardFile string) error
- func (openControl *OpenControl) LoadStandards(standardsDir string) []error
- type Standard
- type Standards
- type Verification
- type Verifications
Constants ¶
This section is empty.
Variables ¶
var ( // ErrReadFile is raised when a file can not be read ErrReadFile = errors.New("Unable to read the file") // ErrCertificationSchema is raised a certification cannot be parsed ErrCertificationSchema = errors.New("Unable to parse certification") // ErrStandardSchema is raised a standard cannot be parsed ErrStandardSchema = errors.New("Unable to parse standard") )
Functions ¶
This section is empty.
Types ¶
type Certification ¶
type Certification struct { Key string `yaml:"name" json:"name"` Standards map[string]Standard `yaml:"standards" json:"standards"` }
Certification struct is a collection of specific standards and controls Schema info: https://github.com/opencontrol/schemas#certifications
func (Certification) GetSortedData ¶
func (certification Certification) GetSortedData(callback func(string, string))
GetSortedData returns a list of sorted standards
type Control ¶
type Control struct { Family string `yaml:"family" json:"family"` Name string `yaml:"name" json:"name"` }
Control struct stores data on a specific security requirement Schema info: https://github.com/opencontrol/schemas#standards-documentation
type Justifications ¶
Justifications struct contains the mapping that links controls to specific components
func NewJustifications ¶
func NewJustifications() *Justifications
NewJustifications creates a new justification
func (*Justifications) Add ¶
func (justifications *Justifications) Add(standardKey string, controlKey string, componentKey string, satisfies base.Satisfies)
Add methods adds a new mapping to the justification while locking
func (*Justifications) Get ¶
func (justifications *Justifications) Get(standardKey string, controlKey string) Verifications
Get retrieves justifications for a specific standard and control
func (*Justifications) GetAndApply ¶
func (justifications *Justifications) GetAndApply(standardKey string, controlKey string, callback func(selectJustifications Verifications))
GetAndApply get a justification set and apply a generic function
func (*Justifications) LoadMappings ¶
func (justifications *Justifications) LoadMappings(component base.Component)
LoadMappings loads a set of mappings from a component
type OpenControl ¶
type OpenControl struct { Components *components.Components Standards *Standards Justifications *Justifications Certification *Certification }
OpenControl struct combines components, standards, and a certification data For more information on the opencontrol schema visit: https://github.com/opencontrol/schemas
func LoadData ¶
func LoadData(openControlDir string, certificationPath string) (*OpenControl, []error)
LoadData creates a new instance of OpenControl struct and loads the components, standards, and certification data.
func NewOpenControl ¶
func NewOpenControl() *OpenControl
NewOpenControl initializes an empty OpenControl struct
func (*OpenControl) LoadCertification ¶
func (openControl *OpenControl) LoadCertification(certificationFile string) error
LoadCertification struct loads certifications into a Certification struct and add it to the main object.
func (*OpenControl) LoadComponent ¶
func (openControl *OpenControl) LoadComponent(componentDir string) error
LoadComponent imports components into a Component struct and adds it to the Components map.
func (*OpenControl) LoadComponents ¶
func (openControl *OpenControl) LoadComponents(directory string) []error
LoadComponents loads multiple components by searching for components in a given directory
func (*OpenControl) LoadStandard ¶
func (openControl *OpenControl) LoadStandard(standardFile string) error
LoadStandard imports a standard into the Standard struct and adds it to the main object.
func (*OpenControl) LoadStandards ¶
func (openControl *OpenControl) LoadStandards(standardsDir string) []error
LoadStandards loads multiple standards by searching for components in a given directory
type Standard ¶
type Standard struct { Name string `yaml:"name" json:"name"` Controls map[string]Control `yaml:",inline"` }
Standard struct is a collection of security requirements Schema info: https://github.com/opencontrol/schemas#standards-documentation
func (Standard) GetSortedData ¶
GetSortedData returns a list of sorted controls
type Standards ¶
Standards struct is a thread save mapping of Standards
func NewStandards ¶
func NewStandards() *Standards
NewStandards creates an instance of Components struct
type Verification ¶
Verification struct holds data for a specific component and verification This is an internal data structure that helps map standards and controls to components
type Verifications ¶
type Verifications []Verification
Verifications is a slice of type Verifications
func (Verifications) Len ¶
func (slice Verifications) Len() int
Len returns the length of the GeneralReferences slice
func (Verifications) Less ¶
func (slice Verifications) Less(i, j int) bool
Less returns true if a GeneralReference is less than another reference
func (Verifications) Swap ¶
func (slice Verifications) Swap(i, j int)
Swap swaps the two GeneralReferences