Sicherheit ist nicht separat. Es ist ein Signal.
Security-Events und Anomalien werden wie andere Observability-Signale behandelt: Log-EintrΓ€ge, Metriken und Traces. Anomalien automatisch erkannt.
detect_anomaliesscan_vulnerabilitiesaudit_rbac
Das SecOps-Problem: Silos zwischen Ops und Security
Typische Setups haben:
- Ops Team: Prometheus, Grafana, Loki (Logs, Metriken, kein Security-Fokus)
- Security Team: Falco, AppArmor, SELinux, Vault (Separate Tools, Separate Alerts)
- Resultat: Zwei Teams, zwei Toolchains, zwei UIs, keine Cross-Visibility
Ein Security-Event passiert: Falco wirft Alert, Ops-Team sieht es nicht (liegt in anderem Tool). Trotzdem: API-Latency steigt, Ops debuggt das Netzwerk statt Intrusion.
KI-Ops integriert Security als erstklassiges Observability-Signal.
Security Signals in der Ops Stack
1. RBAC & Access Auditing
$ ki-ops audit-rbac --namespace production
Auditing Role-Based Access Control...
π΄ ANOMALIES DETECTED:
1. ServiceAccount: deployment-automation (ns: ci-cd)
Trend Analysis:
ββ Today: 45 API calls
ββ Last 7 Days: avg 8 calls
ββ Spike Factor: 5.6x higher than normal
ββ NEW PERMISSION GRANT: cluster-admin (granted 3 minutes ago)
β οΈ Risk Assessment:
High: ServiceAccount escalated to cluster-admin
Timing: Right before unusual activity surge
Investigation:
$ kubectl logs -n ci-cd deploy/deployment-automation --tail=100
(Check ob legitim oder kompromittiert)
2. User: alice@company.com
Action: read secrets in production
Trend:
ββ Never before accessed Secrets
ββ 23 Secret reads in last 30 minutes
ββ Time: 02:47 UTC (unusual hour)
ββ Source IP: 203.0.113.45 (new IP, nicht ΓΌblich)
β οΈ Risk: Potential Credential Theft
Alerts:
ββ Check if alice is on-call
ββ Verify Laptop VPN ist aktiv
ββ Review welche Secrets gelesen wurden
ββ Consider: Rotate affected Secrets if suspicious
3. Automation: ImagePullSecret Updated
Event:
ββ Secret: "gcr-secret" (ns: default)
ββ Action: username changed
ββ Changed By: kubernetes.io/system:admin
ββ Timestamp: 2024-03-04 14:23:45
ββ Previous: "serviceaccount@company.iam.gserviceaccount.com"
ββ Current: "automated-backup@different-org.iam.gserviceaccount.com"
β οΈ Critical: Service Account in Secret hat sich geΓ€ndert
Fragen:
ββ Wer authorisiert das?
ββ Welche Pods nutzen dieses Secret?
ββ Hat jemand die Zugriffsberechtigung verloren?
$ kubectl get pods -A -o jsonpath='{..imagePullSecrets[*].name}' | grep gcr-secret
(Alle betroffenen Pods finden)
2. Runtime Behavior Anomalies
$ ki-ops detect-anomalies --security --lookback 7d
Detecting behavioral anomalies...
BEHAVIORAL ANOMALIES (Machine Learning basiert):
1. Pod: api-service-xy81f (ns: production)
Anomaly: Outbound Connection Pattern verΓ€ndert
ββ Normal Behavior:
β ββ Connect to: postgres (10.0.1.5:5432) - tΓ€glich
β ββ Connect to: redis (10.0.2.10:6379) - tΓ€glich
β ββ Connect to: dns (10.96.0.10:53) - kontinuierlich
β
ββ NEW Behavior (seit 45 min):
β ββ Connect to: 185.220.100.45:443 (Tor Exit Node!)
β ββ Frequency: 234 connections/min
β ββ Data Transfer: 450MB in 45 min
β
ββ Risk Level: CRITICAL
ββ Dieser Pod sollte nicht nach auΓen connecten
ββ TOR-Nutzung ist stark verdΓ€chtig
ββ MΓΆgliche Ursachen: Malware, Kompromittierung, Crypto-Miner
Immediate Actions:
$ kubectl set image deploy/api-service api-service=previous-good-image
$ kubectl exec -it api-service-xy81f -- bash
# Inside Pod: whoami? Welche Prozesse laufen?
# ps aux | grep -E 'curl|wget|nc|perl|python'
2. Process Behavior Anomaly
Container: postgres-backup (ns: databases)
ββ Normal: LΓ€uft tΓ€glich 01:00-02:30 UTC, CPU 15%, Memory 800MB
ββ Anomaly: LΓ€uft jetzt 13:47 UTC (!), CPU 95%, Memory 4.5GB
β ββ Process Tree: bash β dd β /dev/zero (?)
β ββ File Access: /var/lib/postgresql (unusual read pattern)
β ββ System Calls: 2345 getuid() calls (why so many privilege checks?)
β
ββ Assessment:
ββ Scheduled Job lauft zur unerwarteten Zeit
ββ Resource-Verbrauch 30x hΓΆher als normal
ββ Verdacht: Job-Controller Bug, fehlgeschlagene Cleanup, oder Malicious Cron
Debug:
$ kubectl logs postgres-backup -n databases --timestamps
$ kubectl describe pod postgres-backup -n databases
3. Vulnerability Scanning Integration
$ ki-ops scan-vulnerabilities --cluster
Scanning images and dependencies...
π΄ VULNERABILITIES FOUND:
1. Image: api-service:v2.3.1
Base OS: ubuntu:20.04
Vulnerabilities:
ββ CVE-2024-1234: OpenSSL Integer Overflow (CRITICAL)
β ββ CVSS Score: 9.8 (Very High)
β ββ Affected: libssl1.1 (2.3.0)
β ββ Fixed In: libssl1.1 (2.3.2)
β ββ Pods Using: api-service-1, api-service-2, ... (47 pods)
β
ββ CVE-2024-5678: XSS in express.js (HIGH)
β ββ CVSS Score: 7.2
β ββ Affected: express (4.18.1)
β ββ Fixed In: express (4.19.0)
β ββ Action: Update package.json, rebuild image
β
ββ CVE-2023-9999: Path Traversal in fs library (MEDIUM)
2. Deployed Image: worker-job:v1.2.0
Identified: 12 known CVEs, 3 CRITICAL
Last Updated: 2021-03-15 (!!!)
ββ Image ist 3 Jahre alt
ββ Wahrscheinlich 100+ neue Vulns bekannt
ββ Status: Should retire or rebuild immediately
3. Kubernetes RBAC Risk
ClusterRole: "edit"
ββ Users: developer@company.com, automation-bot
ββ Permissions: Zu viele (create pods, delete services, etc.)
ββ Recommendation: Least privilege RBAC policy
β Create role "deployment-editor" mit nur deploy/service Rechten
4. Network Policy Gaps
Namespace: production
ββ No NetworkPolicies defined (!!)
ββ All pods can communicate with all pods
ββ All pods can communicate with external internet
ββ Risk: Lateral movement, data exfiltration nicht verhindert
Fix:
$ kubectl apply -f - <<EOF
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny-all
namespace: production
spec:
podSelector: {}
policyTypes:
- Ingress
- Egress
EOF
Anomaly Detection: Wie es funktioniert
KI-Ops verwendet Machine Learning (nicht Rules):
Phase 1: LEARNING (erste 7 Tage)
ββ Sammelt Baseline-Behavior fΓΌr alle Pods
ββ Metriken: CPU, Memory, Network I/O, Prozesse, Connections
ββ Baseline: P50, P95, P99 Latenz, Throughput, Error Rates
ββ Builds Statistical Model pro Workload
Phase 2: DETECTION (kontinuierlich)
ββ Vergleicht aktuelle Signale gegen Baseline
ββ Erkennt Anomalien wenn Abweichung > 3 Standardabweichungen
ββ Filterung: False Positives durch seasonality model
β (z.B.: Jeden Montag hΓΆherer Traffic ist NORMAL, kein Alert)
ββ Human-in-the-Loop: Security Team kann Models fine-tunen
Phase 3: CORRELATION
ββ Mehrere Anomalien gleichzeitig?
β Wahrscheinlich ein Root Cause
β Cluster zusammenhΓ€ngende Events
ββ Single anomaly -> Low severity
Multiple correlated -> High severity
Use Cases in der Praxis
Szenario 1: Crypto-Mining Malware
1. Pod startet unerwartete Prozesse
β eBPF erkennt: bash β gcc β make (???)
β abnormal: Dieser Pod sollte nicht compilieren
2. CPU-Auslastung steigt von 10% auf 98%
β Metric Anomaly erkannt
3. Network Connection zu Mining Pool
β eBPF zeigt: tcp:185.220.100.45:443
β Behavior Anomaly: Pod connectet sich nicht normal
4. KI-Ops Alert:
"Possible Crypto-Mining in api-service-xy81f
ββ Correlation Score: 98% (sicher)
ββ Recommendation: Kill pod immediately
ββ Follow-up: Rebuild image, audit code"
Szenario 2: Credentials Leak
1. New Secret created by user "alice"
β Access audit log zeigt: alice created "aws-secret"
β Nicht ΓΌblich: alice ist Application Developer, nicht DevOps
2. Secret Daten leaked zu external service
β eBPF zeigt: pod exfiltrates SECRET_VALUE zu external IP
β Behavior Anomaly: nie vorher gesehen
3. KI-Ops Alert:
"Possible Credential Leak Detected
ββ Secret 'aws-secret' accessed 45 times in 10 min
ββ Exfiltrated to: 203.0.113.99:443
ββ Severity: CRITICAL
ββ Actions:
a) Rotate AWS Credentials (do now!)
b) Kill affected pods
c) Review CloudTrail fΓΌr unauthorized API calls"
Security + Ops Integration
# KI-Ops Config: Security Events in Alerting einbeziehen
observability:
security:
enabled: true
sources:
- falco # Runtime Security
- rbac-audit # Kubernetes Audit Logs
- vulnerability # Image Scanning
- network # eBPF Network Flows
alerting:
rules:
- name: "Critical Security Anomaly"
condition: "security_risk_score > 8"
notify: ["#security-oncall", "devops@company.com"]
- name: "Image Vulnerability"
condition: "vulnerability.cvss_score > 7.0 AND deployed_pod_count > 0"
notify: ["#platform-eng"]
Was Sie mit Security Observability gewinnen
- Holistic View: Security + Performance + Reliability in einer Plattform
- Faster Detection: Anomalien werden erkannt bevor Damage auftritt
- Context: Warum ist Pod suspekt? Weil: neue Behavior + falsche RBAC + alte Image
- Automated Response: KI-Ops kann auto-kill suspicious pods, rotate secrets, block IPs
- Compliance: VollstΓ€ndiger Audit Trail fΓΌr alle Security-relevanten Events
- Team Alignment: Ops und Security sprechen die gleiche Sprache (Signals, not silos)
Start: ki-ops detect-anomalies --security um sofort Behavioral-Anomalien zu sehen.
Jetzt ausprobieren
Starte mit dem Free-Tier und analysiere deinen Cluster in unter 5 Minuten.
Kostenlos starten