WAF++ WAF++
Back to WAF++ Homepage

WAF-SEC-050 – Network Segmentation & Security Group Hardening

Beschreibung

Alle Compute-Ressourcen MÜSSEN in privaten Subnetzen platziert sein, sofern sie nicht explizit öffentlichen Traffic bedienen. Security Groups DÜRFEN KEINE uneingeschränkten Ingress-Regeln von 0.0.0.0/0 oder ::/0 auf administrativen Ports (SSH Port 22, RDP Port 3389) erlauben. Egress MUSS auf erforderliche Ziele eingeschränkt sein; uneingeschränkter Egress (0.0.0.0/0 auf allen Ports) ist für Workloads mit sensiblen Daten verboten. VPC-Ressourcen MÜSSEN logisch nach Workload-Tier segmentiert sein (Public, Private, Data/Isolated).

Rationale

Netzwerksegmentierung ist eine kritische Defense-in-Depth-Schicht, die den Blast Radius eines Einbruchs begrenzt. Ohne Segmentierung hat ein kompromittierter Applikationsserver direkten Netzwerkzugriff auf alle Datenbanken, interne APIs und administrative Schnittstellen im VPC. Offene SSH- und RDP-Ports zum Internet gehören zu den am häufigsten ausgenutzten Angriffsvektoren für initialen Zugriff. Uneingeschränkter Egress ermöglicht Datenexfiltration und Command-and-Control-Kommunikation, selbst wenn der Ingress gesperrt ist.

Bedrohungskontext

Risiko Beschreibung

Lateral Movement

Ein kompromittierter Applikationsserver in einem flachen VPC kann direkt auf Datenbanken, Admin-APIs und andere kritische interne Ressourcen zugreifen.

Exponierte Admin-Ports

Offenes SSH (22) oder RDP (3389) zum Internet ist Brute-Force- und Credential-Spray-Angriffen direkt ausgesetzt.

Datenexfiltration via unkontrollierten Egress

Ohne Egress-Einschränkungen können Angreifende Daten über beliebige Protokolle und Ziele nach außen schleusen.

Reconnaissance und Pivoting

In flachen VPC-Netzwerken können Angreifende nach dem initialen Zugriff unkontrolliert Dienste im internen Netz erkunden und sich ausbreiten.

Anforderung

  • Datenbankinstanzen, Cache-Cluster und interne Compute-Ressourcen MÜSSEN in privaten Subnetzen ohne öffentliche IP platziert sein.

  • Security Groups DÜRFEN KEINE Ingress-Regel auf Port 22 oder 3389 von 0.0.0.0/0 enthalten.

  • Administrative Zugriffe MÜSSEN über AWS Systems Manager Session Manager (SSM) ohne offene SSH-Ports erfolgen.

  • VPC-Architektur MUSS mindestens drei Subnetztiers aufweisen: Public (Load Balancer), Private (Compute) und Isolated (Datenbanken).

  • VPC Flow Logs MÜSSEN auf allen Produktions-VPCs aktiviert sein.

  • Egress-Regeln MÜSSEN auf spezifische Ziel-CIDRs und Ports beschränkt sein für Datentier-Security-Groups.

Implementierungsanleitung

  1. Drei-Tier-VPC-Architektur aufbauen: Public-Subnetze (nur Load Balancer), Private-Subnetze (Compute), Isolated-Subnetze (Datenbanken ohne Internet-Route).

  2. Öffentliche IPs deaktivieren: associate_public_ip_address = false auf allen aws_instance- und aws_launch_template-Ressourcen für interne Workloads.

  3. SSH/RDP-Regeln entfernen: Ingress-Regeln auf Port 22/3389 von 0.0.0.0/0 aus allen Security Groups entfernen.

  4. SSM Session Manager aktivieren: IAM-Rolle mit AmazonSSMManagedInstanceCore-Policy auf EC2-Instanzen; kein SSH-Port notwendig.

  5. Security Groups nach SG-ID referenzieren: Intra-VPC-Regeln über Security-Group-IDs statt CIDR-Ranges formulieren.

  6. VPC Flow Logs aktivieren: Flow Logs auf alle Prod-VPCs; Logs nach S3 oder CloudWatch für Security-Monitoring shippen.

  7. VPC Endpoints einrichten: Interface- und Gateway-Endpoints für AWS-Dienste (S3, DynamoDB, Secrets Manager, KMS) um Datenverkehr über das öffentliche Internet zu vermeiden.

