Pcornel
Browse topics
Options
Recent
Favorites
Security · Technical reference

Security Groups

Direct 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.

First 30 seconds

1. Security groups are stateful, instance-level filters.

2. Allow only needed ports from specific sources/SGs.

3. No 0.0.0.0/0 for SSH/RDP.

4. Use SG references.

5. Review regularly.

Operational verification

packet → SG rules → allow

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common mistakes
  • Opening 0.0.0.0/0 temporarily for troubleshooting and forgetting it.
  • One security group shared by many unrelated workloads.
  • Using IP rules where security group references would be clearer.
  • Not reviewing rules with flow logs to find unused ones.
Platform / version applicability
Platform and workload security
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformPlatform and workload security
Scope / prerequisiteUse this when configuring cloud security groups.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

1 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Finding risky rules Verify boundary
aws ec2 describe-security-groups --query "SecurityGroups[?IpPermissions[?IpRanges[?CidrIp=='0.0.0.0/0']]].[GroupId,GroupName]"
az network nsg list --query "[].securityRules[?sourceAddressPrefix=='*' || sourceAddressPrefix=='Internet']"

Rules allowing 0.0.0.0/0 on SSH (22), RDP (3389) or database ports are the first to fix.

Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • Security groups are stateful.
  • Reference other groups instead of wide CIDRs.
  • 0.0.0.0/0 on admin ports is a critical finding.
Key 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
ReferenceWhy it matters1 section · depth on demand

Rules of thumb

  • Allow only required ports from specific sources; never 0.0.0.0/0 on SSH/RDP/databases.
  • Reference other security groups instead of IP ranges inside the VPC.
  • Security groups are stateful (return traffic allowed); NACLs are stateless.
  • Review unused and overly broad rules with CSPM.

aws ec2 describe-security-groups --filters Name=ip-permission.cidr,Values=0.0.0.0/0 finds open rules.

ReferenceImportant terms & boundaries1 section · depth on demand

In depth

Security groups (AWS) and network security groups (Azure) are stateful, virtual firewalls attached to instances or network interfaces. They allow traffic based on protocol, port and source/destination, and return traffic is allowed automatically.

Good practice:

PracticeExample
Least privilege rulesAllow 443 from the load balancer's group, not from anywhere
Reference groups instead of IPsApp tier allows DB access from "app-sg"
No admin ports to the internetSSH/RDP via bastion or session manager
Descriptive names and tagsPurpose and owner on every rule
Regular reviewRemove unused rules and groups
aws ec2 describe-security-groups --query "SecurityGroups[?IpPermissions[?IpRanges[?CidrIp=='0.0.0.0/0']]].[GroupId,GroupName]"
Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docPlatform and workload security current

Authoritative/upstream documentation reviewed for bounded claims in Cloud Security → Security Groups. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://csrc.nist.gov/pubs/sp/800/210/final · confidence 94%
Confirmation

Confirm action

Continue?