Loading...
Loading...
Troubleshoots and diagnoses Cloud Storage on Google Cloud (also known colloquially as GCS) access and permission denials (403 Permission Denied or Insufficient Permission) and access control conflicts. Use whenever a user encounters or asks to analyze a 403 error on a bucket or object — including analysis-only questions where no commands are run — or needs help with IAM bindings, fine-grained ACLs, Uniform Bucket-Level Access (UBLA), getIamPolicy inspection denials and least-privilege inspection roles, browser storage.cloud.google.com Cookieauth and Data Access Audit Logging conflicts, Signed URL SignatureDoesNotMatch errors, VPC Service Controls (VPC-SC) perimeters, explicit IAM Deny policies, Bucket IP Filtering, Requester Pays, Retention Policy locks, Compute Engine VM access scopes, Application Default Credentials (ADC) mismatches, recursive delete permissions, or recreated service accounts. Don't use for creating buckets, routine uploads/downloads, proactive security audits, or Cloud Storage FUSE mounts.
npx skill4agent add google/skills google-cloud-storage-diagnostic[!CAUTION]CRITICAL SAFETY MANDATE: NO AUTO-EXECUTION OF REMEDIATION COMMANDSNEVER execute any state-modifying, configuration-changing, or remediation commands (such as,gcloud storage buckets add-iam-policy-binding, ACL modifications, or object/bucket updates) autonomously or without prior user approval.gcloud storage buckets updateRATIONALE & 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.
| Problem Area | Description | Diagnostic Guide |
|---|---|---|
| 403 Permission Denied | Principal (User or Service Account) receives a | |
gcloudrun_commandgcloudCLOUDSDK_METRICS_ENVIRONMENT="${CLOUDSDK_METRICS_ENVIRONMENT:+$CLOUDSDK_METRICS_ENVIRONMENT }gcs-skills gcs-skills/1.0 (skill:google-cloud-storage-diagnostic)" \
gcloud <command> [flags]gcloud config setcurl-H "User-Agent: ..."curl -H "User-Agent: gcs-skills/1.0 (skill:google-cloud-storage-diagnostic)" ...user:{email}serviceAccount:{email}gs://{bucket_name}gs://{bucket_name}/{object_path}references/403_troubleshooting.mdgcloud storage buckets get-iam-policy403_troubleshooting.mdstorage.buckets.getIamPolicyroles/iam.securityReviewerstorage.buckets.getIamPolicyroles/storage.bucketViewerroles/storage.admin403_troubleshooting.mdgcloudreferences/403_troubleshooting.mdCLOUDSDK_METRICS_ENVIRONMENT="${CLOUDSDK_METRICS_ENVIRONMENT:+$CLOUDSDK_METRICS_ENVIRONMENT }gcs-skills..." gcloud storage buckets describe / get-iam-policyreferences/403_troubleshooting.mdrequesterPaysretentionPeriodreferences/403_troubleshooting.mdgcloudApply Attribution TagsPermission 'storage.buckets.getIamPolicy' deniedstorage.buckets.getIamPolicyroles/iam.securityReviewerroles/iam.securityReviewerstorage.buckets.getIamPolicyroles/storage.bucketViewerroles/storage.adminBucket is requester pays bucket but no user project providedrequesterPays: trueobjectViewer--billing-project=PROJECT_ID-u PROJECT_IDRequest is prohibited by organization's policy. vpcServiceControlsUniqueIdentifierRequest is prohibited by organization's policy.constraints/storage.publicAccessPreventionconstraints/gcp.resourceLocationsgcloud org-policies list --project=PROJECT_IDPermission '...' denied ... due to an IAM deny policy403roles/storage.adminiam.googleapis.com/DenyPolicyroles/storage.admingcloud iam policies list --attachment-point=cloudresourcemanager.googleapis.com/projects/PROJECT_ID --kind=denypolicies--attachment-point=organizations/ORG_ID403 Insufficient Permissiondevstorage.read_onlygcloud compute instances stop INSTANCEcloud-platformgcloud compute instances set-service-account INSTANCE --scopes=cloud-platformgcloud compute instances start INSTANCE403 Permission Deniedroles/storage.adminretention_policy403 Permission Denied403 Permission Deniedip_filter_configmode: "Enabled"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=jsongcloud logging read403Project not found or deleted[]cloudaudit.googleapis.com%2Factivitycloudaudit.googleapis.com%2Fdata_accessprotoPayload.status.code=7vpcServiceControlsUniqueIdentifierreferences/403_troubleshooting.mdip_filter_configallowedIpCidrRangesALLOWED_IPS.jsongcloud storage buckets update403 Permission Deniedstorage.cloud.google.comstorage.cloud.google.comCookieauthDATA_READDATA_WRITEstorage.googleapis.comCLOUDSDK_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)"storage.cloud.google.comgcloudstorage.googleapis.com404 Not FoundBucket does not exist