policies

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const DefaultRegoPackage = "clouditor.metrics"

DefaultRegoPackage is the default package name for the Rego files

Variables

This section is empty.

Functions

This section is empty.

Types

type ControlsSource added in v1.6.0

type ControlsSource interface {
	Controls() ([]*orchestrator.Control, error)
}

ControlsSource is used to retrieve a list of controls

type MetricsSource added in v1.4.5

type MetricsSource interface {
	Metrics() ([]*assessment.Metric, error)
	MetricConfiguration(serviceID, metricID string) (*assessment.MetricConfiguration, error)
	MetricImplementation(lang assessment.MetricImplementation_Language, metric string) (*assessment.MetricImplementation, error)
}

MetricsSource is used to retrieve a list of metrics and to retrieve a metric configuration as well as implementation for a particular metric (and target service)

type PolicyEval added in v1.4.5

type PolicyEval interface {
	Eval(evidence *evidence.Evidence, src MetricsSource) (data []*Result, err error)
	HandleMetricEvent(event *orchestrator.MetricChangeEvent) (err error)
}

PolicyEval is an interface for the policy evaluation engine

func NewRegoEval added in v1.4.5

func NewRegoEval(opts ...RegoEvalOption) PolicyEval

type RegoEvalOption added in v1.4.11

type RegoEvalOption func(re *regoEval)

func WithPackageName added in v1.4.11

func WithPackageName(pkg string) RegoEvalOption

WithPackageName is an option to configure the package name

type Result added in v1.4.0

type Result struct {
	Applicable  bool
	Compliant   bool
	TargetValue interface{}
	Operator    string
	MetricID    string
	Config      *assessment.MetricConfiguration
}

Jump to

Keyboard shortcuts

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