Ensure use of Binary Authorization

LOW

Description

Description:

Binary Authorization helps to protect supply-chain security by only allowing images with verifiable cryptographically signed metadata into the cluster.

Rationale:

Binary Authorization provides software supply-chain security for images that you deploy to GKE from Google Container Registry (GCR) or another container image registry.

Binary Authorization requires images to be signed by trusted authorities during the development process. These signatures are then validated at deployment time. By enforcing validation, you can gain tighter control over your container environment by ensuring only verified images are integrated into the build-and-release process.

Care must be taken when defining policy in order to prevent inadvertent denial of container image deployments. Depending on policy, attestations for existing container images running within the cluster may need to be created before those images are redeployed or pulled as part of the pod churn.

To prevent key system images from being denied deployment, consider the use of global policy evaluation mode, which uses a global policy provided by Google and exempts a list of Google-provided system images from further policy evaluation.

Remediation

Using Google Cloud Console

  1. Go to Binary Authorization by visiting https://console.cloud.google.com/security/binary-authorization
  2. Enable the Binary Authorization API (if disabled)
  3. Go to Kubernetes Engine by visiting https://console.cloud.google.com/kubernetes/list
  4. Select the Kubernetes cluster for which Binary Authorization is disabled
  5. Click EDIT
  6. Set 'Binary Authorization' to 'Enabled'
  7. Click SAVE
  8. Return to Binary Authorization at https://console.cloud.google.com/security/binary-authorization
  9. Set an appropriate policy for your cluster.

Using Command Line

Update the cluster to enable Binary Authorization:

gcloud container cluster update [CLUSTER_NAME]
--zone [COMPUTE-ZONE]
--enable-binauthz

Create a Binary Authorization Policy using the Binary Authorization Policy Reference (https://cloud.google.com/binary-authorization/docs/policy-yaml-reference) for guidance.

Import the policy file into Binary Authorization:

gcloud container binauthz policy import [YAML_POLICY]