securitypolicy

package
v0.0.0-...-aba7421 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

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 GroupsPtrToComparable

func GroupsPtrToComparable(groups []*model.Group) []Comparable

func GroupsToComparable

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

func RulesPtrToComparable

func RulesPtrToComparable(rules []*model.Rule) []Comparable

func RulesToComparable

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

func SecurityPolicyPtrToComparable

func SecurityPolicyPtrToComparable(sp *model.SecurityPolicy) Comparable

func SecurityPolicyToComparable

func SecurityPolicyToComparable(sp model.SecurityPolicy) Comparable

func SharesPtrToComparable

func SharesPtrToComparable(shares []*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

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

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 GetSecurityService

func GetSecurityService(service common.Service, vpcService common.VPCServiceProvider) *SecurityPolicyService

GetSecurityService get singleton SecurityPolicyService instance, networkpolicy/securitypolicy controller share the same instance.

func InitializeSecurityPolicy

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

InitializeSecurityPolicy sync NSX resources

func (*SecurityPolicyService) BuildNetworkPolicyAllowPolicyID

func (service *SecurityPolicyService) BuildNetworkPolicyAllowPolicyID(uid string) string

func (*SecurityPolicyService) BuildNetworkPolicyAllowPolicyName

func (service *SecurityPolicyService) BuildNetworkPolicyAllowPolicyName(uid string) string

func (*SecurityPolicyService) BuildNetworkPolicyIsolationPolicyID

func (service *SecurityPolicyService) BuildNetworkPolicyIsolationPolicyID(uid string) string

func (*SecurityPolicyService) BuildNetworkPolicyIsolationPolicyName

func (service *SecurityPolicyService) BuildNetworkPolicyIsolationPolicyName(uid string) string

func (*SecurityPolicyService) Cleanup

func (service *SecurityPolicyService) Cleanup(ctx context.Context) error

func (*SecurityPolicyService) CreateOrUpdateSecurityPolicy

func (service *SecurityPolicyService) CreateOrUpdateSecurityPolicy(obj interface{}) error

func (*SecurityPolicyService) DeleteSecurityPolicy

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

func (*SecurityPolicyService) ListNetworkPolicyID

func (service *SecurityPolicyService) ListNetworkPolicyID() sets.Set[string]

func (*SecurityPolicyService) ListSecurityPolicyID

func (service *SecurityPolicyService) ListSecurityPolicyID() sets.Set[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) 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, projectInfraChildren []*data.StructValue,
	vpcInfo *common.VPCResourceInfo,
) (*model.OrgRoot, error)

WrapHierarchyVpcSecurityPolicy wrap the security policy with groups and rules in VPC level and associated project infra children including project shares and groups into one hierarchy resource tree for OrgRootClient to patch.

type SecurityPolicyStore

type SecurityPolicyStore struct {
	common.ResourceStore
}

SecurityPolicyStore is a store for security policy

func (*SecurityPolicyStore) Apply

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

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