admin管理员组文章数量:1026707
I am facing an AccessDeniedException (403 Access Denied) when trying to delete a file from a Google Cloud Storage bucket. I have assigned the necessary permissions and roles (Storage Admin), but I still can't remove the object.
Steps taken:
IAM Permissions:
The service account has been granted the roles/storage.objectAdmin role on the bucket. My account has both Editor and Storage Admin roles in the project.
Bucket Policy Only:
I checked the bucket's settings and found that Bucket Policy Only is enabled. The Bucket Policy Only feature is locked until a specific future date.
Attempts to Remove the Object:
I attempted to remove a file from the bucket using the gsutil rm command. I received the error: AccessDeniedException: 403 Access denied.
Verification:
I have verified that no retention policy is set, and there is no object lock. I tried disabling Bucket Policy Only using the gcloud command but encountered errors because the option to disable was not recognized.
Current IAM Policy for the Bucket:
- members:
- projectEditor:project-id
- projectOwner:project-id
role: roles/storage.legacyBucketOwner
- members:
- projectViewer:project-id
role: roles/storage.legacyBucketReader
- members:
- projectEditor:project-id
- projectOwner:project-id
role: roles/storage.legacyObjectOwner
- members:
- projectViewer:project-id
role: roles/storage.legacyObjectReader
- members:
- serviceAccount:service-account-id
role: roles/storage.objectAdmin
What I have tried:
Adding the storage.objectAdmin role to the service account.
Disabling Bucket Policy Only using the gcloud command, but it does not recognize the option.
Checking the bucket's permissions and object lock status.
Error Message:
gsutil rm gs://bucket-name/file-name
Removing gs://bucket-name/file-name...
AccessDeniedException: 403 Access denied.
I am facing an AccessDeniedException (403 Access Denied) when trying to delete a file from a Google Cloud Storage bucket. I have assigned the necessary permissions and roles (Storage Admin), but I still can't remove the object.
Steps taken:
IAM Permissions:
The service account has been granted the roles/storage.objectAdmin role on the bucket. My account has both Editor and Storage Admin roles in the project.
Bucket Policy Only:
I checked the bucket's settings and found that Bucket Policy Only is enabled. The Bucket Policy Only feature is locked until a specific future date.
Attempts to Remove the Object:
I attempted to remove a file from the bucket using the gsutil rm command. I received the error: AccessDeniedException: 403 Access denied.
Verification:
I have verified that no retention policy is set, and there is no object lock. I tried disabling Bucket Policy Only using the gcloud command but encountered errors because the option to disable was not recognized.
Current IAM Policy for the Bucket:
- members:
- projectEditor:project-id
- projectOwner:project-id
role: roles/storage.legacyBucketOwner
- members:
- projectViewer:project-id
role: roles/storage.legacyBucketReader
- members:
- projectEditor:project-id
- projectOwner:project-id
role: roles/storage.legacyObjectOwner
- members:
- projectViewer:project-id
role: roles/storage.legacyObjectReader
- members:
- serviceAccount:service-account-id
role: roles/storage.objectAdmin
What I have tried:
Adding the storage.objectAdmin role to the service account.
Disabling Bucket Policy Only using the gcloud command, but it does not recognize the option.
Checking the bucket's permissions and object lock status.
Error Message:
gsutil rm gs://bucket-name/file-name
Removing gs://bucket-name/file-name...
AccessDeniedException: 403 Access denied.
Share
Improve this question
edited Nov 16, 2024 at 19:41
Doug Stevenson
319k36 gold badges456 silver badges473 bronze badges
asked Nov 16, 2024 at 19:39
AdhilAdhil
238 bronze badges
1
- Disabling Bucket Policy Only using the gcloud command, but it does not recognize the option. What do you mean with "it does not recognize the option"? What option? could you share the output? Also, what is the account executing the gsutil rm command? – MrThompson Commented Nov 16, 2024 at 21:44
1 Answer
Reset to default 0As you did not mention it in your post: maybe you just fot to activate the service account?
gcloud auth activate-service-account [ACCOUNT] --key-file=KEY_FILE
also, make sure that you have correct permissions to impersonate the SA you want to use.
I am facing an AccessDeniedException (403 Access Denied) when trying to delete a file from a Google Cloud Storage bucket. I have assigned the necessary permissions and roles (Storage Admin), but I still can't remove the object.
Steps taken:
IAM Permissions:
The service account has been granted the roles/storage.objectAdmin role on the bucket. My account has both Editor and Storage Admin roles in the project.
Bucket Policy Only:
I checked the bucket's settings and found that Bucket Policy Only is enabled. The Bucket Policy Only feature is locked until a specific future date.
Attempts to Remove the Object:
I attempted to remove a file from the bucket using the gsutil rm command. I received the error: AccessDeniedException: 403 Access denied.
Verification:
I have verified that no retention policy is set, and there is no object lock. I tried disabling Bucket Policy Only using the gcloud command but encountered errors because the option to disable was not recognized.
Current IAM Policy for the Bucket:
- members:
- projectEditor:project-id
- projectOwner:project-id
role: roles/storage.legacyBucketOwner
- members:
- projectViewer:project-id
role: roles/storage.legacyBucketReader
- members:
- projectEditor:project-id
- projectOwner:project-id
role: roles/storage.legacyObjectOwner
- members:
- projectViewer:project-id
role: roles/storage.legacyObjectReader
- members:
- serviceAccount:service-account-id
role: roles/storage.objectAdmin
What I have tried:
Adding the storage.objectAdmin role to the service account.
Disabling Bucket Policy Only using the gcloud command, but it does not recognize the option.
Checking the bucket's permissions and object lock status.
Error Message:
gsutil rm gs://bucket-name/file-name
Removing gs://bucket-name/file-name...
AccessDeniedException: 403 Access denied.
I am facing an AccessDeniedException (403 Access Denied) when trying to delete a file from a Google Cloud Storage bucket. I have assigned the necessary permissions and roles (Storage Admin), but I still can't remove the object.
Steps taken:
IAM Permissions:
The service account has been granted the roles/storage.objectAdmin role on the bucket. My account has both Editor and Storage Admin roles in the project.
Bucket Policy Only:
I checked the bucket's settings and found that Bucket Policy Only is enabled. The Bucket Policy Only feature is locked until a specific future date.
Attempts to Remove the Object:
I attempted to remove a file from the bucket using the gsutil rm command. I received the error: AccessDeniedException: 403 Access denied.
Verification:
I have verified that no retention policy is set, and there is no object lock. I tried disabling Bucket Policy Only using the gcloud command but encountered errors because the option to disable was not recognized.
Current IAM Policy for the Bucket:
- members:
- projectEditor:project-id
- projectOwner:project-id
role: roles/storage.legacyBucketOwner
- members:
- projectViewer:project-id
role: roles/storage.legacyBucketReader
- members:
- projectEditor:project-id
- projectOwner:project-id
role: roles/storage.legacyObjectOwner
- members:
- projectViewer:project-id
role: roles/storage.legacyObjectReader
- members:
- serviceAccount:service-account-id
role: roles/storage.objectAdmin
What I have tried:
Adding the storage.objectAdmin role to the service account.
Disabling Bucket Policy Only using the gcloud command, but it does not recognize the option.
Checking the bucket's permissions and object lock status.
Error Message:
gsutil rm gs://bucket-name/file-name
Removing gs://bucket-name/file-name...
AccessDeniedException: 403 Access denied.
Share
Improve this question
edited Nov 16, 2024 at 19:41
Doug Stevenson
319k36 gold badges456 silver badges473 bronze badges
asked Nov 16, 2024 at 19:39
AdhilAdhil
238 bronze badges
1
- Disabling Bucket Policy Only using the gcloud command, but it does not recognize the option. What do you mean with "it does not recognize the option"? What option? could you share the output? Also, what is the account executing the gsutil rm command? – MrThompson Commented Nov 16, 2024 at 21:44
1 Answer
Reset to default 0As you did not mention it in your post: maybe you just fot to activate the service account?
gcloud auth activate-service-account [ACCOUNT] --key-file=KEY_FILE
also, make sure that you have correct permissions to impersonate the SA you want to use.
本文标签:
版权声明:本文标题:AccessDeniedException when trying to delete a file from Google Cloud Storage despite having Storage Admin role - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745650472a2161287.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论