Security Groups
Cheat sheet · https://pcornel.dk/topic.php?topic=5026
Answer
Security groups are stateful virtual firewalls attached to cloud instances or interfaces, allowing specified inbound and outbound traffic. Reference other groups instead of wide CIDRs, and never open SSH or RDP to 0.0.0.0/0.
Remember
- Security groups are stateful.
- Reference other groups instead of wide CIDRs.
- 0.0.0.0/0 on admin ports is a critical finding.
First checks
aws ec2 describe-security-groups --filters Name=ip-permission.cidr,Values=0.0.0.0/0— open to world- Unused security groups — cleanup
- References between SGs — least privilege
Verify in this order
packet → SG rules → allow
Where it usually breaks
First mismatch in platform/workload identity → desired configuration → management/control plane → runtime enforcement → telemetry → workload/resource outcome; preserve identity/policy/pre-state before mutation.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5026