Stay organized with collections
Save and categorize content based on your preferences.
This page shows you how to give Binary Authorization access to policies and container
images that exist in different Google Cloud projects than your current project.
For example, if you deploy images in your Google Kubernetes Engine (GKE) cluster
from an Artifact Registry or Container Registry (Deprecated)
repository that's owned by a different project, you'll need to give the
Binary Authorization service in your project access to the image metadata in
the source repository.
Terminology
This document uses the following terms:
Service agent: A Google Cloud-managed service account.
Binary Authorization uses a service agent to interact with your Google Cloud
resources, like GKE clusters.
Policy project: The Google Cloud project that contains your
Binary Authorization policy.
Cluster project: The Google Cloud project that contains your
GKE cluster.
Artifact project: The Google Cloud project that contains your
Artifact Registry or Container Registry (Deprecated)
repository.
Scenarios that require cross-project access
You must grant cross-project permissions in situations like the following:
Your policy project is different than your cluster project.
Your cluster project is different than your artifact project.
Before you begin
Sign in to your Google Cloud account. If you're new to
Google Cloud,
create an account to evaluate how our products perform in
real-world scenarios. New customers also get $300 in free credits to
run, test, and deploy workloads.
Grant the Binary Authorization service agent in the cluster project the
Binary Authorization Policy Evaluator
(roles/binaryauthorization.policyEvaluator)
role on the policy project.
POLICY_PROJECT_ID: the ID of the project that contains your policy.
CLUSTER_PROJECT_ID: the project ID of the cluster.
Cluster project different than the artifact project
Grant the Binary Authorization service agent in the cluster project the
Artifact Registry Reader
(roles/artifactregistry.reader) role on the artifact project.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eThis document guides users on granting Binary Authorization access across different Google Cloud projects for policies and container images.\u003c/p\u003e\n"],["\u003cp\u003eCross-project access is required when the policy project, cluster project, and artifact project are not the same.\u003c/p\u003e\n"],["\u003cp\u003eThe Binary Authorization service agent in the cluster project needs the \u003ccode\u003eroles/binaryauthorization.policyEvaluator\u003c/code\u003e role on the policy project.\u003c/p\u003e\n"],["\u003cp\u003eThe Binary Authorization service agent in the cluster project needs the \u003ccode\u003eroles/artifactregistry.reader\u003c/code\u003e role on the artifact project.\u003c/p\u003e\n"],["\u003cp\u003eIf using Container Registry, the \u003ccode\u003eroles/storage.objectViewer\u003c/code\u003e role can be used instead, but migrating to Artifact Registry is recommended because Container Registry is deprecated.\u003c/p\u003e\n"]]],[],null,["# Configure cross-project access in GKE\n\nThis page shows you how to give Binary Authorization access to policies and container\nimages that exist in different Google Cloud projects than your current project.\nFor example, if you deploy images in your Google Kubernetes Engine (GKE) cluster\nfrom an Artifact Registry or Container Registry ([Deprecated](/container-registry/docs/deprecations/container-registry-deprecation))\nrepository that's owned by a different project, you'll need to give the\nBinary Authorization service in your project access to the image metadata in\nthe source repository.\n\nTerminology\n-----------\n\nThis document uses the following terms:\n\n- **Service agent:**A Google Cloud-managed service account. Binary Authorization uses a service agent to interact with your Google Cloud resources, like GKE clusters.\n- **Policy project:**The Google Cloud project that contains your Binary Authorization policy.\n- **Cluster project:**The Google Cloud project that contains your GKE cluster.\n- **Artifact project:** The Google Cloud project that contains your Artifact Registry or Container Registry ([Deprecated](/container-registry/docs/deprecations/container-registry-deprecation)) repository.\n\nScenarios that require cross-project access\n-------------------------------------------\n\nYou must grant cross-project permissions in situations like the following:\n\n- Your policy project is different than your cluster project.\n- Your cluster project is different than your artifact project.\n\nBefore you begin\n----------------\n\n- Sign in to your Google Cloud account. If you're new to Google Cloud, [create an account](https://console.cloud.google.com/freetrial) to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.\n-\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n | **Note:** If you installed the gcloud CLI previously, make sure you have the latest version by running `gcloud components update`.\n- If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\n-\n To [initialize](/sdk/docs/initializing) the gcloud CLI, run the following command:\n\n ```bash\n gcloud init\n ```\n- [Create or select a Google Cloud project](https://cloud.google.com/resource-manager/docs/creating-managing-projects).\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n - Create a Google Cloud project:\n\n ```\n gcloud projects create PROJECT_ID\n ```\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with a name for the Google Cloud project you are creating.\n - Select the Google Cloud project that you created:\n\n ```\n gcloud config set project PROJECT_ID\n ```\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with your Google Cloud project name.\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n-\n\n\n Enable the Binary Authorization API:\n\n\n ```bash\n gcloud services enable binaryauthorization.googleapis.com\n ```\n\n-\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n | **Note:** If you installed the gcloud CLI previously, make sure you have the latest version by running `gcloud components update`.\n- If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\n-\n To [initialize](/sdk/docs/initializing) the gcloud CLI, run the following command:\n\n ```bash\n gcloud init\n ```\n- [Create or select a Google Cloud project](https://cloud.google.com/resource-manager/docs/creating-managing-projects).\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n - Create a Google Cloud project:\n\n ```\n gcloud projects create PROJECT_ID\n ```\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with a name for the Google Cloud project you are creating.\n - Select the Google Cloud project that you created:\n\n ```\n gcloud config set project PROJECT_ID\n ```\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with your Google Cloud project name.\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n-\n\n\n Enable the Binary Authorization API:\n\n\n ```bash\n gcloud services enable binaryauthorization.googleapis.com\n ```\n\n\u003cbr /\u003e\n\nCluster project different than the policy project\n-------------------------------------------------\n\nGrant the Binary Authorization service agent in the cluster project the\n[Binary Authorization Policy Evaluator](/iam/docs/understanding-roles#binaryauthorization.policyEvaluator)\n(`roles/binaryauthorization.policyEvaluator`)\nrole on the policy project. \n\n gcloud projects add-iam-policy-binding \u003cvar translate=\"no\"\u003ePOLICY_PROJECT_ID\u003c/var\u003e \\\n --member=\"serviceAccount:service-$(gcloud projects describe \u003cvar translate=\"no\"\u003eCLUSTER_PROJECT_ID\u003c/var\u003e --format='value(projectNumber)')@gcp-sa-binaryauthorization.iam.gserviceaccount.com\" \\\n --role=roles/binaryauthorization.policyEvaluator\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePOLICY_PROJECT_ID\u003c/var\u003e: the ID of the project that contains your policy.\n- \u003cvar translate=\"no\"\u003eCLUSTER_PROJECT_ID\u003c/var\u003e: the project ID of the cluster.\n\n\u003cbr /\u003e\n\nCluster project different than the artifact project\n---------------------------------------------------\n\nGrant the Binary Authorization service agent in the cluster project the\n[Artifact Registry Reader](/iam/docs/understanding-roles#artifactregistry.reader)\n(`roles/artifactregistry.reader`) role on the artifact project. \n\n gcloud projects add-iam-policy-binding \u003cvar translate=\"no\"\u003eARTIFACT_PROJECT_ID\u003c/var\u003e \\\n --member=\"serviceAccount:service-$(gcloud projects describe \u003cvar translate=\"no\"\u003eCLUSTER_PROJECT_ID\u003c/var\u003e --format='value(projectNumber)')@gcp-sa-binaryauthorization.iam.gserviceaccount.com\" \\\n --role=roles/artifactregistry.reader\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eARTIFACT_PROJECT_ID\u003c/var\u003e: the ID of the project that contains your Artifact Registry repository. **Note:** If you use Container Registry, you can use the [Storage Object Viewer](/iam/docs/understanding-roles#storage.objectViewer) (`roles/storage.objectViewer`) role, but we recommend that you migrate to Artifact Registry. Container Registry is deprecated. For migration instructions, see [Transition from Container Registry](/artifact-registry/docs/transition/transition-from-gcr).\n- \u003cvar translate=\"no\"\u003eCLUSTER_PROJECT_ID\u003c/var\u003e: the project ID that runs your GKE clusters.\n\n\u003cbr /\u003e"]]