|
| 1 | +# Trustee Key Broker Service (KBS) |
| 2 | +# The main entry point for confidential workloads to retrieve secrets |
| 3 | +# |
| 4 | +# KBS implements the RCAR protocol (Request-Challenge-Attestation-Response) |
| 5 | +# and acts as the "Relying Party" in the RATS architecture. |
| 6 | +# It depends on AS for attestation verification. |
| 7 | + |
| 8 | +[Unit] |
| 9 | +Description=Trustee Key Broker Service |
| 10 | +Documentation=https://docs.redhat.com/en/documentation/openshift_sandboxed_containers/1.10/html/deploying_trustee/ |
| 11 | + |
| 12 | +# Start after AS is available (which implies RVPS is also ready) |
| 13 | +After=network-online.target trustee-as.service |
| 14 | +Wants=network-online.target |
| 15 | +Requires=trustee-as.service |
| 16 | + |
| 17 | +[Container] |
| 18 | +# Container image - uses Red Hat registry |
| 19 | +# For development/testing, override with: Image=quay.io/confidential-containers/kbs:latest |
| 20 | +Image=quay.io/linux-system-roles/trustee-kbs:0.15.0 |
| 21 | +Pod=trustee.pod |
| 22 | + |
| 23 | +# Container name for DNS resolution |
| 24 | +ContainerName=trustee-kbs |
| 25 | + |
| 26 | +# Configuration mount (read-only) |
| 27 | +Volume=/etc/trustee/kbs:/etc/kbs:ro,Z |
| 28 | + |
| 29 | +# Data persistence for resources/secrets |
| 30 | +Volume=kbs-data.volume:/var/lib/kbs:Z |
| 31 | + |
| 32 | +# Environment variables |
| 33 | +Environment=RUST_LOG=info |
| 34 | +Environment=KBS_CONFIG_FILE=/etc/kbs/config.toml |
| 35 | + |
| 36 | +# Optional: set the policy path (can also be set in config.toml) |
| 37 | +Environment=KBS_POLICY_PATH=/etc/kbs/policy.rego |
| 38 | + |
| 39 | +# Security hardening |
| 40 | +NoNewPrivileges=true |
| 41 | + |
| 42 | +# Drop all capabilities |
| 43 | +DropCapability=ALL |
| 44 | + |
| 45 | +# If binding to port < 1024, uncomment: |
| 46 | +# AddCapability=CAP_NET_BIND_SERVICE |
| 47 | + |
| 48 | +# Health check - HTTP endpoint |
| 49 | +HealthCmd=curl -sk https://localhost:8080/ || exit 1 |
| 50 | +HealthInterval=30s |
| 51 | +HealthTimeout=10s |
| 52 | +HealthRetries=3 |
| 53 | +HealthStartPeriod=20s |
| 54 | + |
| 55 | +# Resource limits (adjust based on workload) |
| 56 | +# Memory=512M |
| 57 | + |
| 58 | +# Enable auto-update from registry (optional) |
| 59 | +# AutoUpdate=registry |
| 60 | + |
| 61 | +[Service] |
| 62 | +# Restart policy |
| 63 | +Restart=on-failure |
| 64 | +RestartSec=10s |
| 65 | + |
| 66 | +# Startup/shutdown timeouts |
| 67 | +TimeoutStartSec=120s |
| 68 | +TimeoutStopSec=30s |
| 69 | + |
| 70 | +# Logging |
| 71 | +StandardOutput=journal |
| 72 | +StandardError=journal |
| 73 | +SyslogIdentifier=trustee-kbs |
| 74 | + |
| 75 | +[Install] |
| 76 | +# This is the main service users will enable/start |
| 77 | +WantedBy=multi-user.target default.target |
0 commit comments