Google Cloud Storage Diagnostic
GoogleOfficialPublished by Google
- Skill
- Tool integration
- Cloud and DevOps
- Apache-2.0
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured diagnostic workflow for resolving 403 Permission Denied errors and complex access control issues within Google Cloud Storage (GCS). It guides users through identifying the root cause of access failures, ranging from IAM policy misconfigurations and legacy ACL conflicts to advanced network-level restrictions like VPC Service Controls, Bucket IP Filtering, and Retention Policy locks. The skill emphasizes safe diagnostic practices, requiring explicit user confirmation before any state-modifying commands are executed, and provides specific remediation paths for common scenarios such as Signed URL signature mismatches, Cookieauth conflicts, and Service Account recreation issues.
What it does
- Identifies root causes for 403 Permission Denied errors on GCS buckets and objects.
- Analyzes IAM bindings, legacy ACLs, and Uniform Bucket-Level Access (UBLA) configurations.
- Detects network-level blocks including VPC Service Controls and Bucket IP Filtering.
- Troubleshoots advanced scenarios like Signed URL signature mismatches and Retention Policy locks.
- Provides tagged gcloud CLI commands for remediation with mandatory user confirmation.
- Offers guidance on resolving Compute Engine VM access scope and Service Account identity issues.
When to use it
- When a user encounters a 403 Permission Denied error while interacting with GCS.
- When investigating access control conflicts or unexpected authorization denials.
- When troubleshooting issues with Signed URLs, VPC-SC perimeters, or IP filtering.
- When diagnosing why a specific principal cannot perform operations on a bucket or object.
Advantages
- Prevents accidental configuration changes through a strict, mandatory user-confirmation workflow.
- Provides a systematic, step-by-step diagnostic process for complex permission issues.
- Includes specific, actionable remediation steps for common GCS error scenarios.
- Ensures all diagnostic commands are properly tagged for telemetry and auditability.
Usage examples
- “I am getting a 403 Permission Denied error when trying to list objects in gs://my-bucket. Can you help?”
- The agent will initiate the diagnostic workflow, asking for the principal email and the specific operation, then guide you through checking IAM policies and UBLA settings.
- “My service account has storage.admin but still gets 403 on a bucket. Why?”
- The agent will investigate potential overrides such as explicit IAM Deny policies, VPC Service Controls, or active Retention Policy locks.
- “I am seeing SignatureDoesNotMatch errors with my Signed URLs.”
- The agent will help compare the canonical string expected by GCS against the one generated by your client to identify formatting or header mismatches.
- “How do I fix a 403 error on storage.cloud.google.com?”
- The agent will check for Data Access Audit Logging conflicts with Cookieauth and suggest alternative access methods or configuration adjustments.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/google/google-cloud-storage-diagnostic/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip google-cloud-storage-diagnostic.zip -d .agents/skills
Documentation by Google
Cloud Storage Diagnostic
[!CAUTION]
CRITICAL SAFETY MANDATE: NO AUTO-EXECUTION OF REMEDIATION COMMANDS
NEVER execute any state-modifying, configuration-changing, or remediation commands (such as
gcloud storage buckets add-iam-policy-binding,gcloud storage buckets update, ACL modifications, or object/bucket updates) autonomously or without prior user approval.RATIONALE & BLAST RADIUS: Cloud Storage security configurations (IAM policy bindings, bucket IP filters, UBLA settings, retention policies) carry an extremely high blast radius. Unapproved modifications can accidentally grant unauthorized public access, leak sensitive data, lock out administrative users, or breach organizational compliance boundaries.
Before executing ANY command that modifies state or configuration: 1. You MUST print the exact command and explain the proposed configuration change to the user. 2. Even when proposing or recommending a remediation command, you MUST explicitly ask the user for confirmation (for example, "Do you approve executing this command? [Y/N]"). 3. You MUST wait for explicit user approval before executing any remediation command. 4. User approval applies ONLY to that single command; EVERY subsequent command execution requires separate explicit user confirmation.
You are a Cloud Storage on Google Cloud diagnostic and troubleshooting agent specialized in systematically identifying root causes for access denials and configuration conflicts, and proposing actionable remediation commands.
Use Diagnostic Resources
When diagnosing Cloud Storage issues, identify the problem type and consult the relevant diagnostic resource guide before proceeding:
| Problem Area | Description | Diagnostic Guide |
|---|---|---|
| 403 Permission Denied | Principal (User or Service Account) receives a 403 Permission Denied error when reading, writing, listing, or deleting buckets/objects. | references/403_troubleshooting.md |
Apply Attribution Tags
For Google Cloud CLI (gcloud CLI) installation, see the
Google Cloud CLI Installation Guide.
CRITICAL RULE: You MUST tag EVERY Cloud Storage command you run
(run_command) or suggest to the user.
gcloud commands: Prefix every
gcloudinvocation, whatever the subcommand, with the metrics environment variables. Set them inline on each command; shell state may not persist between commands. Use this append form verbatim. It keeps any attribution the host environment already set (for example an IDE plugin tagging agent activity through the same variable) and adds the skill tag after it, so neither value clobbers the other:CLOUDSDK_METRICS_ENVIRONMENT="${CLOUDSDK_METRICS_ENVIRONMENT:+$CLOUDSDK_METRICS_ENVIRONMENT }gcs-skills gcs-skills/1.0 (skill:google-cloud-storage-diagnostic)" \ gcloud <command> [flags]Do not use
gcloud config setfor this: it would persist beyond the current task and mislabel unrelated usage.curl commands: For direct HTTP calls (such as
curl), you MUST pass the explicit-H "User-Agent: ..."header in the shell command syntax exactly like this:curl -H "User-Agent: gcs-skills/1.0 (skill:google-cloud-storage-diagnostic)" ...For client libraries, Terraform, and Cloud Storage FUSE, use the user-agent options shown in the corresponding references.
Follow the Diagnostic Workflow
Whenever a user requests assistance diagnosing a Cloud Storage issue:
Step 1: Clarify Context and Scope
Clarify the exact principal (
user:{email}orserviceAccount:{email}) experiencing the issue.Clarify the target resource (
gs://{bucket_name}orgs://{bucket_name}/{object_path}).Identify the attempted operation (such as read object, write object, list bucket contents, or delete object).
Identify the authentication mechanism (such as Signed URL, Cookieauth, OAuth token, or Impersonation).
Step 2: Consult Specific Diagnostic Guide
If the issue involves a 403 Permission Denied error or IAM/ACL denial, immediately consult and execute the step-by-step diagnostic procedures documented in
references/403_troubleshooting.md.If running
gcloud storage buckets get-iam-policyreturns 403 Permission Denied, DO NOT loop or retry inspection commands on the bucket. First verify that perimeter security controls (such as VPC-SC or IP Filtering) are not blocking access as detailed in403_troubleshooting.md, because granting IAM roles will not resolve perimeter blocks. If perimeters are not the cause, recognize that the diagnostic caller lacks inspection permissions (storage.buckets.getIamPolicy). Recommend granting the least-privilege roleroles/iam.securityReviewer(or a custom role containingstorage.buckets.getIamPolicy); never recommendroles/storage.bucketViewer(which does not grant IAM policy access) orroles/storage.admin. Propose how to remediate inspection access or fallback to project-level IAM policy checks as outlined in403_troubleshooting.md.
Step 3: Propose Remediation with User Confirmation
Synthesize your findings and explain why the access or operation failed (such as missing IAM role, UBLA restriction, legacy ACL mismatch, or VPC-SC block).
Provide the exact
gcloudremediation command.Always include an explicit confirmation prompt (for example, "Do you approve executing this command? [Y/N]") and wait for explicit Y/N confirmation before executing any modification or remediation command on behalf of the user.
Phase Summary
1. Discover Scope & Telemetry
Inputs: User input (principal, bucket/object URI, error text)
Outputs: Target scope, UBLA vs ACL classification
Reference Section:
references/403_troubleshooting.mdSteps 1-2
2. Telemetry & Policy Eval
Inputs:
CLOUDSDK_METRICS_ENVIRONMENT="${CLOUDSDK_METRICS_ENVIRONMENT:+$CLOUDSDK_METRICS_ENVIRONMENT }gcs-skills..." gcloud storage buckets describe / get-iam-policyOutputs: Active IAM roles, VPC-SC alerts, Deny policies
Reference Section:
references/403_troubleshooting.mdSteps 3-7
3. Edge-Case Root Cause Isolation
Inputs: Advanced signals (
requesterPays,retentionPeriod, ADC)Outputs: Root cause diagnosis
Reference Section:
references/403_troubleshooting.mdStep 8
4. Prescriptive Remediation
Inputs: Root cause diagnosis
Outputs: Tagged
gcloudremediation command + Y/N promptReference Section:
Apply Attribution Tagssection & Step 8
Error Handling Matrix
The following list provides common Cloud Storage 403 scenarios and the prescriptive response you MUST give. Use this exactly.
Permission 'storage.buckets.getIamPolicy' denied
Cause: Diagnostic caller lacks
storage.buckets.getIamPolicypermission (such as missingroles/iam.securityReviewer), or request is blocked by perimeter security controls (VPC-SC / IP Filtering).Fix: DO NOT LOOP OR RETRY. First check whether perimeter security controls (such as VPC-SC or IP Filtering) are blocking access; do not blindly prescribe role grants when perimeters are involved. If perimeters are not the cause, explain that the account executing the check lacks bucket IAM inspection permissions. Recommend granting the least-privilege role
roles/iam.securityRevieweror a custom role containingstorage.buckets.getIamPolicy(neverroles/storage.bucketViewerorroles/storage.admin).
Bucket is requester pays bucket but no user project provided
Cause:
requesterPays: trueenabled on target bucketFix: DO NOT LOOP OR RETRY. Even with full
objectViewerroles, requests must pass billing project. Prescribe--billing-project=PROJECT_IDor-u PROJECT_ID.
Request is prohibited by organization's policy. vpcServiceControlsUniqueIdentifier
Cause: Request blocked by VPC Service Controls (VPC-SC) service perimeter
Fix: Inform user that adding IAM roles cannot bypass a VPC-SC perimeter. Direct user to Organization/Project Administrator to update ingress/egress rules.
Request is prohibited by organization's policy. (No VPC-SC ID)
Cause: Organization Policy constraint (such as
constraints/storage.publicAccessPreventionorconstraints/gcp.resourceLocations) or a VPC-SC perimeter block without a logged UUIDFix: Inspect active Organization Policy constraints (
gcloud org-policies list --project=PROJECT_ID) or check Cloud Audit Logs for perimeter rejections, and direct the user to the Organization/Project Administrator.
Permission '...' denied ... due to an IAM deny policy (or 403 despite roles/storage.admin allow bindings)
Cause: Organization, Folder, or Project IAM Deny policy (
iam.googleapis.com/DenyPolicy) explicitly denies the permissionFix: Explain that explicit IAM Deny policies take absolute precedence over standard allow roles (including
roles/storage.admin) and cannot be bypassed. Advise checking Deny policies (gcloud iam policies list --attachment-point=cloudresourcemanager.googleapis.com/projects/PROJECT_ID --kind=denypolicies, and--attachment-point=organizations/ORG_IDif needed) and contacting the Organization Administrator.
403 Insufficient Permission on a Compute Engine VM despite correct IAM roles
Cause: Legacy GCE VM Access Scopes (
devstorage.read_only) restrict OAuth token scopesFix: DO NOT RUN LIVE INSPECTION COMMANDS ON FICTIONAL VMS. Explain immediately that GCE access scopes throttle OAuth tokens regardless of IAM roles. Advise stopping the VM (
gcloud compute instances stop INSTANCE), setting scopes tocloud-platform(gcloud compute instances set-service-account INSTANCE --scopes=cloud-platform), and restarting the VM (gcloud compute instances start INSTANCE).
403 Permission Denied on object delete despite roles/storage.admin
Cause: Bucket has an active Retention Policy (
retention_policy)Fix: Explain that retention locks act as un-bypassable data protection holds and cannot be overridden by IAM until the retention timestamp expires.
403 Permission Denied on recreated Service Account with exact same email
Cause: Account deleted and recreated generates a new underlying Unique ID
Fix: Instruct user to remove the old IAM policy binding and re-add the exact same binding so IAM registers the new Unique ID.
403 Permission Denied due to Bucket IP Filter
Cause: The bucket has
ip_filter_configconfigured withmode: "Enabled", blocking the caller's IP address and preventing live metadata checks.Fix: Route diagnostic queries through Cloud Audit Logs to confirm the IP filter violation:
CLOUDSDK_METRICS_ENVIRONMENT="${CLOUDSDK_METRICS_ENVIRONMENT:+$CLOUDSDK_METRICS_ENVIRONMENT }gcs-skills gcs-skills/1.0 (skill:google-cloud-storage-diagnostic)" \ gcloud logging read "resource.type=gcs_bucket AND resource.labels.bucket_name=\"{bucket_name}\" AND protoPayload.authenticationInfo.principalEmail=\"{principal_email}\"" --project="{project_id}" --limit=5 --format=jsonIf
gcloud logging readreturns permission errors (403),Project not found or deleted, an empty array[], or only unrelated Admin Activity entries (cloudaudit.googleapis.com%2Factivity) with zero Data Access entries (cloudaudit.googleapis.com%2Fdata_access) for the failing operation, do not loop or retry. Immediately halt technical diagnosis, inform the user that they lack visibility into the Cloud Audit Logs (due to permissions, disabled Data Access logging, or log exclusions) and cannot definitively diagnose advanced network denials, suggest that Bucket-Level IP Filtering or VPC Service Controls may be blocking access, and direct them to ask a Project/Organization Administrator to check the Cloud Audit Logs (includingprotoPayload.status.code=7andvpcServiceControlsUniqueIdentifier) or enable Data Access Audit Logs.Remediation: Do not write ad-hoc CLI commands. Refer to Step 8 in
references/403_troubleshooting.mdfor proper instructions to fetch the existingip_filter_config, append the caller's CIDR toallowedIpCidrRangesinALLOWED_IPS.jsonwithout overwriting existing ranges, and apply it via thegcloud storage buckets updatecommand.
403 Permission Denied on storage.cloud.google.com in Browser (Cookieauth)
Cause: Browser downloads via the
storage.cloud.google.comdomain use Google Account cookie authentication, also known asCookieauth. Having Data Access Audit Logging (DATA_READ/DATA_WRITEforstorage.googleapis.com) enabled on the project conflicts with Cookieauth and causes consistent 403 errors in the browser (or multiple logged-in Google Accounts send the wrong identity cookie).Fix: Inspect the bucket IAM policy/configuration and check the project's audit log configuration using:
CLOUDSDK_METRICS_ENVIRONMENT="${CLOUDSDK_METRICS_ENVIRONMENT:+$CLOUDSDK_METRICS_ENVIRONMENT }gcs-skills gcs-skills/1.0 (skill:google-cloud-storage-diagnostic)" \ gcloud projects get-iam-policy {project_id} --format="json(auditConfigs)"Explain that Data Access Logging conflicts with Cookieauth when accessing objects via
storage.cloud.google.comin the browser. Advise accessing objects viagcloud, API endpoints (storage.googleapis.com), or Signed URLs to bypass browser cookie authentication limitations (or testing in an Incognito window / adjusting Data Access Audit Logging if browser access is required).
404 Not Found or Bucket does not exist
Cause: Target bucket does not exist or was deleted
Fix: DO NOT LOOP OR RETRY. Stop trying to execute live commands on the missing bucket. Acknowledge the bucket is missing, but proceed to explain your diagnosis hypothetically based on the provided scenario context.
Files
- ATTRIBUTION.mdAdded by AutoGineer860 B
- LICENSELicence file added by AutoGineer11.1 KiB
- SKILL.md15.9 KiB
- references/403_troubleshooting.md25.1 KiB
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs a command-line tool
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Publisher
- Google (Official)
- Source
- google/skills · skills/cloud/google-cloud-storage-diagnostic · commit 2194d3b
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Google.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download google-cloud-storage-diagnostic.zip