Documentation ¶
Index ¶
- Constants
- func AllLevels() sets.String
- func AllStages() sets.String
- func ConvertStagesToStrings(stages []audit.Stage) []string
- func ConvertStringSetToStages(set sets.String) []audit.Stage
- func EnforcePolicy(event *audit.Event, level audit.Level, omitStages []audit.Stage) (*audit.Event, error)
- func InvertStages(stages []audit.Stage) []audit.Stage
- func LoadPolicyFromBytes(policyDef []byte) (*auditinternal.Policy, error)
- func LoadPolicyFromFile(filePath string) (*auditinternal.Policy, error)
- func NewFakePolicyRuleEvaluator(level audit.Level, stage []audit.Stage) auditinternal.PolicyRuleEvaluator
- func NewPolicyRuleEvaluator(policy *audit.Policy) auditinternal.PolicyRuleEvaluator
Constants ¶
View Source
const ( // DefaultAuditLevel is the default level to audit at, if no policy rules are matched. DefaultAuditLevel = audit.LevelNone )
Variables ¶
This section is empty.
Functions ¶
func ConvertStagesToStrings ¶
ConvertStagesToStrings converts an array of stages to a string array
func ConvertStringSetToStages ¶
ConvertStringSetToStages converts a string set to an array of stages
func EnforcePolicy ¶
func EnforcePolicy(event *audit.Event, level audit.Level, omitStages []audit.Stage) (*audit.Event, error)
EnforcePolicy drops any part of the event that doesn't conform to a policy level or omitStages and sets the event level accordingly
func InvertStages ¶
InvertStages subtracts the given array of stages from all stages
func LoadPolicyFromBytes ¶
func LoadPolicyFromBytes(policyDef []byte) (*auditinternal.Policy, error)
func LoadPolicyFromFile ¶
func LoadPolicyFromFile(filePath string) (*auditinternal.Policy, error)
func NewFakePolicyRuleEvaluator ¶ added in v0.23.0
func NewFakePolicyRuleEvaluator(level audit.Level, stage []audit.Stage) auditinternal.PolicyRuleEvaluator
NewFakePolicyRuleEvaluator creates a fake policy rule evaluator that returns a constant level for all requests (for testing).
func NewPolicyRuleEvaluator ¶ added in v0.23.0
func NewPolicyRuleEvaluator(policy *audit.Policy) auditinternal.PolicyRuleEvaluator
NewPolicyRuleEvaluator creates a new policy rule evaluator.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.