enforcement

package
v0.0.0-...-b180f38 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditInfo

type AuditInfo struct {
	Actor     string
	Action    string
	Resource  string
	Context   map[string]interface{}
	Timestamp time.Time
}

type Condition

type Condition struct {
	Field    string
	Operator string
	Value    interface{}
}

type EnforcementResult

type EnforcementResult struct {
	PolicyID   string
	Allowed    bool
	Violations []Violation
	Warnings   []Warning
	Audit      AuditInfo
	Timestamp  time.Time
}

type Policy

type Policy struct {
	ID          string
	Name        string
	Description string
	Rules       []Rule
	Version     string
	Priority    int
	Status      PolicyStatus
	Metadata    map[string]interface{}
}

type PolicyEngine

type PolicyEngine struct {
	// contains filtered or unexported fields
}

func NewPolicyEngine

func NewPolicyEngine(
	metrics *metrics.QuantumStorageMetrics,
	tracer tracing.Tracer,
) *PolicyEngine

func (*PolicyEngine) AddPolicy

func (pe *PolicyEngine) AddPolicy(policy *Policy) error

func (*PolicyEngine) EnforcePolicy

func (pe *PolicyEngine) EnforcePolicy(
	ctx context.Context,
	policyID string,
	input interface{},
) (*EnforcementResult, error)

type PolicyStatus

type PolicyStatus string

type Rule

type Rule struct {
	ID          string
	Query       string
	Mode        RuleMode
	Action      RuleAction
	Conditions  []Condition
	Remediation string
}

type RuleAction

type RuleAction string

type RuleMode

type RuleMode string

type Violation

type Violation struct {
	RuleID      string
	Message     string
	Severity    string
	Evidence    map[string]interface{}
	Remediation string
}

type Warning

type Warning struct {
	Message    string
	Suggestion string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL