policy

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Terraform      = Target("terraform")
	TerraformPlan  = Target("terraform-plan")
	Cloudformation = Target("cloudformation")
	Kubernetes     = Target("kubernetes")
	Helm           = Target("helm")
	Docker         = Target("docker")
	Secrets        = Target("secrets")
	ARM            = Target("arm")
	None           = Target("")
	Policies       = "policies"
)

Variables

View Source
var InputTypeForTarget = map[Target]string{
	Terraform:      "tf",
	Cloudformation: "cfn",
	Kubernetes:     "k8s",
	ARM:            "arm",
}

Functions

func RegisterPolicyType added in v0.5.35

func RegisterPolicyType(policyType PolicyType)

Types

type Metadata added in v0.5.29

type Metadata map[string]interface{}

func (Metadata) GetString added in v0.5.29

func (m Metadata) GetString(key string) string

type Policy added in v0.5.35

type Policy struct {
	ID         string
	Path       string
	Metadata   Metadata
	Targets    []Target
	TargetData map[Target]interface{}
}

type PolicyType added in v0.5.35

type PolicyType interface {
	GetName() string
	GetCode() string
	PreparePolicies(policies []*Policy, dest string) error
}

func GetPolicyType added in v0.5.35

func GetPolicyType(policyTypeName string) PolicyType

func GetPolicyTypes added in v0.5.35

func GetPolicyTypes() (res []PolicyType)

type Store added in v0.5.27

type Store struct {
	Dir                    string
	Policies               map[PolicyType][]*Policy
	PolicyIds              map[string]string
	SkipPolicyIDResolution bool
}

func NewDownloadStore added in v0.5.39

func NewDownloadStore(dir string) *Store

func NewStore added in v0.5.44

func NewStore(dir string, skipPolicyIDResolution bool) *Store

func (*Store) CreateZipArchive added in v0.5.43

func (m *Store) CreateZipArchive(path string) error

func (*Store) GetPolicyUploadMetadata added in v0.5.27

func (m *Store) GetPolicyUploadMetadata(filename string) (map[string]string, error)

func (*Store) LoadPolicies added in v0.5.35

func (m *Store) LoadPolicies() error

func (*Store) LoadPoliciesOfType added in v0.5.35

func (m *Store) LoadPoliciesOfType(policyType PolicyType) error

func (*Store) LoadSinglePolicy added in v0.5.35

func (m *Store) LoadSinglePolicy(policyType PolicyType, path string) (*Policy, error)

func (*Store) PolicyCount added in v0.5.35

func (m *Store) PolicyCount() (count int)

func (*Store) PreparePolicies added in v0.5.35

func (m *Store) PreparePolicies(dest string) error

type Target

type Target string

func (Target) Path added in v0.5.29

func (t Target) Path(policy *Policy) string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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