Skip to main content

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?

Threat: Attacker pushes malicious image to registryProtection: Only images signed by your CI/CD can deployExample blocked scenarios:
  • Directly pushed images (bypassing CI/CD)
  • Images from unknown registries
  • Tampered images (signature verification fails)
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
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)
Scenario: Compromised CI/CD pipelineResponse: Revoke KMS key, all signed images instantly blockedRecovery: Create new KMS key, re-sign trusted images

Architecture

Flow:
  1. CI/CD builds and tests image
  2. Push image to Artifact Registry
  3. Sign image digest with KMS key
  4. Create attestation (proof of signature)
  5. On deployment, GKE checks attestation
  6. If valid → Deploy; If invalid → Block

Quick Setup (20 minutes)

1

Enable APIs

2

Run Setup Script

What it creates:
  • KMS key ring and signing key
  • Container Analysis note
  • Attestor resource
  • Binary Authorization policy
3

Enable on GKE Cluster

terraform/environments/gcp-prod/terraform.tfvars
4

Sign First Image

Creates attestation for the image.
5

Verify Policy


Policy Configuration

Policy Modes

Behavior: Blocks unsigned imagesUse case: Production environmentsRisk: Zero tolerance for unsigned images

Environment-Specific Policies


Image Signing in CI/CD

GitHub Actions Integration


Verification & Troubleshooting

Check Policy Status

View Denials in Logs

Common Issues

Symptom: Deployment blocked with “image not attested by projects/PROJECT/attestors/production-attestor”Cause: Image hasn’t been signed by CI/CDSolution:
Symptom: “attestor not found: projects/PROJECT/attestors/production-attestor”Cause: Attestor resource not createdSolution:
Symptom: System pods (kube-proxy, node-exporter) failing to startCause: Missing admission whitelist patternsSolution: Add to policy:
Symptom: CI/CD can’t sign images - “Permission denied on KMS key”Solution:

Security Best Practices

Separate keys per environment
Benefit: Key compromise doesn’t affect all environments
Rotate KMS keys regularly
Enable KMS key rotation policy
Audit attestations regularly
Principle of least privilege

Compliance & Auditing

SOC 2 / HIPAA Requirements

  • 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)

No enforcement, just logging.
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)

Monitor denials, fix any unsigned images.
4

4. Enable Enforcing (Production)

Only after:
  • All images signed
  • No denials in staging for 2 weeks
  • Rollback plan tested

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