Reifegrad-Abstufung

Level Bezeichnung Kriterien

1

Flaches VPC

Einzelnes Subnetz oder keine Segmentierung zwischen Applikations- und Datentier; Security Groups mit breiten Ingress-Ranges.

2

Public/Private-Subnetztrennung

Datenbankinstanzen in privaten Subnetzen ohne öffentliche IP; SSH/RDP auf bekannte CIDR-Ranges eingeschränkt.

3

Drei-Tier-Segmentierung mit gehärteten Security Groups

Public, Private und Isolated Subnetze; keine Security Group mit 0.0.0.0/0-Ingress; VPC Flow Logs aktiv; Admin-Zugriff via SSM.

4

Mikrosegmentierung mit VPC Endpoints und Least-Privilege-Egress

Security Groups mit SG-ID-Referenzen; VPC Endpoints für alle AWS-Dienste; Egress auf spezifische Ziele eingeschränkt.

5

Zero-Trust-Netzwerk mit Service Mesh und kontinuierlicher Flussanalyse

Ost-West-Traffic mit gegenseitiger Authentifizierung (mTLS); Flow-Log-Analyse mit Echtzeit-Anomalieerkennung; Network Policy as Code.

Terraform Checks

waf-sec-050.tf.aws.no-public-ip-internal-compute

Prüft: Interne Compute-Ressourcen dürfen keine öffentlichen IP-Adressen erhalten.

Compliant Non-Compliant
resource "aws_instance" "app" {
  ami                         = data.aws_ami.ubuntu.id
  instance_type               = "t3.medium"
  subnet_id                   = aws_subnet.private.id
  associate_public_ip_address = false
  vpc_security_group_ids      = [aws_security_group.app.id]
  tags = { Name = "app-server" }
}
resource "aws_instance" "app" {
  ami                         = data.aws_ami.ubuntu.id
  instance_type               = "t3.medium"
  subnet_id                   = aws_subnet.public.id
  associate_public_ip_address = true
  # WAF-SEC-050 Violation: öffentliche IP
  vpc_security_group_ids      = [aws_security_group.app.id]
}

Remediation: associate_public_ip_address = false auf allen aws_instance- und aws_launch_template-Ressourcen für interne Workloads setzen. Instanzen in private Subnetze verlegen. NAT Gateway für ausgehenden Internet-Traffic nutzen; eingehenden Traffic über Application Load Balancer im Public Subnet routen.


waf-sec-050.tf.aws.no-unrestricted-ssh

Prüft: Security Groups dürfen kein uneingeschränktes SSH (Port 22) oder RDP (Port 3389) aus dem Internet erlauben.

Compliant Non-Compliant
resource "aws_security_group" "app" {
  name   = "app-server-sg"
  vpc_id = aws_vpc.main.id
  # Kein SSH-Ingress – SSM Session Manager verwenden
  egress {
    from_port   = 443
    to_port     = 443
    protocol    = "tcp"
    cidr_blocks = ["0.0.0.0/0"]
    description = "HTTPS outbound for AWS API calls"
  }
}
resource "aws_security_group" "bad" {
  name   = "app-server-sg"
  vpc_id = aws_vpc.main.id
  ingress {
    from_port   = 22
    to_port     = 22
    protocol    = "tcp"
    cidr_blocks = ["0.0.0.0/0"]
    # WAF-SEC-050 Violation: SSH offen zum Internet
  }
}

Remediation: Alle Ingress-Regeln, die Port 22 oder 3389 von 0.0.0.0/0 erlauben, aus Security Groups entfernen. Für SSH-Zugriff AWS Systems Manager Session Manager aktivieren (erfordert SSM-Agent und IAM-Rolle mit AmazonSSMManagedInstanceCore). Bei Legacy-SSH-Anforderungen Quell-CIDR auf das VPN oder Office-IP-Range einschränken.

WAF-SOV-090 adressiert darüber hinaus Netzwerksouveränitätsaspekte und egress-seitige Kontrollen für Workloads mit Datensouveränitätsanforderungen.

Evidenz

Typ Pflicht Beschreibung

IaC

✅ Pflicht

Terraform VPC-, Subnetz- und Security-Group-Ressourcen mit Drei-Tier-Segmentierung und ohne 0.0.0.0/0-Ingress auf administrativen Ports.

