"Not a Pentest" Trust-Anker: Dieser Guide dient ausschließlich zur Absicherung von Container-Infrastrukturen. Keine Angriffswerkzeuge, keine illegalen Aktivitäten.
Was ist Container Security für Docker und Kubernetes?
Container Security umfasst Dockerfile Hardening, Kubernetes Network Policies, RBAC, Pod Security Standards und Runtime Protection mit Falco. Es schützt Container-Workloads vor Escape-Angriffen und unautorisiertem Zugriff durch mehrschichtige Sicherheitskontrollen.
70% aller Docker-Container laufen als root – ein kritisches Sicherheitsrisiko.
Moltbot Container Security: Docker & Kubernetes
Umfassende Container Security für Moltbot — von gehärteten Dockerfiles über Kubernetes Network Policies bis hin zu Runtime Protection mit Falco.
🐳 Gehärtetes Dockerfile
# Moltbot Production Dockerfile (gehärtet) FROM node:20-alpine AS builder WORKDIR /app COPY package*.json ./ RUN npm ci --only=production && npm cache clean --force COPY . . RUN npm run build FROM node:20-alpine AS runner # Security: Non-root user RUN addgroup -g 1001 -S moltbot && adduser -S moltbot -u 1001 -G moltbot WORKDIR /app # Security: Read-only filesystem COPY --chown=moltbot:moltbot --from=builder /app/.next/standalone ./ COPY --chown=moltbot:moltbot --from=builder /app/public ./public USER moltbot EXPOSE 3000 ENV NODE_ENV=production PORT=3000 # Security: No privileged operations CMD ["node", "server.js"]
☸️ Kubernetes Network Policy
# moltbot-network-policy.yaml
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: moltbot-netpol
namespace: production
spec:
podSelector:
matchLabels:
app: moltbot
policyTypes:
- Ingress
- Egress
ingress:
- from:
- podSelector:
matchLabels:
role: ingress-controller
ports:
- protocol: TCP
port: 3000
egress:
- to:
- podSelector:
matchLabels:
app: postgres
ports:
- protocol: TCP
port: 5432
- to:
- namespaceSelector:
matchLabels:
name: kube-system
ports:
- protocol: UDP
port: 53 # DNS🛡️ Pod Security Standards
# moltbot-deployment.yaml (security context)
apiVersion: apps/v1
kind: Deployment
metadata:
name: moltbot
spec:
template:
spec:
securityContext:
runAsNonRoot: true
runAsUser: 1001
fsGroup: 1001
seccompProfile:
type: RuntimeDefault
containers:
- name: moltbot
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]
resources:
limits:
cpu: "500m"
memory: "512Mi"
requests:
cpu: "100m"
memory: "128Mi"