Documentation ¶
Overview ¶
Package policy implements cluster policy rules and policy evaluation features
Index ¶
- type CloneFn
- type GKEPolicyAgent
- func (pa *GKEPolicyAgent) Compile(files []*PolicyFile) error
- func (pa *GKEPolicyAgent) Evaluate(input interface{}, packageBase string) (*PolicyEvaluationResult, error)
- func (pa *GKEPolicyAgent) GetPolicies() []*Policy
- func (pa *GKEPolicyAgent) ParseCompiled() []error
- func (pa *GKEPolicyAgent) WithFiles(files []*PolicyFile, excludes cfg.ConfigPolicyExclusions) error
- type GitClient
- type GitPolicyFile
- type GitPolicySource
- type GitTree
- type GitTreeWalker
- type LocalPolicySource
- type Policy
- type PolicyAgent
- type PolicyEvaluationResult
- type PolicyFile
- type PolicySource
- type ReadFn
- type RegoEvaluationResult
- type WalkFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GKEPolicyAgent ¶ added in v1.2.0
type GKEPolicyAgent struct {
// contains filtered or unexported fields
}
func (*GKEPolicyAgent) Compile ¶ added in v1.2.0
func (pa *GKEPolicyAgent) Compile(files []*PolicyFile) error
func (*GKEPolicyAgent) Evaluate ¶ added in v1.2.0
func (pa *GKEPolicyAgent) Evaluate(input interface{}, packageBase string) (*PolicyEvaluationResult, error)
func (*GKEPolicyAgent) GetPolicies ¶ added in v1.2.0
func (pa *GKEPolicyAgent) GetPolicies() []*Policy
func (*GKEPolicyAgent) ParseCompiled ¶ added in v1.2.0
func (pa *GKEPolicyAgent) ParseCompiled() []error
func (*GKEPolicyAgent) WithFiles ¶ added in v1.2.0
func (pa *GKEPolicyAgent) WithFiles(files []*PolicyFile, excludes cfg.ConfigPolicyExclusions) error
type GitPolicyFile ¶
type GitPolicyFile struct { Hash string *PolicyFile }
type GitPolicySource ¶
type GitPolicySource struct {
// contains filtered or unexported fields
}
func (GitPolicySource) GetPolicyFiles ¶
func (src GitPolicySource) GetPolicyFiles() ([]*PolicyFile, error)
func (GitPolicySource) String ¶
func (src GitPolicySource) String() string
type GitTreeWalker ¶
type LocalPolicySource ¶
type LocalPolicySource struct {
// contains filtered or unexported fields
}
func (LocalPolicySource) GetPolicyFiles ¶
func (src LocalPolicySource) GetPolicyFiles() ([]*PolicyFile, error)
func (LocalPolicySource) String ¶
func (src LocalPolicySource) String() string
type Policy ¶
type Policy struct { Name string File string Title string Description string Group string Severity string Category string Valid bool Violations []string ProcessingErrors []error CisVersion string CisID string ExternalURI string Recommendation string }
func NewPolicyFromEvalResult ¶
func NewPolicyFromEvalResult(result *RegoEvaluationResult, errors []error) *Policy
func (Policy) MetadataErrors ¶
type PolicyAgent ¶
type PolicyAgent interface { Compile(files []*PolicyFile) error WithFiles(files []*PolicyFile, excludes cfg.ConfigPolicyExclusions) error Evaluate(input interface{}, packageBase string) (*PolicyEvaluationResult, error) GetPolicies() []*Policy }
func NewPolicyAgent ¶
func NewPolicyAgent(ctx context.Context) PolicyAgent
type PolicyEvaluationResult ¶
type PolicyFile ¶
type PolicySource ¶
type PolicySource interface { GetPolicyFiles() ([]*PolicyFile, error) String() string }
func NewGitPolicySource ¶
func NewGitPolicySource(repoURL string, repoBrach string, policyDir string) PolicySource
func NewLocalPolicySource ¶
func NewLocalPolicySource(rootDirectory string) PolicySource
type RegoEvaluationResult ¶
Click to show internal directories.
Click to hide internal directories.