Access control with IAM
Stay organized with collections
Save and categorize content based on your preferences.
This page describes access control with Identity and Access Management (IAM) in
Artifact Registry.
Default permissions for Artifact Registry minimize setup effort when
implementing a CI/CD pipeline. You can also integrate Artifact Registry
with third-party CI/CD tools and configure the permissions and authentication
required to access repositories.
If you use Artifact Analysis to work with container metadata, such as
vulnerabilities found in images, see the
Artifact Analysis documentation
for information about granting access to view or manage metadata.
IAM permissions and
roles determine your ability to create, view,
edit, or delete data in an Artifact Registry repository.
A role is a collection of permissions. You can't grant a principal permissions
directly; instead, you grant them a role. When you grant a role to a principal,
you grant them all the permissions that the role contains. You can grant
multiple roles to the same principal.
Google Cloud default permissions
By default, the following permissions apply to Google Cloud CI/CD services
in the same project as Artifact Registry:
Cloud Build permissions
include permissions to upload and download artifacts.
If all your services are in the same Google Cloud project and the default
permissions meet your needs, you don't need to configure permissions.
You must configure Artifact Registry permissions for these services if:
You want to use these services to access Artifact Registry in another
project. In the project with Artifact Registry, grant the
workload identity pool or service account for each service the
required role. If connecting to Cloud Run, grant the
Cloud Run Service Agent the required
role.
You're using a GKE version that does not have built-in
support for pulling images from Artifact Registry. See the
GKE section for configuration instructions.
You want the default service account to have read and write access to
repositories. See the following information for details:
You're using a user-provided service account for your runtime environments
instead of the default service account. In the project with
Artifact Registry, grant your service account the required
role.
Third-party integration
For third-party clients, you must configure both permissions and authentication.
Traditionally, applications running outside Google Cloud use
service account keys
to access Google Cloud resources. However, service account keys are
powerful credentials, and can present a security risk if they are not managed
correctly.
Workload Identity Federation lets you use Identity and Access Management to
grant external identities IAM roles,
including the ability to impersonate service accounts. This approach eliminates
the maintenance and security burden associated with service
account keys.
If you need to access Artifact Registry for longer periods of time,
then configure the OIDC token expiration time to a longer period in your
credential configuration.
Configure your third-party client to authenticate with
Artifact Registry.
The GitLab on Google Cloud integration uses
Workload Identity Federation for authorization and authentication for
GitLab workloads on Google Cloud without the need for service accounts or
service account keys. For more information on how Workload Identity Federation
is used in this partnership, see
Google Cloud Workload Identity Federation and IAM policies.
To connect your Artifact Registry repository, follow the GitLab tutorial
Google Artifact Registry.
Roles and permissions
Every Artifact Registry API method requires that the principal making
the request has the required permissions to use the resource. Permissions are
given to principals by setting policies that grant the principal a predefined
role on the resource.
You can grant roles on the Google Cloud project or the Artifact Registry
repository.
Predefined Artifact Registry roles
IAM provides predefined roles
that grant access to specific Google Cloud resources.
Use the following predefined roles for repositories on the pkg.dev domain:
Read, write, and delete artifacts. Create gcr.io repositories.
For a full list of the individual permissions in each role, refer to
Artifact Registry roles.
You can also use the
gcloud iam roles describe
command to view a list of permissions in each role.
Basic IAM roles
Basic roles are highly permissive roles that existed prior to the introduction
of IAM. You shouldn't grant basic roles in a production
environment, but you can grant them in a development or test environment.
Use predefined roles for repository
access whenever possible so that users and service accounts only have the
permissions that are required.
Grant roles at the project level if the same roles apply to all
repositories in the project. If some accounts require different levels of
access, grant roles at the repository level.
If you're granting roles on a virtual repository, those
roles apply to all upstream repositories available through the virtual
repository, regardless of individual repository permissions.
If you're granting roles using the gcloud command, you can specify a single
role binding for a principal or you can make large-scale policy changes by
getting a resource's allow policy, modifying it, and then setting the modified
allow policy. For more information, see
Grant or revoke multiple roles programmatically.
Granting project-wide roles
Grant a role at the project level if the same permissions apply to all
repositories in the project.
To add a user or service account to a project and grant them an
Artifact Registry role:
If you have artifacts that you want to make available to anyone on the internet
without authentication, store them in a repository that you make public.
To configure a repository for public read-only access, grant the
Artifact Registry Reader role to the principal allUsers. We also recommend
capping user request quotas so that a single
user can't use up your project's overall quota.
Console
Open the Repositories page in the Google Cloud console.
At the bottom of the Google Cloud console, a
Cloud Shell
session starts and displays a command-line prompt. Cloud Shell is a shell environment
with the Google Cloud CLI
already installed and with values already set for
your current project. It can take a few seconds for the session to initialize.
Project administrators can create tags for resources across Google Cloud
and manage them in Resource Manager. When you attach a tag to a
Artifact Registry repository, administrators can use the tag with
IAM conditions to grant conditional access to the repository.
You cannot attach tags to individual artifacts.
For more information see the following documentation:
For most Google Cloud service accounts, configuring access to a registry
only requires granting the appropriate IAM roles.
Default service accounts for Google Cloud services
Google Cloud services such as
Cloud Build or Google Kubernetes Engine use a
default service account or
service agent to interact with
resources within the same project.
You must configure or modify permissions yourself if:
The Google Cloud service is in a different project than Artifact Registry.
The default permissions don't meet your needs.
You're using a user-provided service account to interact with
Artifact Registry instead of the default service account.
Your organizational policy configuration prevents automatic role grants to
default service accounts.
The following service accounts typically access Artifact Registry. The
email address for the service account includes the Google Cloud
project ID or project number
of the project where the service is running.
If you disable the automatic role grant, you must decide which roles to grant to the default
service accounts, and then grant these
roles yourself.
If the default service account already has the Editor role, we recommend that you replace the
Editor role with less permissive roles.To safely modify the service account's roles, use Policy Simulator to see the impact of
the change, and then grant and revoke the
appropriate roles.
Granting access to Compute Engine instances
VM instances that access repositories must have both Artifact Registry
permissions and storage access scope configured.
While a service account's access level is determined by the
IAM roles granted to the service account, access scopes on
a VM instance determine the default OAuth scopes for requests made through the
gcloud CLI and client libraries on the instance. As a result, access scopes
potentially further limit access to API methods when authenticating with
Application Default Credentials.
Compute Engine uses the following defaults:
The Compute Engine default service account is the identity for VM
instances. The service account email address has the suffix
@developer.gserviceaccount.com.
The default service account has the IAM basic
Editor role, if you have not disabled this behavior.
Instances you create with the default service account have the
Compute Engine default access scopes, including
read-only access to storage. While the Editor role generally grants write
access, the read-only storage access scope limits the instance service
account to downloading artifacts only from any repository in the same project.
You must configure the access scope of the service account if:
The VM service account needs to access a repository in a different project.
The VM service account needs to perform actions other than reading artifacts
from repositories. This typically applies third-party tools on a VM that need
to push images or run Artifact Registry gcloud commands.
To configure roles and set the access scope:
In the project with your VM instance, get the name of the
Compute Engine default service account. The service account email address has the
suffix @developer.gserviceaccount.com.
In the project with the repository, grant permissions so that
the service account can access the repository.
If your GKE environment does not meet these requirements the
instructions to grant access depend on whether you're using the
Compute Engine default service account or a user-provided service account as
the identity for your nodes.
If GKE is in a different project than
Artifact Registry, grant the required permissions to the
service account.
To push images, interact with repositories for formats other than
containers, or run gcloud commands from your cluster, you must set
access scopes for the service account when you create the
cluster or node pool.
Access scopes are the legacy method of specifying authorization for
Compute Engine VMs. To pull images from Artifact Registry repositories,
GKE nodes must have the storage read-only access scope or
another storage access scope that includes storage read access.
You can only set access scopes when you create a cluster or node pool. You
cannot change access scopes on existing nodes.
For more information about scopes you can set when creating a new cluster,
refer to the documentation for the command
gcloud container clusters create.
Configuring an imagePullSecret
To configure an imagePullSecret:
In the project with GKE, find Compute Engine default
service account. The account email address has the suffix
@developer.gserviceaccount.com.
Every namespace
in your Kubernetes cluster has a default service account called default.
This default service account is used to pull your container image.
Add the newly created imagePullSecret secret to your default service
account:
Now, any new pods created in the current default namespace will have the
imagePullSecret secret defined.
Artifact Registry service account
The Artifact Registry Service Agent is a Google-managed service account that
acts on behalf of Artifact Registry when interacting with Google Cloud
services. For more information about the account and its permissions, see
Artifact Registry service account.
What's next
After you have set up permissions, learn more about working with your artifacts.
[[["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 2026-06-09 UTC."],[],[]]