[K9VULN-12163] feat(agentless-gcp): introduce agentless setup metadata#146
Merged
mohamed-challal merged 10 commits intoMar 5, 2026
Merged
Conversation
k3nz0
approved these changes
Mar 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR reworks the GCP Agentless Scanning Cloud Shell setup script to better support additive deployments, users can run the script multiple times to add new scanner regions or projects to scan without destroying existing infrastructure.
Previously, re-running the script with a different region would cause Terraform to lose track of the previous region's provider, resulting in
Error: Provider configuration not presenterrors and requiring a full destroy/redeploy cycle.Changes
Deployment metadata (
metadata.py— new)config.jsonmetadata file stored in the GCS state bucket alongside the Terraform state.created_at/modified_attimestamps.terraform apply.Deploy flow (
main.py)Config.with_merged().Destroy flow (
destroy.py)SCANNER_REGIONS/PROJECTS_TO_SCANenv vars when metadata exists).terraform destroy.Region validation (
preflight.py)gcloud compute regions describe).ThreadPoolExecutorfor all regions in parallel.Resource naming (
terraform.py)northamerica-northeast1→na-ne1invpc_name).datadog_agentless_scanner_todatadog_agentless_.agentless-scannertodatadog-agentless.How it works
us-east1europe-west1project-aproject-a,project-bus-east1us-east1,europe-west1project-aproject-a,project-bus-east1, IAM forproject-aeurope-west1infra +project-bIAM bindings (us-east1untouched)regions: [us-east1],projects: [project-a]regions: [europe-west1, us-east1],projects: [project-a, project-b]{ "version": 1, "scanner_project": "project-a", "regions": [ "europe-west1", "us-east1" ], "projects_to_scan": [ "project-a", "project-b" ], "created_at": "2026-03-05T17:13:47.909771+00:00", "modified_at": "2026-03-05T17:22:25.225663+00:00" }