securitypolicy

package
v0.0.0-...-c3caef9 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2018 License: BSD-3-Clause Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	XMLName                xml.Name        `xml:"action"`
	Class                  string          `xml:"class,attr"`
	ObjectID               string          `xml:"objectId,omitempty"`
	ObjectTypeName         string          `xml:"objectTypeName,omitempty"`
	VsmUUID                string          `xml:"vsmUuid,omitempty"`
	NodeID                 string          `xml:"nodeId,omitempty"`
	Revision               int             `xml:"revision,omitempty"`
	TypeName               string          `xml:"type,omitempty>typeName,omitempty"`
	Name                   string          `xml:"name,omitempty"`
	Action                 string          `xml:"action"`
	Category               string          `xml:"category"`
	Direction              string          `xml:"direction"`
	IsEnabled              bool            `xml:"isEnabled,omitempty"`
	SecondarySecurityGroup []SecurityGroup `xml:"secondarySecurityGroup,omitempty"`
	Applications           *Applications   `xml:"applications,omitempty"`
}

Action element of ActionsByCategory list.

type ActionsByCategory

type ActionsByCategory struct {
	XMLName  xml.Name `xml:"actionsByCategory"`
	Category string   `xml:"category,omitempty"`
	Actions  []Action `xml:"action,omitempty"`
}

ActionsByCategory element of SecurityPolicy.

type Application

type Application struct {
	//XMLName  xml.Name `xml:"application,omitempty"`
	ObjectID string `xml:"objectId,omitempty"`
	Name     string `xml:"name,omitempty"`
}

Application element of Applications List

type Applications

type Applications struct {
	Applications []Application `xml:"application,omitempty"`
}

Applications object struct

type CreateSecurityPolicyAPI

type CreateSecurityPolicyAPI struct {
	*api.BaseAPI
}

CreateSecurityPolicyAPI api object

func NewCreate

func NewCreate(name, precedence, description string, securityGroups []string, actions []Action) *CreateSecurityPolicyAPI

NewCreate returns a new object of CreatePolicyAPI.

func (CreateSecurityPolicyAPI) GetResponse

func (ca CreateSecurityPolicyAPI) GetResponse() string

GetResponse returns a ResponseObject of CreateServiceAPI.

type DeleteSecurityPolicyAPI

type DeleteSecurityPolicyAPI struct {
	*api.BaseAPI
}

DeleteSecurityPolicyAPI - struct

func NewDelete

func NewDelete(securityPolicyID string, force bool) *DeleteSecurityPolicyAPI

NewDelete - Generates a new DeleteSecurityPolicyAPI object.

type GetAllSecurityPoliciesAPI

type GetAllSecurityPoliciesAPI struct {
	*api.BaseAPI
}

GetAllSecurityPoliciesAPI - struct

func NewGetAll

func NewGetAll() *GetAllSecurityPoliciesAPI

NewGetAll - returns GetAll api object of GetAllSecurityPoliciesAPI type.

func (GetAllSecurityPoliciesAPI) GetResponse

func (getAllAPI GetAllSecurityPoliciesAPI) GetResponse() *SecurityPolicies

GetResponse - Returns ResponseObject from GetAllSecurityPoliciesAPI.

type GetSecurityPolicyAPI

type GetSecurityPolicyAPI struct {
	*api.BaseAPI
}

GetSecurityPolicyAPI base object.

func NewGet

func NewGet(securityPolicyID string) *GetSecurityPolicyAPI

NewGet returns new object of GetSecurityPolicyAPI.

func (GetSecurityPolicyAPI) GetResponse

func (ga GetSecurityPolicyAPI) GetResponse() *SecurityPolicy

GetResponse returns ResponseObject of GetSecurityPolicyAPI.

type SecurityGroup

type SecurityGroup struct {
	ObjectID string `xml:"objectId,omitempty"`
}

SecurityGroup object struct

type SecurityPolicies

type SecurityPolicies struct {
	SecurityPolicies []SecurityPolicy `xml:"securityPolicy"`
}

SecurityPolicies top level struct

func (SecurityPolicies) FilterByName

func (spList SecurityPolicies) FilterByName(name string) *SecurityPolicy

FilterByName returns a single security policy object if it matches the name in SecurityPolicies list.

func (SecurityPolicies) RemoveSecurityPolicyByName

func (spList SecurityPolicies) RemoveSecurityPolicyByName(policyName string) *SecurityPolicies

