Skip to content

Allow customization of default egress security group rules in CAPO managedSecurityGroups #3209

Description

@alejandro-ripoll

/kind feature

Describe the solution you'd like

Currently, when Cluster API Provider OpenStack (CAPO) creates security group rules, it defines default egress rules that allows all outbound traffic (0.0.0.0/0). This behavior is implemented here:

var defaultRules = []resolvedSecurityGroupRuleSpec{
{
Direction: securityGroupRuleDirectionEgress,
Description: "Full open",
EtherType: securityGroupRuleEtherTypeIPv4,
PortRangeMin: 0,
PortRangeMax: 0,
Protocol: "",
RemoteIPPrefix: "",
},
{
Direction: securityGroupRuleDirectionEgress,
Description: "Full open",
EtherType: securityGroupRuleEtherTypeIPv6,
PortRangeMin: 0,
PortRangeMax: 0,
Protocol: "",
RemoteIPPrefix: "",
},
}

In some environments, this default behavior is too permissive and does not comply with security or business constraints that require restricting outbound traffic to specific CIDRs.

I would like to have a way to customize or restrict the default egress rules generated by CAPO without having to disable managedSecurityGroups, since this feature provides other valuable functionality that I want to keep (such as automated lifecycle management of security groups).

A possible solution could be one of the following:

  • Allow configuring egress CIDR ranges via OpenStackCluster spec
  • Provide a flag to disable the default "allow all egress" rule so that I can add only allowed egress ranges via OpenStackCluster.spec.managedSecurityGroups.allNodesSecurityGroupRules

The goal is to support environments where outbound traffic must be explicitly restricted without losing the benefits of managed security groups.

Anything else you would like to add:

This limitation makes it difficult to adopt CAPO in environments with strict network segmentation requirements (e.g., regulated industries or zero-trust networks), where unrestricted egress is not allowed even temporarily.

A configurable approach would significantly improve the provider’s flexibility and enterprise readiness.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Inbox

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions