Skip to content

fix(lwpreflight): require storage.objects.list for GCP Agentless - #1853

Closed
lokesh-vadlamudi wants to merge 1 commit into
mainfrom
lvadlamudi/cad-2295-gcp-agentless-objects-list
Closed

fix(lwpreflight): require storage.objects.list for GCP Agentless#1853
lokesh-vadlamudi wants to merge 1 commit into
mainfrom
lvadlamudi/cad-2295-gcp-agentless-objects-list

Conversation

@lokesh-vadlamudi

@lokesh-vadlamudi lokesh-vadlamudi commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Problem

Deleting a GCP Agentless Workload Scanning integration that was onboarded with the provided custom IAM role fails during terraform destroy:

Permission 'storage.objects.list' denied

The integration still disappears from Cloud Accounts, and the GCP resources it was supposed to clean up survive as orphans the customer has to remove by hand.

Root cause

The Agentless permission lists granted storage.objects.delete but not storage.objects.list. Terraform force-destroys the scanning bucket, and that enumerates the objects before deleting them, so delete without list cannot complete. The AWS Agentless lists already pair s3:ListBucket / s3:ListBucketVersions with s3:DeleteObject for exactly this path. GCP was missing the equivalent.

The orphaning is a consequence rather than a separate defect. The Lacework integration is itself a Terraform-managed resource that depends on the GCP resources, so destroy tears it down first and then dies on the bucket. Any partial destroy leaves that same shape.

Change

Adds storage.objects.list to RequiredPermissions[Agentless] and RequiredPermissionsForOrg[Agentless]. The permission is valid in both project- and org-level custom roles.

Adds a test asserting that any list granting storage.objects.delete also grants storage.objects.list. Verified it fails on both lists before the fix and passes after.

CAD-2294
CAD-2295

@lokesh-vadlamudi
lokesh-vadlamudi force-pushed the lvadlamudi/cad-2295-gcp-agentless-objects-list branch from e226d54 to 8d51f77 Compare August 12, 2026 23:49
Terraform force-destroys the Agentless scanning bucket, which enumerates
the objects before deleting them. The Agentless permission lists granted
storage.objects.delete but not storage.objects.list, so the destroy died
partway through with "Permission 'storage.objects.list' denied".

That partial destroy is what orphans resources: the Lacework integration
is itself a Terraform-managed resource that depends on the GCP ones, so
it is destroyed first and the account disappears from Cloud Accounts
while the GCP resources it was meant to clean up survive.

The AWS Agentless lists already pair s3:ListBucket with s3:DeleteObject
for this same force-destroy path. GCP was missing the equivalent.

CAD-2294
CAD-2295
@lokesh-vadlamudi
lokesh-vadlamudi force-pushed the lvadlamudi/cad-2295-gcp-agentless-objects-list branch from 8d51f77 to 46e1805 Compare August 13, 2026 00:20
@lokesh-vadlamudi

Copy link
Copy Markdown
Collaborator Author

Superseded by #1852, which now carries this change along with the other permission-list corrections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant