WAF-COST-070 – Observability & Logging Cost Tiers
Beschreibung
Log-Gruppen MÜSSEN nach Retention-Tier kategorisiert sein:
Hot (7–30 Tage), Warm (30–90 Tage), Cold (90–365 Tage), Archive (>365 Tage).
CloudWatch Log Groups DÜRFEN NICHT retention_in_days = 0 haben.
DEBUG-Level-Logging in Produktion ist ohne Architecture-Board-Genehmigung verboten.
Trace-Sampling MUSS für High-Volume-Services konfiguriert sein (>1.000 req/s).
Rationale
Observability-Kosten sind einer der am schnellsten wachsenden und schwer kontrollierbaren Cloud-Kostenkategorien. DEBUG-Level-Logging erzeugt 10–100× mehr Log-Volumen als INFO. CloudWatch-Default (retention_in_days = 0 oder fehlt) akkumuliert Logs unbegrenzt. In schlecht gemanagten Umgebungen übersteigen Observability-Kosten regelmäßig die Compute-Kosten.
Bedrohungskontext
| Risiko | Beschreibung |
|---|---|
Observability-Kostendominanz |
Logging/Monitoring-Kosten übersteigen Compute-Kosten – klassisches Anti-Pattern ohne Tiering. |
DEBUG in Produktion |
10–100× höheres Log-Volumen; 95% der DEBUG-Logs werden nie gelesen. |
Unbegrenzte Trace-Speicherung |
Ohne Sampling sammeln APM-Tools jede einzelne Anfrage – exponentiell wachsende Kosten. |
DSGVO-Risiko |
Logs können personenbezogene Daten enthalten; unbegrenzte Retention = DSGVO-Verstoß. |
Log-Tiering-Modell
| Tier | Retention | Typ | Kosten |
|---|---|---|---|
Hot |
7–30 Tage |
Operational Logs (Errors, Warnings, App-Logs) |
Höchste Kosten/GB; minimale Menge |
Warm |
30–90 Tage |
Security-Logs, Audit-Trails, Access-Logs |
Mittlere Kosten; Compliance-relevante Daten |
Cold |
90–365 Tage |
Regulatory-Logs, Finanzlogs, DSGVO-relevante Logs |
Günstig; selten abgefragt |
Archive |
> 365 Tage |
Legal Hold, Langzeit-Compliance (S3 + Glacier) |
Sehr günstig; quasi kein Zugriff |
Reifegrad-Abstufung
| Level | Bezeichnung | Kriterien |
|---|---|---|
1 |
Alle Logs unbegrenzt |
CloudWatch-Default (infinite); kein Log-Level-Management; kein Sampling. |
2 |
Einige Retention-Werte gesetzt |
Größte Kostentreiber mit Retention konfiguriert; kein systematischer Ansatz. |
3 |
Tiered Retention in IaC |
Alle Log Groups mit |
4 |
Log-Value-Analyse |
Log Groups analysiert auf Nutzungsfrequenz; Tiering auf Basis von Access-Patterns. |
5 |
Automated Intelligent Tiering |
S3 Intelligent-Tiering für Log-Archive; ML-basierte Log-Anomalie-Erkennung reduziert Volumen. |
Terraform Checks
waf-cost-070.tf.aws.cloudwatch-retention-not-infinite
Prüft: CloudWatch Log Groups dürfen keine infinite Retention haben (retention_in_days = 0 oder nicht gesetzt).
| Compliant | Non-Compliant |
|---|---|
|
|
waf-cost-070.tf.aws.cloudwatch-operational-retention-max-365
Prüft: Operational Log Groups sollten retention_in_days ⇐ 365 haben.
# Für Compliance-Logs > 365 Tage: S3-Export verwenden
resource "aws_cloudwatch_log_subscription_filter" "compliance_export" {
name = "compliance-logs-to-s3"
log_group_name = aws_cloudwatch_log_group.compliance.name
filter_pattern = ""
destination_arn = aws_kinesis_firehose_delivery_stream.s3_archive.arn
}
# CloudWatch: kurze Retention für Zugriff
resource "aws_cloudwatch_log_group" "compliance" {
name = "/app/production/compliance"
retention_in_days = 90 # In CloudWatch; Export nach S3 für 7 Jahre
}
Evidenz
| Typ | Pflicht | Beschreibung |
|---|---|---|
IaC |
✅ Pflicht |
Terraform Log-Group-Konfigurationen mit expliziten |
Governance |
✅ Pflicht |
Retention-Strategie-Dokument mit Log-Tier-Definitionen und Retention-Perioden je Log-Typ. |
Config |
Optional |
Trace-Sampling-Konfiguration für APM-Tools. |
Process |
Optional |
Monatlicher Observability-Kostenanteil am Gesamtbudget (Ziel: < 20%). |
Regulatorisches Mapping
| Framework | Controls |
|---|---|
ISO 27001:2022 |
A.5.36 – Compliance with policies, rules and standards; A.8.1.1 – Access control strategy; A.8.10 – Information deletion; A.8.24 – Use of cryptography |
ISO 20000-1:2018 |
9.4.1 – Configuration management; 9.4.2 – Configuration records; 10.2.2 – Financial management; 10.2.4 – Budgeting and accounting |
BSI C5:2020 |
COM-01 – Network and service security; COM-02 – Cloud monitoring; GOV-01 – Governance, risk and compliance |
AWS Well-Architected Framework |
Cost Optimization Pillar – Cost allocation tagging; Financial Security – Budgeting and forecasting |
Azure Well-Architected Framework |
Cost management – Tagging; Governance – Resource governance; Cost optimization – Cost allocation |
Google Cloud Architecture Framework |
Organization and folders – Tagging; Billing – Cost allocation; Resource management – Resource hierarchy |
FinOps Foundation |
Core Module – Tagging standards; Management Layer – Cost attribution; Open Module – Financial accountability |
GDPR |
Art. 28 – Processor obligations; Art. 32 – Security of processing (cost of security measures) |
CSRD |
ESRS G1 – Governance – Disclosure of information; ESRS M1 – Materiality – Disclosure of information |
NIST CSF 2.0 |
GV.PO – Policy; FR.AN – Analysis; RP.RP – Recovery planning |
CIS Controls v8 |
CIS 2 – Inventory and Control of Software Assets; CIS 2.1 – Software inventory; CIS 2.2 – Hardware inventory |
TISAX |
Information security – Resource management |
ANSSI SecNumCloud |
Domain – Financial management; Domain – Resource management |
BIO |
BIO – Financieel beheer |
ENS High |
org.2 – Control de gestión; op.exp.1 – Gestión de incidentes |
UK NCSC CAF |
A2 – Financial management; A3 – Resource management |
CMMC 2.0 |
AC.L2-3.1.1 – Access control policy |
IRAP |
ISM – Financial management |
CCCS PBMM |
CM-6 – Configuration management |
MAS TRM |
Ch.6 – Financial management |
ISMAP |
Resource management and cost control |
FISC |
Operational measures – Financial management |