Skip to main content
Version: 1.1.2

SecurityRule

PropertyValue
KindSecurityRule
API Group/Versionarubacloud.com/v1alpha1
CRD Namesecurityrules.arubacloud.com
ScopeNamespaced
Short Namessr, arusr

Description

A SecurityRule defines a single ingress or egress traffic rule within a SecurityGroup. Rules specify the protocol, port range, direction, and target (an IP/CIDR or another SecurityGroup). CloudServers that reference the parent SecurityGroup are governed by all its SecurityRules.

Spec Fields

FieldTypeRequiredDefaultValidationDescription
tenantstringNoAruba Cloud tenant identifier. Must match the owning SecurityGroup's tenant.
regionstringYesITBG-BergamoAruba Cloud region. Must match the parent SecurityGroup's region.
protocolstringYesEnum: TCP, UDP, ICMP, ALLNetwork protocol this rule applies to
portstringYesPort or port range: "80", "8080-8090", or "ALL"
directionstringYesEnum: Ingress, EgressWhether this rule applies to incoming or outgoing traffic
target.typestringYesEnum: Ip, SecurityGroupWhether the target is an IP/CIDR or another SecurityGroup
target.valuestringYesThe IP address, CIDR block (e.g., 0.0.0.0/0), or SecurityGroup ID
tags[]stringNoLabels propagated to the Aruba Cloud resource
securityGroupReferenceResourceReferenceYesReference to the owning SecurityGroup
vpcReferenceResourceReferenceYesReference to the owning VPC
projectReferenceResourceReferenceYesReference to the owning Project

Status Fields

FieldTypeDescription
phasestringCurrent lifecycle phase
resourceIDstringAruba Cloud SecurityRule ID, set after creation
messagestringHuman-readable status message
observedGenerationint64Last .metadata.generation processed
phaseStartTimetimestampWhen the current phase began
conditions[]ConditionStandard Kubernetes conditions
projectIDstringResolved Aruba Cloud project ID
vpcIDstringResolved Aruba Cloud VPC ID
securityGroupIDstringResolved Aruba Cloud SecurityGroup ID
tip

SecurityRule exposes extra kubectl get columns for Protocol and Direction, making it easy to see rule details at a glance:

kubectl get sr -n default
# NAME PROTOCOL DIRECTION PHASE AGE
# allow-ssh TCP Ingress Active 5m

References

Owned by: SecurityGroup (and VPC, Project)

No children.

Lifecycle

  • Creation ordering: The SecurityGroup (and its parents VPC and Project) must be Active.
  • Deletion behaviour: SecurityRules have no children. Deletion calls the Aruba Cloud API and removes the finalizer.
  • Update behaviour: tags can be updated. All other fields (protocol, port, direction, target) are effectively immutable — recreate the rule to change them.

Examples

Ingress rule: allow SSH from anywhere

apiVersion: arubacloud.com/v1alpha1
kind: SecurityRule
metadata:
name: allow-ssh-ingress
namespace: default
spec:
tenant: ARU-123456
region: ITBG-Bergamo
protocol: TCP
port: "22"
direction: Ingress
target:
type: Ip
value: "0.0.0.0/0"
securityGroupReference:
name: web-sg
namespace: default
vpcReference:
name: web-vpc
namespace: default
projectReference:
name: my-project
namespace: default

Egress rule: allow all outbound traffic

apiVersion: arubacloud.com/v1alpha1
kind: SecurityRule
metadata:
name: allow-all-egress
namespace: default
spec:
tenant: ARU-123456
region: ITBG-Bergamo
protocol: ALL
port: "ALL"
direction: Egress
target:
type: Ip
value: "0.0.0.0/0"
securityGroupReference:
name: web-sg
namespace: default
vpcReference:
name: web-vpc
namespace: default
projectReference:
name: my-project
namespace: default

kubectl Quick Reference

# List all security rules with protocol and direction columns
kubectl get sr -n default

# Describe a security rule
kubectl describe arusr allow-ssh-ingress -n default