Documentation
¶
Index ¶
- func EvaluateCELPolicies(policies []CELPolicy, inputFile string, t table.Writer) error
- func FetchRegoMetadata(policyDir, metaExt, regoExt string) ([]string, []string, error)
- func LoadRegoMetadata(filePaths []string) ([]*regoMetadata, error)
- func MatchPolicyMetadata(metas []*regoMetadata, key string) (string, *regoMetadata, error)
- func PrintResults(result rego.ResultSet, metas []*regoMetadata) error
- func SaveResults(filename string, newResults []Results) error
- func ValidateDockerfile(dockerfileContent string, regoPolicyPath string) error
- func ValidateInput(yamlContent string, regoPolicyPath string) error
- func ValidateWithRego(inputContent string, regoPolicyPath string) error
- type CELPolicy
- type CELPolicyFile
- type Metadata
- type PolicyFile
- type Results
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EvaluateCELPolicies ¶
func FetchRegoMetadata ¶ added in v0.1.3
func LoadRegoMetadata ¶ added in v0.1.3
LoadRegoMetadata loads the contents of the metadata files into a slice of pointers to RegoMeta structs
func MatchPolicyMetadata ¶ added in v0.1.3
MatchPolicyMetadata matches the RegoMeta policy names with the Rego evaluation results and returns the matched key
func PrintResults ¶ added in v0.1.2
PrintResults prints the evaluation results along with the metadata
func SaveResults ¶ added in v0.1.3
SaveResults saves the results to a file as a JSON array
func ValidateDockerfile ¶
ValidateDockerfileUsingRego validates a Dockerfile using Rego.
func ValidateInput ¶
func ValidateWithRego ¶
Types ¶
type CELPolicy ¶ added in v0.1.3
type CELPolicy struct {
APIVersion string `yaml:"apiVersion"`
Kind string `yaml:"kind"`
Metadata Metadata `yaml:"metadata"`
Rule string `yaml:"rule"`
}
func ParseYAMLPolicies ¶ added in v0.1.3
type CELPolicyFile ¶ added in v0.1.3
type CELPolicyFile struct {
Policies []CELPolicy `yaml:"policies"`
}
type PolicyFile ¶ added in v0.1.3
type PolicyFile struct {
Policies []CELPolicy `yaml:"policies"`
}
Click to show internal directories.
Click to hide internal directories.