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) mitall_supported = trueund 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
-
AWS Config aktivieren:
aws_config_configuration_recordermitall_supported = trueundaws_config_delivery_channelzu einem S3-Bucket konfigurieren. -
Config-Recorder starten:
aws_config_configuration_recorder_statusmitis_enabled = true– ohne Status-Ressource ist der Recorder inaktiv. -
Managed Rules hinzufügen:
aws_config_config_rulefürcloud-trail-enabled,guardduty-enabled-centralized,s3-bucket-server-side-encryption-enabled,restricted-ssh. -
Checkov/wafpass in CI integrieren: GitHub Actions Step mit
checkov -d . --framework terraformoderwafpass check . --fail-on HIGH,CRITICALals Required Check. -
OPA/Conftest für benutzerdefinierte Policies: Rego-Policies für WAF++-spezifische Anforderungen (z. B. Mandatory-Tags, Approved-AMI-Liste) als Conftest-Checks.
-
Pre-Commit-Hook:
wafpass checkodercheckovals Pre-Commit-Hook für sofortiges Entwickler-Feedback. -
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 |
|---|---|
|
|
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 |
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.5.28 – Collection of evidence; A.8.16 – Technology use identification and monitoring; A.8.21 – Telecommunications and network security |
ISO 27017 |
CLD.5.1 – Information security in cloud services; CLD.5.2 – Access control in cloud services |
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 |
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 |
EUCS (ENISA) |
IAM-01 – Identity and access management; IAM-02 – Access rights management; IAM-03 – Privileged access management |
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; SI-4 – Information system monitoring |
FedRAMP |
AC-1, AC-2, AC-3, AC-6, IA-2 (Moderate/High baseline) |
HIPAA |
§ 164.308(a)(4) – Access management; § 164.312(a) – Access control; § 164.312(d) – Information system activity review |
PCI DSS v4.0 |
Req 7 – Restrict access to cardholder data; Req 8 – Identify and authenticate access; Req 8.3 – Non-service accounts |
SOC 2 Type II |
CC6.1 – Logical access security software; CC6.2 – Logical access security management; CC6.6 – Secure configuration |
CSRD |
ESRS E1 – Climate change; ESRS G1 – Governance |
NIST CSF 2.0 |
GV.AC – Identity management and access control; DE.CM – Configuration management |
CIS Controls v8 |
CIS 4 – Secure Configuration; CIS 4.4 – Access control; CIS 4.5 – Least privilege |
TISAX |
Information security – Access rights management |
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 |