opa

package
v0.0.0-...-40eda91 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionItem

type ActionItem struct {
	ResourceNamespace string
	ResourceKind      string
	ResourceName      string
	Title             string
	Description       string
	Remediation       string
	EventType         string
	Severity          float64
	Category          string
}

ActionItem represents an action item from a report

func ProcessCheckForItem

func ProcessCheckForItem(ctx context.Context, check CustomCheck, instance CustomCheckInstance, obj map[string]interface{}, resourceName, resourceKind, resourceNamespace string) ([]ActionItem, error)

func Run

func Run(ctx context.Context) ([]ActionItem, error)

type CheckSetting

type CheckSetting struct {
	CheckName      string
	Targets        []string
	AdditionalData struct {
		Name       string
		Output     OutputFormat
		Parameters map[string]interface{}
	}
}

func (CheckSetting) GetUnstructuredObject

func (supposedInstance CheckSetting) GetUnstructuredObject(namespace string) *unstructured.Unstructured

type CustomCheck

type CustomCheck struct {
	metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
	Spec              CustomCheckSpec
}

CustomCheck is a custom OPA check.

type CustomCheckInstance

type CustomCheckInstance struct {
	metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
	Spec              CustomCheckInstanceSpec
}

CustomCheckInstance is an instance of a custom check

type CustomCheckInstanceSpec

type CustomCheckInstanceSpec struct {
	Parameters      map[string]interface{}
	Targets         []KubeTarget
	Output          OutputFormat
	CustomCheckName string
}

CustomCheckInstanceSpec is the body of an instance of a custom check

type CustomCheckSpec

type CustomCheckSpec struct {
	AdditionalKubernetesData []KubeTarget
	Output                   OutputFormat
	Rego                     string
}

CustomCheckSpec is the body of a Custom Check object

type KubeTarget

type KubeTarget struct {
	APIGroups []string `json:"apiGroups"`
	Kinds     []string
}

KubeTarget is a mapping of kinds and API groups

type OPACustomCheck

type OPACustomCheck struct {
	Name                     string
	Rego                     string
	Title                    *string
	Severity                 *float64
	Remediation              *string
	Category                 *string
	AdditionalKubernetesData []string
}

func (OPACustomCheck) GetUnstructuredObject

func (supposedCheck OPACustomCheck) GetUnstructuredObject(namespace string) *unstructured.Unstructured

type OutputFormat

type OutputFormat struct {
	Title       *string
	Severity    *float64
	Remediation *string
	Category    *string
	Description *string
}

func (*OutputFormat) SetDefaults

func (o *OutputFormat) SetDefaults(others ...OutputFormat)

Jump to

Keyboard shortcuts

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