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 ¶
type ControlsSource interface {
Controls() ([]*orchestrator.Control, error)
}
ControlsSource is used to retrieve a list of controls
type MetricsSource ¶
type MetricsSource interface { Metrics() ([]*assessment.Metric, error) MetricConfiguration(targetID string, metric *assessment.Metric) (*assessment.MetricConfiguration, error) MetricImplementation(lang assessment.MetricImplementation_Language, metric *assessment.Metric) (*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 certification target)
type PolicyEval ¶
type PolicyEval interface { // Eval evaluates a given evidence against a metric coming from the metrics source. In order to avoid unnecessarily // unwrapping, the callee of this function needs to supply the unwrapped ontology resource, since they most likely // unwrapped the resource already, e.g. to check for validation. Eval(evidence *evidence.Evidence, r ontology.IsResource, related map[string]ontology.IsResource, src MetricsSource) (data []*Result, err error) HandleMetricEvent(event *orchestrator.MetricChangeEvent) (err error) }
PolicyEval is an interface for the policy evaluation engine
func NewRegoEval ¶
func NewRegoEval(opts ...RegoEvalOption) PolicyEval
type RegoEvalOption ¶
type RegoEvalOption func(re *regoEval)
func WithPackageName ¶
func WithPackageName(pkg string) RegoEvalOption
WithPackageName is an option to configure the package name
type Result ¶
type Result struct { Applicable bool Compliant bool TargetValue interface{} Operator string MetricID string Config *assessment.MetricConfiguration }
Click to show internal directories.
Click to hide internal directories.