* feat(network): add opt-in security group enforcement
* fix(ec2): make security group tests order independent
* fix(network): emit valid ICMP nft rules and restart protected instances
Three review findings on the opt-in security-group enforcement foundation:
- SecurityGroupNftCompiler built "icmp type 8 code 0 accept" for an AWS
ICMP rule carrying both FromPort (type) and ToPort (code). nftables
header fields are separate expressions, so nft rejected the whole
compiled policy and the manager then quarantined every endpoint. Each
field now repeats the protocol keyword, and a protocol rule with no
type or code becomes "meta l4proto icmp accept", which was equally
invalid as a bare "icmp accept".
- StartInstances followed the legacy restart path for a protected
workload and waited for a Docker bridge IP on a container that shares
the helper's network namespace and so has no attachment of its own.
The helper survives the workload's stop, so start now reuses its
transport address exactly as launch does, and skips the reachable
private address rewrite the same way.
- Replaced the newly introduced var declarations with explicit types and
imported the inline java.util/model FQCNs, per AGENTS.md.
* fix(network): scope the firewall helper to CAP_NET_ADMIN
The helper only has to program nftables inside the namespace Docker already
gave it, so full --privileged granted far more than the feature needs.
ContainerLifecycleManager now adds CAP_NET_ADMIN for the container carrying
the floci.security-group-helper label, mirroring the capability drop already
applied to protected workloads at the same choke point, and the helper spec
no longer asks for privileged mode.
Also replaces the inline java.util FQCNs the previous commit missed in
Ec2Service with imports, per AGENTS.md.
---------
Co-authored-by: Alexy Grabov <Alexy.Grabov@cyberark.com>