CI/CD Security
GitHub Actions auf Bare Metal 2026
Sichere Self-Hosted Runner auf eigenen Servern: Installation, Isolation, Secrets-Management und Canary Deployments für Enterprise-CI/CD.
✓
ClawGuru Verified. Basierend auf GitHub Security Best Practices, OWASP CI/CD Top 10, und Bare Metal Hardening Guidelines.
Warum Self-Hosted Runner auf Bare Metal?
GitHub Actions Self-Hosted Runner auf Bare Metal bieten maximale Kontrolle, Performance und Compliance-Flexibilität. Ideal für regulated Industries, air-gapped Umgebungen oder spezifische Hardware-Requirements.
Performance
Dedizierte CPU/Ressourcen, keine Noisy-Neighbors
Compliance
Data Residency, Air-Gapped, Custom Encryption
Kosten
Bei hoher Utilization günstiger als GitHub-hosted
Installation & Hardening
1. Runner Installation
# GitHub Actions Runner auf Bare Metal installieren # Download und Setup mkdir -p /opt/github-runner && cd /opt/github-runner curl -o actions-runner-linux-x64-2.319.0.tar.gz \ -L https://github.com/actions/runner/releases/download/v2.319.0/... # Entpacken und konfigurieren tar xzf actions-runner-linux-x64-2.319.0.tar.gz ./config.sh --url https://github.com/ORG/REPO \ --token TOKEN --name "bare-metal-runner-01" \ --labels "bare-metal,production,self-hosted" # Als Service registrieren (systemd) sudo ./svc.sh install sudo ./svc.sh start
2. Container-Isolation mit Docker
# Docker-in-Docker (DinD) für Job-Isolation
# /etc/docker/daemon.json
{
"userns-remap": "runner",
"live-restore": true,
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "3"
},
"seccomp-profile": "/etc/docker/seccomp-default.json"
}
# Runner mit eingeschränkten Privilegien
--docker-userns-remap runner
--disable-update3. Netzwerk-Isolation & Firewall
- • Ausgehende Verbindungen auf notwendige Ports beschränken (443, 22)
- • VLAN-Segmentierung für CI/CD-Netzwerk
- • Egress-Filtering für Secrets-Exfiltration Prevention
- • Proxy für alle externen Requests erzwingen
Secrets & OIDC Configuration
OIDC für Secrets-less Authentication
# GitHub Actions Workflow mit OIDC
# .github/workflows/deploy.yml
jobs:
deploy:
runs-on: [self-hosted, bare-metal]
permissions:
id-token: write # OIDC Token
contents: read
steps:
- uses: actions/checkout@v4
# AWS OIDC Auth (keine Long-Lived Secrets!)
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::ACCOUNT:role/GithubActionsRole
aws-region: eu-central-1
# Azure OIDC
- name: Azure Login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}Best Practice: OIDC eliminiert die Notwendigkeit für long-lived Access Keys. Tokens sind nur 5 Minuten gültig.
Canary & Blue-Green Deployments
- • Argo Rollouts: Progressive Delivery mit automatischer Promotion
- • Flagger: Canary-Deployments mit Prometheus-Metriken
- • Health Probes: Readiness/Liveness vor Traffic-Shift
- • Auto-Rollback: Bei Error-Rate > 1% oder Latenz-Spikes
Security Checklist
- ☑Runner in isolierter Netzwerk-Segmentierung
- ☑OIDC statt Long-Lived Secrets verwendet
- ☑Container-Isolation mit User Namespaces
- ☑Audit-Logging für alle Deployments aktiv
- ☑Automatisches Runner-Updates deaktiviert (manuelles Review)
- ☑Ephemeral Runner (Einweg-VMs für sensitive Jobs)