Overview
Binary Authorization is a deploy-time security control that ensures only trusted container images run on GKE. Images must be cryptographically signed and verified before deployment, preventing supply chain attacks and unauthorized images.Image Signing
CI/CD signs images with KMS keys
Policy Enforcement
GKE blocks unsigned images
Attestations
Proof of CI/CD approval
Audit Trail
All denials logged to Cloud Logging
Why Binary Authorization?
Supply Chain Security
Supply Chain Security
Compliance: SLSA Level 3, SOC 2, HIPAARequirement: Prove images were built by authorized systemsBinary Auth provides:
- Cryptographic proof of build provenance
- Attestations from CI/CD pipeline
- Immutable audit trail
Multi-Environment Control
Multi-Environment Control
Problem: Dev images shouldn’t reach productionSolution: Different attestors per environmentImplementation:
- Dev: Allow all (no signing)
- Staging: Require staging attestor (audit mode)
- Prod: Require prod attestor (enforcing mode)
Incident Response
Incident Response
Scenario: Compromised CI/CD pipelineResponse: Revoke KMS key, all signed images instantly blockedRecovery: Create new KMS key, re-sign trusted images
Architecture
Flow:- CI/CD builds and tests image
- Push image to Artifact Registry
- Sign image digest with KMS key
- Create attestation (proof of signature)
- On deployment, GKE checks attestation
- If valid → Deploy; If invalid → Block
Quick Setup (20 minutes)
1
Enable APIs
2
Run Setup Script
- KMS key ring and signing key
- Container Analysis note
- Attestor resource
- Binary Authorization policy
3
Enable on GKE Cluster
- Terraform
- gcloud CLI
terraform/environments/gcp-prod/terraform.tfvars
4
Sign First Image
5
Verify Policy
Policy Configuration
Policy Modes
- Enforcing (Production)
- Audit (Staging)
- Disabled (Development)
Environment-Specific Policies
Image Signing in CI/CD
GitHub Actions Integration
Verification & Troubleshooting
Check Policy Status
View Denials in Logs
Common Issues
Error: Image not attested
Error: Image not attested
Symptom: Deployment blocked with “image not attested by projects/PROJECT/attestors/production-attestor”Cause: Image hasn’t been signed by CI/CDSolution:
Error: Attestor not found
Error: Attestor not found
Symptom: “attestor not found: projects/PROJECT/attestors/production-attestor”Cause: Attestor resource not createdSolution:
GKE system images blocked
GKE system images blocked
Symptom: System pods (kube-proxy, node-exporter) failing to startCause: Missing admission whitelist patternsSolution: Add to policy:
KMS permission denied
KMS permission denied
Symptom: CI/CD can’t sign images - “Permission denied on KMS key”Solution:
Security Best Practices
Separate keys per environment
Rotate KMS keys regularly
Enable KMS key rotation policy
Audit attestations regularly
Principle of least privilege
Compliance & Auditing
SOC 2 / HIPAA Requirements
- Control Objectives Met
- Audit Evidence
-
✅ CC6.1: Logical access controls
- Only signed images can deploy
- Attestations prove CI/CD approval
-
✅ CC6.6: Logical access segregation
- Production attestor separate from dev/staging
- KMS keys isolated per environment
-
✅ CC7.2: System monitoring
- All denials logged to Cloud Logging
- Attestation creation audited
-
✅ CC8.1: Change management
- All deployments require signed images
- Git commit → CI/CD → Attestation chain
SLSA Level 3 Compliance
Binary Authorization helps achieve SLSA Level 3 (Supply Chain Levels for Software Artifacts):Migration Path
1
1. Enable in Audit Mode (Dev)
2
2. Test Signing in CI/CD
Add signing step to CI/CD, verify attestations created.Monitor for 1 week, ensure no failures.
3
3. Enable Audit Mode (Staging)
4
4. Enable Enforcing (Production)
- All images signed
- No denials in staging for 2 weeks
- Rollback plan tested
Related Documentation
GKE Production
Production deployment with Binary Auth enabled
Security Hardening
Complete 67-control security framework
GitOps (ArgoCD)
Automated deployments with image signing
CI/CD Pipeline
GitHub Actions with Binary Auth integration
Next Steps
1
Set Up Binary Authorization
2
Integrate with CI/CD
Add image signing step to GitHub Actions workflow
3
Enable on Cluster
4
Monitor Denials