0
0
GCPcloud~10 mins

Container supply chain security in GCP - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to enable Binary Authorization on a GKE cluster.

GCP
gcloud container clusters update my-cluster --enable-[1]
Drag options to blanks, or click blank then click option'
Alogging
Bautoscaling
Cbinary-authorization
Dmonitoring
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing Binary Authorization with autoscaling or monitoring features.
Using incorrect flag names.
2fill in blank
medium

Complete the command to create a new attestor for Binary Authorization.

GCP
gcloud container binauthz attestors create my-attestor --project=my-project --attestation-authority-note=[1]
Drag options to blanks, or click blank then click option'
Amy-note
Bmy-cluster
Cmy-image
Dmy-key
Attempts:
3 left
💡 Hint
Common Mistakes
Using cluster or image names instead of the note name.
Confusing keys with notes.
3fill in blank
hard

Fix the error in the policy binding to allow the attestor service account to attest images.

GCP
gcloud projects add-iam-policy-binding my-project --member='serviceAccount:[1]' --role='roles/containeranalysis.attestor'
Drag options to blanks, or click blank then click option'
Aattestor@my-project.iam.gserviceaccount.com
Bmy-attestor@my-project.iam.gserviceaccount.com
Cmy-cluster@my-project.iam.gserviceaccount.com
Dbinaryauth@my-project.iam.gserviceaccount.com
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect service account names.
Confusing roles or members.
4fill in blank
hard

Fill both blanks to define a policy that enforces attestation on images from a specific registry.

GCP
"apiVersion: binaryauthorization.googleapis.com/v1
kind: Policy
metadata:
  name: default
spec:
  admissionWhitelistPatterns:
  - namePattern: 'gcr.io/my-project/[1]'
  clusterAdmissionRules:
    my-cluster:
      evaluationMode: [2]
      enforcementMode: ENFORCED"
Drag options to blanks, or click blank then click option'
Amy-app
BALWAYS_ALLOW
CREQUIRE_ATTESTATION
DNEVER_ALLOW
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect evaluation modes like ALWAYS_ALLOW.
Wrong image path patterns.
5fill in blank
hard

Fill all three blanks to create a container analysis note with a public key for attestation verification.

GCP
gcloud container binauthz attestors create my-attestor \
  --project=my-project \
  --attestation-authority-note=[1] \
  --attestation-authority-note-project=my-project \
  --public-keys=ascii-armored-pgp-key=[2],id=[3]
Drag options to blanks, or click blank then click option'
Amy-note
B-----BEGIN PGP PUBLIC KEY BLOCK-----\n...
C1234567890abcdef
Dmy-key
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect key formats or missing the key ID.
Confusing note names with key names.