Bootstrap Certificate Management
Overview
This guide covers operational procedures for managing bootstrap certificates used by platform services (cluster-sensor-service and device-interrogation-service) for mTLS authentication.
Certificate Generation
Initial Setup
Generate the platform bootstrap CA (one-time operation):
./scripts/generate-bootstrap-ca.sh
This creates:
- Platform bootstrap CA certificate and encrypted private key (stored in database)
- CA certificate available for service configuration
Generate Service Certificates
Generate bootstrap certificates for platform services:
./scripts/generate-bootstrap-certificates.sh
This creates certificates for:
cluster-sensor-servicedevice-interrogation-service
Certificates are stored in:
- Database:
platform_bootstrap_certificatestable - Filesystem:
./bootstrap-certs/directory
Certificate Files
After generation, the following files are created:
bootstrap-certs/
├── cluster-sensor-service-cert.pem
├── cluster-sensor-service-key.pem
├── device-interrogation-service-cert.pem
├── device-interrogation-service-key.pem
└── bootstrap-ca-cert.pem
Deployment
Development Environment
Certificates are automatically generated by session-init.sh:
- Bootstrap CA is created if it doesn't exist
- Bootstrap certificates are generated for services
- Certificates are mounted into containers via docker-compose.yml
Production Environment
Generate Certificates:
./scripts/generate-bootstrap-ca.sh ./scripts/generate-bootstrap-certificates.shStore Certificates Securely:
- Use secrets manager (AWS Secrets Manager, HashiCorp Vault)
- Store in encrypted storage
- Never commit to version control
Mount Certificates:
- Update docker-compose.prod.yml with certificate volume mounts
- Ensure certificates are available at container startup
Set Permissions:
chmod 755 bootstrap-certs chmod 600 bootstrap-certs/*.pem
Kubernetes (Helm chart) Environment
The chart does not yet ship a built-in bootstrapCerts Secret/mount feature. If
the bootstrap cert isn't mounted into the cluster-sensor-service pod, the service
detects this at startup, logs an informational message, and skips auto-registration
silently — it does not crash. Tenants in this state must be registered manually
through the Tenant Admin UI's sensor-onboarding flow.
If you want auto-registration on K8s, provide the certs to the pod via a customer-owned overlay:
- Create a Kubernetes Secret in the release namespace containing the four PEM
files at
/app/bootstrap-certs/:kubectl -n <release-ns> create secret generic cluster-sensor-bootstrap --from-file=cluster-sensor-service-cert.pem --from-file=cluster-sensor-service-key.pem --from-file=bootstrap-ca-cert.pem - In your
values-customer.yaml, attach the Secret to the service viaextraVolumes/extraVolumeMountsonbackends.cluster-sensor-service(read-only, mode 0600). Use a stricterdefaultMode(e.g.0400) for long-lived environments. - Re-deploy. The startup log should now read
🔄 Registering platform discovery sensor for all tenants...instead ofℹ️ Bootstrap cert not present...; skipping auto-registration.
A native chart-level setting for this is tracked as a follow-up.
Certificate Rotation
When to Rotate
- Before expiration (bootstrap certs expire in 90 days)
- After security incident
- During scheduled maintenance
Rotation Procedure
Generate New Certificates:
./scripts/generate-bootstrap-certificates.shUpdate Certificate Files:
- Replace old certificate files in
./bootstrap-certs/ - Update secrets manager if used
- Replace old certificate files in
Restart Services:
docker compose restart cluster-sensor-service device-interrogation-serviceVerify Registration:
- Check service logs for successful registration
- Verify services are using new certificates
CA Rotation
If the platform bootstrap CA needs to be rotated:
Generate New CA:
# This will mark old CA as inactive and create new one go run scripts/initialize-bootstrap-ca.go -db-url "$DATABASE_URL" -encryption-key "$ENCRYPTION_MASTER_KEY" -action rotate-caRegenerate All Certificates:
./scripts/generate-bootstrap-certificates.shUpdate Services:
- Restart all platform services
- Verify new certificates work
Certificate Revocation
Revoke Compromised Certificate
If a bootstrap certificate is compromised:
# Using Go program
go run scripts/initialize-bootstrap-ca.go
-db-url "$DATABASE_URL"
-encryption-key "$ENCRYPTION_MASTER_KEY"
-action revoke-cert
-service-name "cluster-sensor-service"
-reason "compromised"
Or directly in database:
UPDATE platform_bootstrap_certificates
SET revoked_at = NOW(),
revocation_reason = 'compromised'
WHERE service_name = 'cluster-sensor-service';
After Revocation
Generate New Certificate:
./scripts/generate-bootstrap-certificates.shUpdate Certificate Files:
- Replace revoked certificate
- Restart affected service
Verify:
- Check service can register with new certificate
- Verify old certificate is rejected
Monitoring
Certificate Expiration Monitoring
Check certificate expiration dates:
SELECT service_name, expires_at,
expires_at - NOW() as days_until_expiration
FROM platform_bootstrap_certificates
WHERE revoked_at IS NULL
ORDER BY expires_at;
Alert on Expiration
Set up alerts for certificates expiring within 30 days:
SELECT service_name, expires_at
FROM platform_bootstrap_certificates
WHERE revoked_at IS NULL
AND expires_at < NOW() + INTERVAL '30 days';
Troubleshooting
Certificate Not Found
Symptoms: Service fails to start, certificate file not found
Solutions:
- Verify certificate files exist in
./bootstrap-certs/ - Check volume mount in docker-compose.yml
- Regenerate certificates if missing
- Verify file permissions
Certificate Validation Fails
Symptoms: Service registration fails with certificate validation error
Solutions:
- Verify certificate is signed by platform bootstrap CA
- Check certificate expiration date
- Verify certificate is not revoked
- Check CA certificate matches database
Service Cannot Register
Symptoms: Auto-registration endpoint returns 401 Unauthorized
Solutions:
- Verify bootstrap certificate is valid
- Check service name in certificate CN
- Verify sensor-manager can access bootstrap CA
- Check encryption key is correct
Security Best Practices
Certificate Storage:
- Store certificates securely (secrets manager in production)
- Use restricted file permissions (600 for keys, 644 for certs)
- Never commit certificates to version control
Certificate Rotation:
- Rotate before expiration
- Rotate after security incidents
- Document rotation procedures
Access Control:
- Limit access to certificate generation scripts
- Restrict database access to bootstrap CA tables
- Monitor certificate operations
Audit:
- Log certificate generation events
- Track certificate usage
- Monitor for suspicious activity
Related Documentation
- Certificate Management – General certificate management