Documentation ¶
Index ¶
- Constants
- func ApplyPolicyiesFromOCI(ociURL, creds, path string) (string, error)
- 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 ValidateWithOCIPolicies(resource, policy, ociURL, creds string, processor InputProcessor) error
- func ValidateWithRego(inputContent, regoPolicyPath string, processor InputProcessor) error
- type CELPolicy
- type CELPolicyFile
- type DockerfileProcessor
- type GenericProcessor
- type InputProcessor
- type Metadata
- type PolicyFile
- type Results
Constants ¶
View Source
const (
HubRegoPolicy = "ghcr.io/santoshkal/genval-security-policies/rego-policies:v0.0.1"
)
Variables ¶
This section is empty.
Functions ¶
func ApplyPolicyiesFromOCI ¶ added in v0.1.6
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 ValidateWithOCIPolicies ¶ added in v0.1.6
func ValidateWithOCIPolicies(resource, policy, ociURL, creds string, processor InputProcessor) error
func ValidateWithRego ¶
func ValidateWithRego(inputContent, regoPolicyPath string, processor InputProcessor) error
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 DockerfileProcessor ¶ added in v0.1.6
type DockerfileProcessor struct{}
DOckefileProcessor processes Dockerrile input
func (DockerfileProcessor) ProcessInput ¶ added in v0.1.6
func (d DockerfileProcessor) ProcessInput(content string) ([]byte, error)
d.ProcessInput processes Dockerfile content and returns a []byte or any error
type GenericProcessor ¶ added in v0.1.6
type GenericProcessor struct{}
GenericProcessor processes generic inputs like (YAML, JSON, etc)
func (GenericProcessor) ProcessInput ¶ added in v0.1.6
func (g GenericProcessor) ProcessInput(content string) ([]byte, error)
g.ProcessInput processes generic input contents and returns a []byte or any error
type InputProcessor ¶ added in v0.1.6
type PolicyFile ¶ added in v0.1.3
type PolicyFile struct {
Policies []CELPolicy `yaml:"policies"`
}
Click to show internal directories.
Click to hide internal directories.