# Service Accounts default GCS access

**URL:** <https://discuss.google.dev/t/service-accounts-default-gcs-access/409283>\
**Category:** Compute Infrastructure\
**Tags:** cloud-storage\
**Created:** [October 29, 2026, 3:07pm UTC](https://discuss.google.dev/t/service-accounts-default-gcs-access/409283 "2026-10-29T15:07:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevimunis](https://d3byx8b92xw3lq.cloudfront.net/user_avatar/discuss.google.dev/kevimunis/32/551_2.png) [@kevimunis](https://discuss.google.dev/u/kevimunis)\
**Post date:** [October 29, 2026, 3:07pm UTC](https://discuss.google.dev/t/service-accounts-default-gcs-access/409283/1 "2026-10-29T15:07:32Z")

</div>

This question has been asked previously but there’s not been a good answer on this.

Google creates default service accounts that have storage.objects.get on all buckets

- Cloud Run
- Vertex AI
- Container Registry
- Compute Engine

It seems it’s not possible to revoke these permissions. Any of those accounts could potentially be used to gain access to the data in the bucket.

Some real examples of how that would be a problem:

> **[Transitive Access Abuse - Data Exfiltration via Document AI by Kat Traxler](https://www.vectra.ai/blog/transitive-access-abuse-data-exfiltration-via-document-ai)**
>
> The Document AI service unintentionally allows users to read any Cloud Storage object in the same project and write to an attacker-controlled location.

> **[Bad.Build: A Critical Privilege Escalation Design Flaw in Google Cloud Build...](https://orca.security/resources/blog/bad-build-google-cloud-build-potential-supply-chain-attack-vulnerability/)**
>
> The Orca Research Pod discovered Bad.Build, a vulnerability in the Google Cloud Build service that enabled attackers to gain access to and escalate privileges.

Or as a more simple example, if you enable the Agent Platform API and grant a user `roles/aiplatform.user` any training jobs you create will have access to all data in all buckets in your project through the automatically created AI Platform Service Agent. The scope for accidental exposure of data is huge.

It seems crazy that it’s not possible to create a bucket where only specific named accounts can access. We have a bucket with sensitive data in it and we absolutely don’t want other services such as Cloudbuild or Vertex AI to read from it.

As a solution we implemented DENY rules to prevent access other than from named accounts.

```auto
{
  "displayName": "Block storage object access project-wide",
  "kind": "DenyPolicy",
  "name": "policies/cloudresourcemanager.googleapis.com%2Fprojects%2F000000000000/denypolicies/restrict-bucket-access",
  "rules": [
    {
      "denyRule": {
        "deniedPermissions": [
          "storage.googleapis.com/objects.create",
          "storage.googleapis.com/objects.delete",
          "storage.googleapis.com/objects.get",
          "storage.googleapis.com/objects.list",
          "storage.googleapis.com/objects.update"
        ],
        "deniedPrincipals": [
          "principalSet://goog/public:all"
        ],
        "exceptionPrincipals": [
          "principal://iam.googleapis.com/projects/-/serviceAccounts/backend@my-project.iam.gserviceaccount.com",
          "principal://iam.googleapis.com/projects/-/serviceAccounts/p000000000000-siq4mq@gcp-sa-cloud-sql.iam.gserviceaccount.com",
          "principal://iam.googleapis.com/projects/-/serviceAccounts/backup-replicator@my-project.iam.gserviceaccount.com",
          "principal://iam.googleapis.com/projects/-/serviceAccounts/db-backup-workflow@my-project.iam.gserviceaccount.com",
          "principal://iam.googleapis.com/projects/-/serviceAccounts/backup-clone@my-project.iam.gserviceaccount.com",
          "principal://iam.googleapis.com/projects/-/serviceAccounts/backup-restore@my-project.iam.gserviceaccount.com",
          "principal://goog/subject/user@company.com"
        ]
      },
      "description": "Deny storage access to all buckets except for authorised service accounts"
    }
  ],
} 

```

I’m really surprised that this doesn’t seem to be addressed anywhere, and that this isn’t recommended practice. Is there no official answer to this?

K

---

<div class="post-metadata">

**Author:** ![kevimunis](https://d3byx8b92xw3lq.cloudfront.net/user_avatar/discuss.google.dev/kevimunis/32/551_2.png) [@kevimunis](https://discuss.google.dev/u/kevimunis)\
**Post date:** [October 29, 2026, 3:08pm UTC](https://discuss.google.dev/t/service-accounts-default-gcs-access/409283/2 "2026-10-29T15:08:06Z")

</div>

Some previous discussion on this. I was limited to 2 links in the previous post, so had to remove the references.

- [Why are gcp IAM permissions so open by default and how should I restrict them?](https://discuss.google.dev/t/why-are-gcp-iam-permissions-so-open-by-default-and-how-should-i-restrict-them/148242)
- [Cloud Storage: remove service account permissions](https://discuss.google.dev/t/cloud-storage-remove-service-account-permissions/148977#M6231)
