armotypes

package
v1.0.113 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CostumerGuidQuery   = "costumerGUID"
	ClusterNameQuery    = "cluster"
	DatacenterNameQuery = "datacenter"
	NamespaceQuery      = "namespace"
	ProjectQuery        = "project"
	WlidQuery           = "wlid"
	SidQuery            = "sid"
)
View Source
const (
	AttributeCluster   = "cluster"
	AttributeNamespace = "namespace"
	AttributeKind      = "kind"
	AttributeName      = "name"
)

attributes

Variables

Functions

func DigestAttributesDesignator

func DigestAttributesDesignator(attributes map[string]string) (string, string, map[string]string)

func DigestPortalDesignator

func DigestPortalDesignator(designator *PortalDesignator) (string, string, map[string]string)

DigestPortalDesignator DEPRECATED. use designator.DigestPortalDesignator() - get cluster namespace and labels from designator

Types

type DesignatorType

type DesignatorType string
const (
	DesignatorAttributes DesignatorType = "Attributes"
	DesignatorAttribute  DesignatorType = "Attribute" // Deprecated
	/*
		WorkloadID format.
		k8s format: wlid://cluster-<cluster>/namespace-<namespace>/<kind>-<name>
		native format: wlid://datacenter-<datacenter>/project-<project>/native-<name>
	*/
	DesignatorWlid DesignatorType = "Wlid"
	/*
		Wild card - subset of wlid. e.g.
		1. Include cluster:
			wlid://cluster-<cluster>/
		2. Include cluster and namespace (filter out all other namespaces):
			wlid://cluster-<cluster>/namespace-<namespace>/
	*/
	DesignatorWildWlid      DesignatorType = "WildWlid"
	DesignatorWlidContainer DesignatorType = "WlidContainer"
	DesignatorWlidProcess   DesignatorType = "WlidProcess"
	DesignatorSid           DesignatorType = "Sid" // secret id
)

Supported designators

func (DesignatorType) ToLower added in v1.0.47

func (dt DesignatorType) ToLower() DesignatorType

type EnforcementsRule added in v1.0.36

type EnforcementsRule struct {
	MonitoredObject          []string `json:"monitoredObject"`
	MonitoredObjectExistence []string `json:"objectExistence"`
	MonitoredObjectEvent     []string `json:"event"`
	Action                   []string `json:"action"`
}

type ExecutionPolicy

type ExecutionPolicy struct {
	PortalBase                `json:",inline"`
	Designators               []PortalDesignator `json:"designators"`
	PolicyType                string             `json:"policyType"`
	CreationTime              string             `json:"creation_time"`
	ExecutionEnforcementsRule []EnforcementsRule `json:"enforcementRules"`
}

type PortalBase

type PortalBase struct {
	GUID       string                 `json:"guid"`
	Name       string                 `json:"name"`
	Attributes map[string]interface{} `json:"attributes,omitempty"` // could be string
}

PortalBase holds basic items data from portal BE

func MockPortalBase

func MockPortalBase(customerGUID, name string, attributes map[string]interface{}) *PortalBase

type PortalDesignator

type PortalDesignator struct {
	DesignatorType DesignatorType    `json:"designatorType"`
	WLID           string            `json:"wlid"`
	WildWLID       string            `json:"wildwlid"`
	SID            string            `json:"sid"`
	Attributes     map[string]string `json:"attributes"`
}

PortalDesignator represented single designation options

func (*PortalDesignator) DigestAttributesDesignator added in v1.0.36

func (designator *PortalDesignator) DigestAttributesDesignator() (string, string, string, string, map[string]string)

func (*PortalDesignator) DigestPortalDesignator added in v1.0.36

func (designator *PortalDesignator) DigestPortalDesignator() (string, string, string, string, map[string]string)

DigestPortalDesignator - get cluster namespace and labels from designator

func (*PortalDesignator) GetCluster added in v1.0.36

func (designator *PortalDesignator) GetCluster() string

func (*PortalDesignator) GetKind added in v1.0.36

func (designator *PortalDesignator) GetKind() string

func (*PortalDesignator) GetLabels added in v1.0.36

func (designator *PortalDesignator) GetLabels() map[string]string

func (*PortalDesignator) GetName added in v1.0.36

func (designator *PortalDesignator) GetName() string

func (*PortalDesignator) GetNamespace added in v1.0.36

func (designator *PortalDesignator) GetNamespace() string

type PostureExceptionPolicy added in v1.0.36

type PostureExceptionPolicy struct {
	PortalBase      `json:",inline"`
	PolicyType      string                          `json:"policyType"`
	CreationTime    string                          `json:"creationTime"`
	Actions         []PostureExceptionPolicyActions `json:"actions"`
	Resources       []PortalDesignator              `json:"resources"`
	PosturePolicies []PosturePolicy                 `json:"posturePolicies"`
}

func (*PostureExceptionPolicy) IsAlertOnly added in v1.0.36

func (exceptionPolicy *PostureExceptionPolicy) IsAlertOnly() bool

func (*PostureExceptionPolicy) IsDisable added in v1.0.36

func (exceptionPolicy *PostureExceptionPolicy) IsDisable() bool

type PostureExceptionPolicyActions added in v1.0.36

type PostureExceptionPolicyActions string
const AlertOnly PostureExceptionPolicyActions = "alertOnly"
const Disable PostureExceptionPolicyActions = "disable"

type PosturePolicy added in v1.0.36

type PosturePolicy struct {
	FrameworkName string `json:"frameworkName"`
	ControlName   string `json:"controlName"`
	RuleName      string `json:"ruleName"`
}

Jump to

Keyboard shortcuts

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