policy

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WARNING         = "warning"
	ERROR           = "error"
	TARGET_RESOURCE = "resource"
)

Variables

View Source
var PolicyFileSchema = &hcl.BodySchema{
	Blocks: []hcl.BlockHeaderSchema{
		{
			Type:       "policy",
			LabelNames: []string{"name"},
		},
	},
}

Functions

This section is empty.

Types

type Output

type Output struct {
	Name             string                  `json:"name"`
	Validated        bool                    `json:"is_valid"`
	Severity         string                  `json:"severity,omitempty"`
	InvalidResources []ports.InvalidResource `json:"invalid_resources,omitempty"`
}

type Policy

type Policy struct {
	Name         string
	Target       string // unused for now, will come in a future release
	Severity     string
	ErrorMessage string
	Disabled     bool
	Filter       filter.Filter
	Condition    condition.Condition
}

func (*Policy) Apply

func (p *Policy) Apply(resources *[]*ports.Resource, configuration *ports.Configuration) Output

func (*Policy) Init

func (p *Policy) Init(policyBlock *hcl.Block)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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