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

WAF-SEC-090 – Policy-as-Code & Compliance Automation

Beschreibung

Sicherheitsrichtlinien MÜSSEN als Code implementiert und automatisch durchgesetzt werden. AWS Config MUSS als Recorder mit kontinuierlichem Monitoring konfiguriert sein. Mindestens ein Policy-as-Code-Framework (OPA/Conftest, Checkov, AWS Config Rules, HashiCorp Sentinel) MUSS in der CI/CD-Pipeline für IaC-Checks integriert sein. Policy-Violations MÜSSEN CI-Builds blockieren oder als Security-Findings eskaliert werden. Manuelle Compliance-Reviews ohne technische Durchsetzung sind nicht ausreichend.

Rationale

Sicherheitsrichtlinien, die nur in Dokumenten existieren, bieten keinen Schutz. Policy-as-Code überführt Richtlinien in maschinenprüfbare, versionierbare und automatisch durchsetzbare Regeln. Dadurch wird Policy Drift (Abweichung des Ist-Zustands vom Soll-Zustand) kontinuierlich erkannt. Automatisierte Compliance-Gates in CI/CD verhindern die Einführung von Non-Compliant-Infrastruktur, bevor sie deployed wird – deutlich günstiger als post-deployment Remediation.

Bedrohungskontext

Risiko Beschreibung

Policy Drift

Manuelle Konfigurationsänderungen außerhalb von IaC führen zu Abweichungen, die wochenlang unentdeckt bleiben.

Unvollständige Security-Reviews

Manuelle Pull-Request-Reviews übersehen systematisch bestimmte Klassen von Fehlkonfigurationen.

Compliance-Audit-Failure

Fehlende technische Durchsetzung macht es unmöglich, gegenüber Auditoren Compliance-Nachweise zu erbringen.

Langsame Remediation

Ohne automatische Erkennung von Compliance-Verletzungen bleibt die Zeit bis zur Behebung unvorhersehbar.

Anforderung

  • AWS Config MUSS als Recorder (aws_config_configuration_recorder) mit all_supported = true und einem Delivery-Channel in einen dedizierten S3-Bucket aktiviert sein.

  • Mindestens ein Policy-as-Code-Tool (Checkov, Conftest, OPA, wafpass) MUSS als CI-Gate für alle IaC-Änderungen konfiguriert sein.

  • Policy-Violations mit Severity CRITICAL oder HIGH MÜSSEN CI-Builds blockieren (exit code != 0).

  • AWS Config Managed Rules für grundlegende Sicherheitsanforderungen (CloudTrail enabled, S3 encryption, GuardDuty enabled) MÜSSEN konfiguriert sein.

  • Policy-as-Code-Regeln MÜSSEN versioniert, peer-reviewed und im selben Repository wie die IaC-Konfiguration verwaltet werden.

Implementierungsanleitung

  1. AWS Config aktivieren: aws_config_configuration_recorder mit all_supported = true und aws_config_delivery_channel zu einem S3-Bucket konfigurieren.

  2. Config-Recorder starten: aws_config_configuration_recorder_status mit is_enabled = true – ohne Status-Ressource ist der Recorder inaktiv.

  3. Managed Rules hinzufügen: aws_config_config_rule für cloud-trail-enabled, guardduty-enabled-centralized, s3-bucket-server-side-encryption-enabled, restricted-ssh.

  4. Checkov/wafpass in CI integrieren: GitHub Actions Step mit checkov -d . --framework terraform oder wafpass check . --fail-on HIGH,CRITICAL als Required Check.

  5. OPA/Conftest für benutzerdefinierte Policies: Rego-Policies für WAF++-spezifische Anforderungen (z. B. Mandatory-Tags, Approved-AMI-Liste) als Conftest-Checks.

  6. Pre-Commit-Hook: wafpass check oder checkov als Pre-Commit-Hook für sofortiges Entwickler-Feedback.

  7. Findings-Aggregation: AWS Config Non-Compliant-Findings in Security Hub aggregieren.

Reifegrad-Abstufung

Level Bezeichnung Kriterien

1

Keine automatisierte Policy-Prüfung

Richtlinien nur in Dokumenten; keine technische Durchsetzung; manuelles Compliance-Review.

2

Einzelne Tools eingesetzt; kein CI-Gate

Checkov oder tfsec manuell ausgeführt; Ergebnisse nicht automatisch enforced; AWS Config deaktiviert.

3

CI-Gate mit Policy-as-Code; AWS Config aktiv

Checkov/wafpass als Required CI-Check; AWS Config Recorder + Managed Rules aktiv; CRITICAL-Violations blockieren Deployment.

4

Benutzerdefinierte Policies und automatische Remediation

Eigene OPA/Rego-Policies für WAF++-Controls; AWS Config Auto-Remediation für häufige Violations; Compliance-Dashboard.

5

Vollständige Policy-as-Code-Plattform

Alle Security-Controls als testbare Policies; Policy-Changes durch RFC-Prozess; Continuous Compliance Attestation für Audit.

Terraform Checks

waf-sec-090.tf.aws.config-recorder-enabled

Prüft: AWS Config Recorder muss konfiguriert und aktiviert sein.

Compliant Non-Compliant
resource "aws_config_configuration_recorder" "main" {
  name     = "default"
  role_arn = aws_iam_role.config.arn
  recording_group {
    all_supported                 = true
    include_global_resource_types = true
  }
}

resource "aws_config_configuration_recorder_status" "main" {
  name       = aws_config_configuration_recorder.main.name
  is_enabled = true
}
# aws_config_configuration_recorder fehlt komplett
# oder:
resource "aws_config_configuration_recorder_status" "main" {
  name       = "default"
  is_enabled = false
  # WAF-SEC-090 Violation: Config Recorder deaktiviert
}

Remediation: aws_config_configuration_recorder mit all_supported = true und eine aws_config_configuration_recorder_status-Ressource mit is_enabled = true erstellen. Ohne Status-Ressource startet der Recorder nicht.

Evidenz

Typ Pflicht Beschreibung

IaC

✅ Pflicht

Terraform-Konfiguration von aws_config_configuration_recorder und zugehöriger Status-Ressource mit is_enabled = true.

Config

✅ Pflicht

CI-Pipeline-Konfiguration mit Policy-as-Code-Check (wafpass, Checkov oder gleichwertig) als Required Check.

Process

Optional

AWS Config Compliance-Dashboard-Screenshot oder Bericht mit Liste aktiver Managed Rules und deren Compliance-Status.

Config

Optional

OPA/Rego-Policy-Dateien im Repository mit nachvollziehbarer Versionierung und Code-Review-Historie.

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