policy

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Policy

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

Policy struct to stores rego function as we add more queries additional (custom) rules other regoArgs may be required in the future

func New

func New(fs files.FS, data []byte) (*Policy, error)

Create a new Rego policy fs is the embbedded bundle FS and data is the configuration data to be evaluated

func (*Policy) AddQuery

func (p *Policy) AddQuery(query string)

AddQuery is the query that will be executed in the main.rego

func (*Policy) Eval

func (p *Policy) Eval(ctx context.Context, input map[string]interface{}) (bool, error)

Eval evaluates the policy with the given input byte array the input is the value that has been generated by eBPF sensors func (p *Policy) Eval(ctx context.Context, input []byte) (bool, error) {

func (*Policy) EvalEvent

func (p *Policy) EvalEvent(ctx context.Context, event domain.ReportEvent) (bool, error)

Jump to

Keyboard shortcuts

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