RemoveSecurityPolicyByName - Removes the SecurityPolicy from a list of SecurityPolicies provided it matches the given name.

func (SecurityPolicies) String

func (spList SecurityPolicies) String() string

type SecurityPolicy

type SecurityPolicy struct {
	XMLName              xml.Name          `xml:"securityPolicy"`
	ObjectID             string            `xml:"objectId,omitempty"`
	ObjectTypeName       string            `xml:"objectTypeName,omitempty"`
	VsmUUID              string            `xml:"vsmUuid,omitempty"`
	NodeID               string            `xml:"nodeId,omitempty"`
	Revision             int               `xml:"revision,omitempty"`
	TypeName             string            `xml:"type,omitempty>typeName,omitempty"`
	Name                 string            `xml:"name,omitempty"`
	Description          string            `xml:"description,omitempty"`
	Precedence           string            `xml:"precedence"`
	IsUniversal          bool              `xml:"isUniversal,omitempty"`
	InheritanceAllowed   bool              `xml:"inheritanceAllowed,omitempty"`
	ActionsByCategory    ActionsByCategory `xml:"actionsByCategory,omitempty"`
	SecurityGroupBinding []SecurityGroup   `xml:"securityGroupBinding,omitempty"`
}

SecurityPolicy object struct

func (*SecurityPolicy) AddInboundFirewallAction

func (sp *SecurityPolicy) AddInboundFirewallAction(name, action, direction string, applicationObjectIDs []string) error

AddInboundFirewallAction adds outbound firewall action rule into security policy.

func (*SecurityPolicy) AddOutboundFirewallAction

func (sp *SecurityPolicy) AddOutboundFirewallAction(name, action, direction string, secGroupObjectIDs, applicationObjectIDs []string) error

AddOutboundFirewallAction adds outbound firewall action rule into security policy.

func (*SecurityPolicy) AddSecurityGroupBinding

func (sp *SecurityPolicy) AddSecurityGroupBinding(objectID string)

AddSecurityGroupBinding - Adds security group to list of SecurityGroupBinding if it doesn't exists.

func (*SecurityPolicy) CheckFirewallRuleByUUID

func (sp *SecurityPolicy) CheckFirewallRuleByUUID(uuid string) bool

CheckFirewallRuleByUUID - Checks if the rule with UUID exists in the firewall rules of security policy.

func (*SecurityPolicy) GetFirewallRuleByName

func (sp *SecurityPolicy) GetFirewallRuleByName(name string) *Action

GetFirewallRuleByName - Checks if the rule with given name exists in the firewall rules of security policy.

func (*SecurityPolicy) GetFirewallRuleByUUID

func (sp *SecurityPolicy) GetFirewallRuleByUUID(uuid string) *Action

GetFirewallRuleByUUID - Checks if the rule with given name exists in the firewall rules of security policy.

func (SecurityPolicy) MarshalToXML

func (sp SecurityPolicy) MarshalToXML() string

MarshalToXML converts the object into XML

func (*SecurityPolicy) RemoveFirewallActionByName

func (sp *SecurityPolicy) RemoveFirewallActionByName(actionName string)

RemoveFirewallActionByName - Removes the firewalla ction from security policy object if it exists.

func (*SecurityPolicy) RemoveFirewallActionByUUID

func (sp *SecurityPolicy) RemoveFirewallActionByUUID(uuid string)

RemoveFirewallActionByUUID - Removes the firewall action from security policy object if it exists by it's UUID.

func (*SecurityPolicy) RemoveSecurityGroupBinding

func (sp *SecurityPolicy) RemoveSecurityGroupBinding(objectID string)

RemoveSecurityGroupBinding - Adds security group to list of SecurityGroupBinding if it doesn't exists.

func (SecurityPolicy) String

func (sp SecurityPolicy) String() string

type UpdateSecurityPolicyAPI

type UpdateSecurityPolicyAPI struct {
	*api.BaseAPI
}

UpdateSecurityPolicyAPI ...

func NewUpdate

func NewUpdate(securityPolicyID string, securityPolicyPayload *SecurityPolicy) *UpdateSecurityPolicyAPI

NewUpdate creates a new object of UpdateSecurityPolicyAPI

func (UpdateSecurityPolicyAPI) GetResponse

func (updateAPI UpdateSecurityPolicyAPI) GetResponse() string

GetResponse returns the ResponseObject from UpdateSecurityPolicyAPI

Jump to

Keyboard shortcuts

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