Documentation ¶
Index ¶
- Constants
- func GenerateUniqueIDFromDNS(name string) string
- func GetContentFileName(productName string) string
- func GetDescriptionFromXMLString(raw string) (string, error)
- func GetManualRules(tp *cmpv1alpha1.TailoredProfile) []string
- func GetProfileNameFromID(id string) string
- func GetProfileUniqueID(platform string, profileID string) string
- func GetProfileUniqueIDFromBundleName(pbName, profileName string) string
- func GetProfileUniqueIDFromTP(tpID string) string
- func GetRationaleFromXMLString(raw string) (string, error)
- func GetRuleNameFromID(id string) string
- func GetVariableNameFromID(id string) string
- func GetWarningFromXMLString(raw string) (string, error)
- func GetXCCDFProfileID(tp *cmpv1alpha1.TailoredProfile) string
- func IsManualRule(ruleName string, manualRules []string) bool
- func TailoredProfileToXML(tp *cmpv1alpha1.TailoredProfile, p *cmpv1alpha1.Profile, ...) (string, error)
- type BenchmarkElement
- type ProfileElement
- type SelectElement
- type SetValueElement
- type TailoringElement
- type TitleOrDescriptionElement
- type VersionElement
Constants ¶
const ( // XMLHeader is the header for the XML doc XMLHeader string = `<?xml version="1.0" encoding="UTF-8"?>` // XCCDFNamespace is the XCCDF namespace of this project. Per the XCCDF // specification, this assiciates the content with the author XCCDFNamespace string = "compliance.openshift.io" XCCDFURI string = "http://checklists.nist.gov/xccdf/1.2" ContentFileNamePrefix string = "ssg-" ContentFileNameSuffix string = "-ds.xml" )
Variables ¶
This section is empty.
Functions ¶
func GenerateUniqueIDFromDNS ¶ added in v1.5.0
GenerateUniqueIDFromDNS generates a unique identifier from a name using the DNS namespace
func GetContentFileName ¶ added in v1.5.0
GetContentFileName gets the file name for a profile bundle
func GetDescriptionFromXMLString ¶
GetDescriptionFromXMLString gets a description from the given XML string
func GetManualRules ¶
func GetManualRules(tp *cmpv1alpha1.TailoredProfile) []string
func GetProfileNameFromID ¶
GetProfileNameFromID gets a profile name from the xccdf ID
func GetProfileUniqueID ¶ added in v1.5.0
GetProfileUniqueID gets the unique identifier of the Profile from the platform name and the profile ID
func GetProfileUniqueIDFromBundleName ¶ added in v1.5.0
GetProfileUniqueIDFromBundleName returns the unique identifier of the Profile
func GetProfileUniqueIDFromTP ¶ added in v1.5.0
GetProfileUniqueIDFromTP gets the unique identifier for a TailoredProfileID
func GetRationaleFromXMLString ¶
GetRationaleFromXMLString gets the rationale from the given XML string
func GetRuleNameFromID ¶
GetRuleNameFromID gets a rule name from the xccdf ID
func GetVariableNameFromID ¶
func GetWarningFromXMLString ¶
GetWarningFromXMLString gets a warning from the given XML string
func GetXCCDFProfileID ¶
func GetXCCDFProfileID(tp *cmpv1alpha1.TailoredProfile) string
GetXCCDFProfileID gets a profile xccdf ID from the TailoredProfile object
func IsManualRule ¶
func TailoredProfileToXML ¶
func TailoredProfileToXML(tp *cmpv1alpha1.TailoredProfile, p *cmpv1alpha1.Profile, pb *cmpv1alpha1.ProfileBundle, rules map[string]*cmpv1alpha1.Rule, variables []*cmpv1alpha1.Variable) (string, error)
TailoredProfileToXML gets an XML string from a TailoredProfile and the corresponding Profile
Types ¶
type BenchmarkElement ¶
type ProfileElement ¶
type ProfileElement struct { XMLName xml.Name `xml:"xccdf-1.2:Profile"` ID string `xml:"id,attr"` Extends string `xml:"extends,attr,omitempty"` Title *TitleOrDescriptionElement `xml:"xccdf-1.2:title"` Description *TitleOrDescriptionElement `xml:"xccdf-1.2:description"` Selections []SelectElement Values []SetValueElement }
type SelectElement ¶
type SetValueElement ¶
type TailoringElement ¶
type TailoringElement struct { XMLName xml.Name `xml:"xccdf-1.2:Tailoring"` XMLNamespaceURI string `xml:"xmlns:xccdf-1.2,attr"` ID string `xml:"id,attr"` Benchmark BenchmarkElement Version VersionElement Profile ProfileElement }