securitypolicy

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 23 Imported by: 3

Documentation

Index

Constants

View Source
const (
	MaxCriteriaExpressions      int = 5
	MaxMixedCriteriaExpressions int = 15
	MaxCriteria                 int = 5
	MaxTotalCriteriaExpressions int = 35
	MaxMatchExpressionInOp      int = 1
	MaxMatchExpressionIn        int = 1
	MaxMatchExpressionInValues  int = 5
	ClusterTagCount             int = 1
	NameSpaceTagCount           int = 1
)

Variables

View Source
var (
	String = common.String
	Int64  = common.Int64
)
View Source
var (
	MarkedForDelete            = true
	EnforceRevisionCheckParam  = false
	ResourceTypeSecurityPolicy = common.ResourceTypeSecurityPolicy
	ResourceTypeRule           = common.ResourceTypeRule
	ResourceTypeGroup          = common.ResourceTypeGroup
	ResourceTypeShare          = common.ResourceTypeShare
	NewConverter               = common.NewConverter
)

Functions

func ComparableToGroup

func ComparableToGroup(group Comparable) *model.Group

func ComparableToGroups

func ComparableToGroups(groups []Comparable) []model.Group

func ComparableToRule

func ComparableToRule(rule Comparable) *model.Rule

func ComparableToRules

func ComparableToRules(rules []Comparable) []model.Rule

func ComparableToSecurityPolicy

func ComparableToSecurityPolicy(sp Comparable) *model.SecurityPolicy

func ComparableToShare

func ComparableToShare(share Comparable) *model.Share

func ComparableToShares

func ComparableToShares(shares []Comparable) []model.Share

Types

type Comparable

type Comparable = common.Comparable

func GroupsToComparable

func GroupsToComparable(groups []model.Group) []Comparable

func RulesToComparable

func RulesToComparable(rules []model.Rule) []Comparable

func SecurityPolicyToComparable

func SecurityPolicyToComparable(sp *model.SecurityPolicy) Comparable

func ShareToComparable

func ShareToComparable(share *model.Share) Comparable

func SharesToComparable

func SharesToComparable(shares []model.Share) []Comparable

type Group

type Group model.Group

func (*Group) Key

func (group *Group) Key() string

func (*Group) Value

func (group *Group) Value() data.DataValue

type GroupStore

type GroupStore struct {
	common.ResourceStore
}

GroupStore is a store for groups referenced by security policy or rule

func (*GroupStore) Apply added in v0.0.1

func (groupStore *GroupStore) Apply(i interface{}) error

func (*GroupStore) GetByIndex

func (groupStore *GroupStore) GetByIndex(key string, value string) []model.Group

type ProjectShare

type ProjectShare struct {
	// contains filtered or unexported fields
}

type Rule

type Rule model.Rule

func (*Rule) Key

func (rule *Rule) Key() string

func (*Rule) Value

func (rule *Rule) Value() data.DataValue

type RuleStore

type RuleStore struct {
	common.ResourceStore
}

RuleStore is a store for rules of security policy

func (*RuleStore) Apply added in v0.0.1

func (ruleStore *RuleStore) Apply(i interface{}) error

func (*RuleStore) GetByIndex

func (ruleStore *RuleStore) GetByIndex(key string, value string) []model.Rule

type SecurityPolicy

type SecurityPolicy model.SecurityPolicy

func (*SecurityPolicy) Key

func (sp *SecurityPolicy) Key() string

func (*SecurityPolicy) Value

func (sp *SecurityPolicy) Value() data.DataValue

type SecurityPolicyService

type SecurityPolicyService struct {
	common.Service
	// contains filtered or unexported fields
}

func InitializeSecurityPolicy

func InitializeSecurityPolicy(service common.Service) (*SecurityPolicyService, error)

InitializeSecurityPolicy sync NSX resources

func (*SecurityPolicyService) BuildPeerTags

func (service *SecurityPolicyService) BuildPeerTags(obj *v1alpha1.SecurityPolicy, peers *[]v1alpha1.SecurityPolicyPeer, idx int, isSource, groupShared bool) []model.Tag

func (*SecurityPolicyService) Cleanup

func (service *SecurityPolicyService) Cleanup() error

func (*SecurityPolicyService) CreateOrUpdateSecurityPolicy

func (service *SecurityPolicyService) CreateOrUpdateSecurityPolicy(obj *v1alpha1.SecurityPolicy) error

func (*SecurityPolicyService) DeleteSecurityPolicy

func (service *SecurityPolicyService) DeleteSecurityPolicy(obj interface{}, isVpcCleanup bool) error

func (*SecurityPolicyService) ListSecurityPolicyID

func (service *SecurityPolicyService) ListSecurityPolicyID() sets.String

func (*SecurityPolicyService) ResolveNamespace

func (service *SecurityPolicyService) ResolveNamespace(lbs *meta1.LabelSelector) (*v1.NamespaceList, error)

ResolveNamespace Get namespace name when the rule has namespace selector.

func (*SecurityPolicyService) WrapHierarchyProjectGroups

func (service *SecurityPolicyService) WrapHierarchyProjectGroups(groups []model.Group) (*model.Infra, error)

func (*SecurityPolicyService) WrapHierarchyProjectShares

func (service *SecurityPolicyService) WrapHierarchyProjectShares(shares []model.Share) (*model.Infra, error)

func (*SecurityPolicyService) WrapHierarchySecurityPolicy

func (service *SecurityPolicyService) WrapHierarchySecurityPolicy(sp *model.SecurityPolicy, gs []model.Group) (*model.Infra, error)

WrapHierarchySecurityPolicy wrap the security policy with groups and rules into a hierarchy security policy for InfraClient to patch.

func (*SecurityPolicyService) WrapHierarchyVpcSecurityPolicy

func (service *SecurityPolicyService) WrapHierarchyVpcSecurityPolicy(sp *model.SecurityPolicy, gs []model.Group,
	vpcInfo *common.VPCResourceInfo,
) (*model.OrgRoot, error)

WrapHierarchyVpcSecurityPolicy wrap the security policy with groups and rules into a hierarchy SecurityPolicy for OrgRootClient to patch.

type SecurityPolicyStore

type SecurityPolicyStore struct {
	common.ResourceStore
}

SecurityPolicyStore is a store for security policy

func (*SecurityPolicyStore) Apply added in v0.0.1

func (securityPolicyStore *SecurityPolicyStore) Apply(i interface{}) error

func (*SecurityPolicyStore) GetByIndex

func (securityPolicyStore *SecurityPolicyStore) GetByIndex(key string, value string) []model.SecurityPolicy

func (*SecurityPolicyStore) GetByKey

func (securityPolicyStore *SecurityPolicyStore) GetByKey(key string) *model.SecurityPolicy

type Share

type Share model.Share

func (*Share) Key

func (share *Share) Key() string

func (*Share) Value

func (share *Share) Value() data.DataValue

type ShareStore

type ShareStore struct {
	common.ResourceStore
}

ShareStore is a store for project shares referenced by security policy rule

func (*ShareStore) Apply added in v0.0.1

func (shareStore *ShareStore) Apply(i interface{}) error

func (*ShareStore) GetByIndex

func (shareStore *ShareStore) GetByIndex(key string, value string) []model.Share

func (*ShareStore) GetByKey

func (shareStore *ShareStore) GetByKey(key string) *model.Share

Jump to

Keyboard shortcuts

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