Architecture

✅ Pflicht

Netzwerkarchitektur-Diagramm mit Subnetztiers, Security-Group-Grenzen und Datenflussregeln.

Config

Optional

VPC Flow Logs Konfiguration und Beispiel-Log-Output als Bestätigung aktiver Protokollierung.

Config

Optional

AWS Config Rule restricted-ssh Compliance-Report ohne Security Groups mit offenem SSH-Zugang.

Regulatorisches Mapping

Framework Controls

ISO 27001:2022

A.5.15 – Threat intelligence; A.5.16 – Threat classification; A.5.24 – Information security incident management; A.5.25 – Assessment and decision on information security events; A.5.26 – Response to information security incidents; A.5.27 – Learning from information security incidents; A.8.2 – Privileged access rights; A.8.5 – Secure authentication; A.8.8 – Management of technical vulnerabilities; A.8.10 – Information deletion; A.8.11 – Data masking; A.8.22 – Segregation of networks; A.8.23 – Network security; A.8.24 – Use of cryptography

ISO 27017

CLD.5.1 – Information security in cloud services; CLD.5.2 – Access control in cloud services; CLD.6.3 – Shared roles and responsibilities

ISO 27018

A.2 – Purpose legitimacy and PII protection; A.10 – Confidentiality and security of PII

GDPR

Art. 5(1)(c) – Data minimisation; Art. 5(1)(f) – Integrity and confidentiality; Art. 9 – Special categories of personal data; Art. 25 – Data protection by design and by default; Art. 32 – Security of processing; Art. 44 – General principles for transfers; Art. 46 – Appropriate safeguards; Art. 30 – Records of processing activities

BSI C5:2020

IDM-01 – Identity and access management policy; IDM-02 – Role management; IDM-03 – User lifecycle management; COM-01 – Network and service security; COM-02 – Cloud monitoring; COM-03 – Cloud logging

EUCS (ENISA)

IAM-01 – Identity and access management; IAM-02 – Access rights management; IAM-03 – Privileged access management; IAM-04 – Access control policy

NIST SP 800-53

AC-1 – Policy and procedures; AC-2 – Account management; AC-3 – Access enforcement; AC-6 – Least privilege; IA-2 – Identification and authentication; IA-5 – Authenticator management; SI-4 – Information system monitoring; SI-5 – Malicious code protection

FedRAMP

AC-1, AC-2, AC-3, AC-6, IA-2, IA-5, SI-4, SI-5 (Moderate/High baseline)

HIPAA

§ 164.308(a)(4) – Access management; § 164.312(a) – Access control; § 164.312(d) – Information system activity review; § 164.312(e)(1) – Transmission security

PCI DSS v4.0

Req 7 – Restrict access to cardholder data; Req 8 – Identify and authenticate access; Req 8.3 – Non-service accounts; Req 8.6 – Password policy; Req 8.2.4 – MFA

SOC 2 Type II

CC6.1 – Logical access security software; CC6.2 – Logical access security management; CC6.6 – Secure configuration; CC6.7 – Network security

CSRD

ESRS E1 – Climate change – Disclosure of information; ESRS G1 – Governance – Disclosure of information

NIST CSF 2.0

GV.AC – Identity management and access control; DE.CM – Configuration management; DE.AE – Anomaly detection

CIS Controls v8

CIS 4 – Secure Configuration; CIS 4.1 – Inventory and control of enterprise assets; CIS 4.4 – Access control; CIS 4.5 – Least privilege; CIS 4.8 – Audit log management

TISAX

Information security – Access rights management; Prototype protection – Sensitive data handling

ANSSI SecNumCloud

Domain – Identity and access management; Domain – Security monitoring

BIO

BIO – Identificatie en authenticatie; BIO – Toegangsbeheer

ENS High

org.3 – Políticas de acceso; op.exp.5 – Monitorización de la configuración

UK NCSC CAF

B1 – Access control; B2 – Secure configuration

CMMC 2.0

AC.L2-3.1.1 – Access control policy; AC.L2-3.5.1 – Access enforcement

IRAP

ISM – Identity and access management; ISM – Access control

CCCS PBMM

AC-6 – Least privilege; AC-7 – Unsuccessful logon attempts

MAS TRM

Ch.4 – Identity and access management; Ch.8 – Security monitoring

ISMAP

Access control and identity management

FISC

Operational measures – Access control