compliance

package
v0.0.0-...-0490640 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DocVersion = "1"

Variables

This section is empty.

Functions

func AddControlSummary

AddControlSummary adds the control counts from 'sum' to 'total'

func CurrentTime

func CurrentTime() string

func FixInheritedProfiles

func FixInheritedProfiles(reportProfiles []*inspec.Profile) (fixedProfiles []*inspec.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.Profile) string

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) Descriptor() ([]byte, []int)

func (*Report) GetChefTags

func (m *Report) GetChefTags() []string

func (*Report) GetEndTime

func (m *Report) GetEndTime() string

func (*Report) GetEnvironment

func (m *Report) GetEnvironment() string

func (*Report) GetFqdn

func (m *Report) GetFqdn() string

func (*Report) GetIpaddress

func (m *Report) GetIpaddress() string

func (*Report) GetJobUuid

func (m *Report) GetJobUuid() string

func (*Report) GetNodeName

func (m *Report) GetNodeName() string

func (*Report) GetNodeUuid

func (m *Report) GetNodeUuid() string

func (*Report) GetOrganizationName

func (m *Report) GetOrganizationName() string

func (*Report) GetOtherChecks

func (m *Report) GetOtherChecks() []string

func (*Report) GetPlatform

func (m *Report) GetPlatform() *inspec.Platform

func (*Report) GetPolicyGroup

func (m *Report) GetPolicyGroup() string

func (*Report) GetPolicyName

func (m *Report) GetPolicyName() string

func (*Report) GetProfiles

func (m *Report) GetProfiles() []*inspec.Profile

func (*Report) GetRecipes

func (m *Report) GetRecipes() []string

func (*Report) GetReportUuid

func (m *Report) GetReportUuid() string

func (*Report) GetRoles

func (m *Report) GetRoles() []string

func (*Report) GetSourceAccountId

func (m *Report) GetSourceAccountId() string

func (*Report) GetSourceFqdn

func (m *Report) GetSourceFqdn() string

func (*Report) GetSourceId

func (m *Report) GetSourceId() string

func (*Report) GetSourceRegion

func (m *Report) GetSourceRegion() string

func (*Report) GetStatistics

func (m *Report) GetStatistics() *inspec.Statistics

func (*Report) GetTags

func (m *Report) GetTags() []*common.Kv

func (*Report) GetType

func (m *Report) GetType() string

func (*Report) GetVersion

func (m *Report) GetVersion() string

func (*Report) ProtoMessage

func (*Report) ProtoMessage()

func (*Report) Reset

func (m *Report) Reset()

func (*Report) String

func (m *Report) String() string

func (*Report) ToJSON

func (report *Report) ToJSON() (string, error)

func (*Report) XXX_DiscardUnknown

func (m *Report) XXX_DiscardUnknown()

func (*Report) XXX_Marshal

func (m *Report) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Report) XXX_Merge

func (dst *Report) XXX_Merge(src proto.Message)

func (*Report) XXX_Size

func (m *Report) XXX_Size() int

func (*Report) XXX_Unmarshal

func (m *Report) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL