Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Access ¶
type Access struct { Repository string `json:"repo"` User string `json:"user"` AccessType AccessType `json:"accessType"` RowsAffected int64 `json:"rowsAffected"` TablesReferenced []string `json:"tablesReferenced,omitempty"` TablesUpdated []string `json:"tablesUpdated,omitempty"` TablesDeleted []string `json:"tablesDeleted,omitempty"` ColumnsReferenced map[string][]string `json:"columnsReferenced,omitempty"` ColumnsUpdated map[string][]string `json:"columnsUpdated,omitempty"` }
func NewAccess ¶
func NewAccess(repository, user string, rowsAffected int64, accessType AccessType, opts ...AccessOption) Access
type AccessOption ¶
type AccessOption func(*Access)
func ColumnsReferenced ¶
func ColumnsReferenced(c map[string][]string) AccessOption
func ColumnsUpdated ¶
func ColumnsUpdated(c map[string][]string) AccessOption
func TablesDeleted ¶
func TablesDeleted(t []string) AccessOption
func TablesReferenced ¶
func TablesReferenced(t []string) AccessOption
func TablesUpdated ¶
func TablesUpdated(t []string) AccessOption
type AccessPolicy ¶
type AccessPolicy struct { SensitiveAttributes []string `json:"sensitiveAttrs" yaml:"sensitiveAttrs"` Locations []DataLocation `json:"locations" yaml:"locations"` Rules []Rule `json:"rules" yaml:"rules"` DefaultRule Rule `json:"defaultRule" yaml:"defaultRule"` }
func AccessPolicyFromYAML ¶
func AccessPolicyFromYAML(policyYAML []byte) (AccessPolicy, error)
type AccessType ¶
type AccessType int
const ( AccessTypeRead AccessType = iota AccessTypeUpdate AccessTypeDelete )
func (AccessType) String ¶
func (a AccessType) String() string
type ContextedRule ¶
type DataLocation ¶
type EvaluatedRule ¶
type EvaluatedRule struct { Violated bool `json:"violated"` ContextedRule ContextedRule `json:"contextedRule"` }
EvaluatedRule contains a contexted rule applied to a table and whether or not it was violated.
type Rule ¶
type Rule struct { Identities []string `json:"identities" yaml:"identities"` Reads ContextedRule `json:"reads" yaml:"reads"` Updates ContextedRule `json:"updates" yaml:"updates"` Deletes ContextedRule `json:"deletes" yaml:"deletes"` }
type TableRule ¶
type TableRule struct { PolicyDefined bool `json:"policyDefined"` RulesApplied map[string]*EvaluatedRule `json:"rulesApplied"` }
TableRule details the contexted rules applied for a table during validation of an access.
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
func NewValidator ¶
func NewValidatorFromRego ¶
NewValidatorFromRego returns a Validator initalized with the rego policy at the given file path as well as stored policy data. TODO: This should return an interface rather than a pointer to a struct.
Have it return QueryLogEvaluator for the moment...
Click to show internal directories.
Click to hide internal directories.