Documentation ¶
Index ¶
- Constants
- func AddControlSummary(total *reportingTypes.NodeControlSummary, ...)
- func CurrentTime() string
- func FixInheritedProfiles(reportProfiles []*inspec.Profile) (fixedProfiles []*inspec.Profile)
- func NameSha(p *inspec.Profile) string
- func ProfileControlSummary(profile *inspec.Profile) *reportingTypes.NodeControlSummary
- func ProfilesFromReport(reportProfiles []*inspec.Profile) (profiles []*relaxting.ESInspecProfile, err error)
- func ReportComplianceStatus(summary *reportingTypes.NodeControlSummary) (status string)
- func ReportProfilesFromInSpecProfiles(profiles []*inspec.Profile, profilesSums []relaxting.ESInSpecSummaryProfile) (profilesRep []relaxting.ESInSpecReportProfile)
- type AttributeOption
- type Report
- func (*Report) Descriptor() ([]byte, []int)
- func (m *Report) GetChefTags() []string
- func (m *Report) GetEndTime() string
- func (m *Report) GetEnvironment() string
- func (m *Report) GetFqdn() string
- func (m *Report) GetIpaddress() string
- func (m *Report) GetJobUuid() string
- func (m *Report) GetNodeName() string
- func (m *Report) GetNodeUuid() string
- func (m *Report) GetOrganizationName() string
- func (m *Report) GetOtherChecks() []string
- func (m *Report) GetPlatform() *inspec.Platform
- func (m *Report) GetPolicyGroup() string
- func (m *Report) GetPolicyName() string
- func (m *Report) GetProfiles() []*inspec.Profile
- func (m *Report) GetRecipes() []string
- func (m *Report) GetReportUuid() string
- func (m *Report) GetRoles() []string
- func (m *Report) GetSourceAccountId() string
- func (m *Report) GetSourceFqdn() string
- func (m *Report) GetSourceId() string
- func (m *Report) GetSourceRegion() string
- func (m *Report) GetStatistics() *inspec.Statistics
- func (m *Report) GetTags() []*common.Kv
- func (m *Report) GetType() string
- func (m *Report) GetVersion() string
- func (*Report) ProtoMessage()
- func (m *Report) Reset()
- func (m *Report) String() string
- func (report *Report) ToJSON() (string, error)
- func (m *Report) XXX_DiscardUnknown()
- func (m *Report) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Report) XXX_Merge(src proto.Message)
- func (m *Report) XXX_Size() int
- func (m *Report) XXX_Unmarshal(b []byte) error
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 ¶
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 ProfileControlSummary ¶
func ProfileControlSummary(profile *inspec.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 passed.total: count for all controls that executed successfully, e.g. 40 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.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 control counts
func ReportProfilesFromInSpecProfiles ¶
func ReportProfilesFromInSpecProfiles(profiles []*inspec.Profile, profilesSums []relaxting.ESInSpecSummaryProfile) (profilesRep []relaxting.ESInSpecReportProfile)
ReportProfilesFromInSpecProfiles extracts the reports specific information from the profile, leaving out the static profile data
Types ¶
type AttributeOption ¶
type AttributeOption struct { Description *string `json:"description,omitempty"` Default interface{} `json:"default,omitempty"` }
type Report ¶
type Report struct { // inspec full json report fields Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` Platform *inspec.Platform `protobuf:"bytes,16,opt,name=platform,proto3" json:"platform,omitempty"` Statistics *inspec.Statistics `protobuf:"bytes,17,opt,name=statistics,proto3" json:"statistics,omitempty"` Profiles []*inspec.Profile `protobuf:"bytes,18,rep,name=profiles,proto3" json:"profiles,omitempty"` OtherChecks []string `protobuf:"bytes,19,rep,name=other_checks,json=otherChecks,proto3" json:"other_checks,omitempty"` // extra report fields added by the audit cookbook ReportUuid string `protobuf:"bytes,20,opt,name=report_uuid,json=reportUuid,proto3" json:"report_uuid,omitempty"` NodeUuid string `protobuf:"bytes,21,opt,name=node_uuid,json=nodeUuid,proto3" json:"node_uuid,omitempty"` JobUuid string `protobuf:"bytes,22,opt,name=job_uuid,json=jobUuid,proto3" json:"job_uuid,omitempty"` NodeName string `protobuf:"bytes,23,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` Environment string `protobuf:"bytes,24,opt,name=environment,proto3" json:"environment,omitempty"` Roles []string `protobuf:"bytes,25,rep,name=roles,proto3" json:"roles,omitempty"` Recipes []string `protobuf:"bytes,26,rep,name=recipes,proto3" json:"recipes,omitempty"` EndTime string `protobuf:"bytes,27,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` Type string `protobuf:"bytes,28,opt,name=type,proto3" json:"type,omitempty"` SourceId string `protobuf:"bytes,29,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` SourceRegion string `protobuf:"bytes,30,opt,name=source_region,json=sourceRegion,proto3" json:"source_region,omitempty"` SourceAccountId string `protobuf:"bytes,31,opt,name=source_account_id,json=sourceAccountId,proto3" json:"source_account_id,omitempty"` PolicyName string `protobuf:"bytes,32,opt,name=policy_name,json=policyName,proto3" json:"policy_name,omitempty"` PolicyGroup string `protobuf:"bytes,33,opt,name=policy_group,json=policyGroup,proto3" json:"policy_group,omitempty"` OrganizationName string `protobuf:"bytes,34,opt,name=organization_name,json=organizationName,proto3" json:"organization_name,omitempty"` SourceFqdn string `protobuf:"bytes,35,opt,name=source_fqdn,json=sourceFqdn,proto3" json:"source_fqdn,omitempty"` ChefTags []string `protobuf:"bytes,36,rep,name=chef_tags,json=chefTags,proto3" json:"chef_tags,omitempty"` Ipaddress string `protobuf:"bytes,37,opt,name=ipaddress,proto3" json:"ipaddress,omitempty"` Fqdn string `protobuf:"bytes,38,opt,name=fqdn,proto3" json:"fqdn,omitempty"` Tags []*common.Kv `protobuf:"bytes,39,rep,name=tags,proto3" json:"tags,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Report) Descriptor ¶
func (*Report) GetChefTags ¶
func (*Report) GetEndTime ¶
func (*Report) GetEnvironment ¶
func (*Report) GetIpaddress ¶
func (*Report) GetJobUuid ¶
func (*Report) GetNodeName ¶
func (*Report) GetNodeUuid ¶
func (*Report) GetOrganizationName ¶
func (*Report) GetOtherChecks ¶
func (*Report) GetPlatform ¶
func (*Report) GetPolicyGroup ¶
func (*Report) GetPolicyName ¶
func (*Report) GetProfiles ¶
func (*Report) GetRecipes ¶
func (*Report) GetReportUuid ¶
func (*Report) GetSourceAccountId ¶
func (*Report) GetSourceFqdn ¶
func (*Report) GetSourceId ¶
func (*Report) GetSourceRegion ¶
func (*Report) GetStatistics ¶
func (m *Report) GetStatistics() *inspec.Statistics
func (*Report) GetVersion ¶
func (*Report) ProtoMessage ¶
func (*Report) ProtoMessage()
func (*Report) XXX_DiscardUnknown ¶
func (m *Report) XXX_DiscardUnknown()