Documentation
¶
Index ¶
Constants ¶
View Source
const ( // PASS check passed. PASS State = "PASS" // FAIL check failed. FAIL = "FAIL" // WARN could not carry out check. WARN = "WARN" // INFO informational message INFO = "INFO" // SKIP for when a check should be skipped. SKIP = "skip" )
View Source
const TypeAudit = "audit"
TypeAudit string representing default "Audit".
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auditer ¶
type Auditer interface {
Execute(customConfig ...interface{}) (result string, errMsg string, state State)
}
Auditer represents the Execute method to be called.
type BaseCheck ¶
type BaseCheck struct {
AuditType AuditType `json:"audit_type"`
Audit interface{} `json:"audit"`
Type string `json:"type"`
Commands []*exec.Cmd `json:"-"`
Tests *auditeval.Tests `json:"-"`
Remediation string `json:"-"`
Constraints map[string][]string `yaml:"constraints"`
// contains filtered or unexported fields
}
BaseCheck (Original version) - checks don't have sub checks, each check has only one sub check as part of the check itself
type Bench ¶
type Bench interface {
RegisterAuditType(auditType AuditType, typeCallback func() interface{}) error
NewControls(in []byte, definitions []string, customConfigs ...interface{}) (*Controls, error)
}
Bench implementer of this interface represent audit types to be tests.
type Check ¶
type Check struct {
ID string `yaml:"id" json:"test_number"`
Description string `json:"test_desc" yaml:"text"`
Set bool `json:"-"`
SubChecks []*SubCheck `yaml:"sub_checks"`
AuditType AuditType `json:"audit_type"`
Audit interface{} `json:"audit"`
Type string `json:"type"`
Commands []*exec.Cmd `json:"-"`
Tests *auditeval.Tests `json:"-"`
Remediation string `json:"-"`
TestInfo []string `json:"test_info"`
State `json:"status"`
ActualValue string `json:"actual_value"`
ExpectedResult string `json:"expected_result"`
Scored bool `json:"scored"`
IsMultiple bool `yaml:"use_multiple_values"`
Reason string `json:"reason,omitempty"`
// contains filtered or unexported fields
}
Check contains information about a recommendation.
type Controls ¶
type Controls struct {
ID string `yaml:"id" json:"id"`
Description string `json:"text" yaml:"text"`
Groups []*Group `json:"tests" yaml:"groups"`
Summary
DefinedConstraints map[string][]string
// contains filtered or unexported fields
}
Controls holds all controls to check for master nodes.
func NewControls ¶
NewControls instantiates a new master Controls object.
type Group ¶
type Group struct {
ID string `yaml:"id" json:"section"`
Description string `json:"desc" yaml:"text"`
Constraints map[string][]string `yaml:"constraints"`
Type string `yaml:"type" json:"type"`
Checks []*Check `json:"results"`
Pass int `json:"pass"` // Tests with no type that passed
Fail int `json:"fail"` // Tests with no type that failed
Warn int `json:"warn"` // Tests of type manual won't be run and will be marked as Warn
Info int `json:"info"` // Tests of type skip won't be run and will be marked as Info
}
Group is a collection of similar checks.
Click to show internal directories.
Click to hide internal directories.