Documentation ¶
Index ¶
- Constants
- func AddControlSummary(total *reportingTypes.NodeControlSummary, ...)
- func CurrentTime() string
- func FixInheritedProfiles(reportProfiles []*inspec_api.Profile) (fixedProfiles []*inspec_api.Profile)
- func NameSha(p *inspec_api.Profile) string
- func ProfileControlSummary(profile *inspec_api.Profile) *reportingTypes.NodeControlSummary
- func ProfilesFromReport(reportProfiles []*inspec_api.Profile) (profiles []*relaxting.ESInspecProfile, err error)
- func ReportComplianceStatus(summary *reportingTypes.NodeControlSummary) (status string)
- func ReportProfilesFromInSpecProfiles(profiles []*inspec_api.Profile, ...) (profilesRep []relaxting.ESInSpecReportProfile)
- func WaivedStr(data *inspec_api.WaiverData) (str string)
- type AttributeOption
Constants ¶
const DocVersion = "1"
Variables ¶
This section is empty.
Functions ¶
func AddControlSummary ¶
func AddControlSummary(total *reportingTypes.NodeControlSummary, sum reportingTypes.NodeControlSummary)
AddControlSummary adds the control counts from 'sum' to 'total'
func CurrentTime ¶
func CurrentTime() string
func FixInheritedProfiles ¶
func FixInheritedProfiles(reportProfiles []*inspec_api.Profile) (fixedProfiles []*inspec_api.Profile)
FixInheritedProfiles updates profiles so they include all controls from the profiles they depend on Dependent profiles will be removed from the list of profiles
func NameSha ¶
func NameSha(p *inspec_api.Profile) string
func ProfileControlSummary ¶
func ProfileControlSummary(profile *inspec_api.Profile) *reportingTypes.NodeControlSummary
ProfileControlSummary returns a NodeControlSummary struct with the counted controls based on their status and criticality, This is working on all profiles embedded in a full json report. total: count for all controls in the report, e.g. 100 waived: count for all waived controls, e.g. 5 passed.total: count for all controls that executed successfully, e.g. 35 skipped.total: count for all skipped controls, e.g. 10 failed.total: count for all failed controls, e.g. 50 failed.minor/major/critical: split the total failed controls in 3 buckets based on the criticality, e.g. minor: 10, major: 15, critical: 25
func ProfilesFromReport ¶
func ProfilesFromReport(reportProfiles []*inspec_api.Profile) (profiles []*relaxting.ESInspecProfile, err error)
ProfilesFromReport takes the profiles array of an inspec full json report and returns the profiles with only the static information, without the results of the controls as the report has it
func ReportComplianceStatus ¶
func ReportComplianceStatus(summary *reportingTypes.NodeControlSummary) (status string)
ReportComplianceStatus returns the overall compliance status of a report based on the passed/failed/skipped/waived control counts
func ReportProfilesFromInSpecProfiles ¶
func ReportProfilesFromInSpecProfiles(profiles []*inspec_api.Profile, profilesSums []relaxting.ESInSpecSummaryProfile, enableLargeReporting bool) (profilesRep []relaxting.ESInSpecReportProfile)
ReportProfilesFromInSpecProfiles extracts the reports specific information from the profile, leaving out the static profile data
func WaivedStr ¶
func WaivedStr(data *inspec_api.WaiverData) (str string)
WaivedStr returns a string label based on the control waived status
Types ¶
type AttributeOption ¶
type AttributeOption struct { Description *string `json:"description,omitempty"` Default interface{} `json:"default,omitempty"` }