implementing-gcp-binary-authorization

Configure GCP Binary Authorization policies and attestors to enforce attested container deployments on GKE and Cloud Run.

954|172|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/xalgord/xalgorix --skill implementing-gcp-binary-authorization
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: implementing-gcp-binary-authorization
Source: https://github.com/xalgord/xalgorix/tree/main/internal/tools/skills/data/cloud-security/implementing-gcp-binary-authorization
Command: npx skills add https://github.com/xalgord/xalgorix --skill implementing-gcp-binary-authorization

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Teams deploying containers to GKE or Cloud Run risk running untrusted or unscanned images. This Skill guides the implementation of GCP Binary Authorization so only cryptographically attested container images are admitted at deploy time, closing supply-chain gaps.

Core Features & Use Cases

  • Policy Configuration: Create default-deny and per-cluster admission policies with REQUIRE_ATTESTATION enforcement modes and scoped whitelist patterns.
  • Attestor Setup: Provision KMS signing keys, Container Analysis notes, and attestors, then sign image attestations after builds.
  • CI/CD Integration: Wire attestation creation into Cloud Build pipelines after vulnerability scans, plus continuous validation monitoring and break-glass procedures.
  • Use Case: A platform team hardens a production GKE cluster by requiring attestations from a Cloud Build pipeline, verifying that an unattested nginx image is blocked, and alerting on break-glass overrides.

Quick Start

Help me implement GCP Binary Authorization on my GKE cluster so only attested container images from my Cloud Build pipeline can be deployed.

Frequently Asked Questions about implementing-gcp-binary-authorization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enable Binary Authorization on a GKE cluster?

Enable the binaryauthorization, containeranalysis, and container APIs with gcloud services enable, then run gcloud container clusters update with the --enable-binauthz flag. The cluster will then evaluate deployments against the imported Binary Authorization policy.

How do I create a Binary Authorization attestor with KMS?

Create a KMS keyring and an asymmetric signing key, create a Container Analysis note, then run gcloud container binauthz attestors create referencing that note. Finally, add the KMS public key version to the attestor so attestations can be verified.

Why is my Binary Authorization policy not blocking unattested images?

Common causes are enforcementMode set to DRYRUN_AUDIT_LOG_ONLY, evaluationMode set to ALWAYS_ALLOW, or overly broad admissionWhitelistPatterns. Export the policy and verify it uses ENFORCED_BLOCK_AND_AUDIT_LOG with REQUIRE_ATTESTATION, and confirm the cluster has binauthz enabled.

Does Binary Authorization work with Cloud Run?

Yes, Binary Authorization supports both GKE and Cloud Run as deploy-time enforcement targets. The same policy model with attestors and admission rules applies, ensuring only attested images are deployed to either platform.

How do I bypass Binary Authorization in an emergency?

Use the break-glass mechanism by labeling the pod with image-policy.k8s.io/break-glass set to true and annotating the reason. You should configure log-based alerts on break-glass usage so the bypass does not become a silent enforcement gap.