Repository navigation
[K9VULN-18095] feat(aws): add agentless-scanning-policy module for SaaS mode - #294
Conversation
… policies Merge the orchestrator, worker and DSPM policies into a single managed policy (new agentless-scanning-policy module), attached either to the delegate role (self-hosted) or to the Datadog integration role (SaaS). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…anning-policy directly Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…module The delegate role module and SaaS users now own the aws_iam_policy and its attachment, using the module json output. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…for SaaS agentless-scanning-policy outputs the orchestrator, worker and DSPM documents used unchanged by scanning-delegate-role, plus a merged json document for SaaS mode. Self-hosted deployments see no change on upgrade. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
| vuln_containers_os = true | ||
| lambda = true | ||
| sensitive_data = true | ||
| compliance_host = true |
There was a problem hiding this comment.
compliance_host is optional and defaults to false, do we want it set to true?
There was a problem hiding this comment.
Yeah, I think it's fine to set it to true in this example.
Up to users to disable it if they don't need it.
| } | ||
|
|
||
| provider "aws" { | ||
| region = "us-east-1" |
There was a problem hiding this comment.
shouldn't the region be a part of the variables?
There was a problem hiding this comment.
Could indeed be passed as a param.
As it's another example, I just wanted it to be consistent with the other examples (Like this one).
| } | ||
|
|
||
| statement { | ||
| sid = "DatadogAgentlessScannerDescribeImages" |
There was a problem hiding this comment.
in a previous version this permission has been dropped and I wonder if we really need it.
There was a problem hiding this comment.
Good catch.
This permission is used only for the offline mode of the scanner.
So not really needed in the nominal case. You'd only need it if you run the scanner in offline mode.
But I think it's fine keeping it for now.
sarrazaghbib-dev
left a comment
There was a problem hiding this comment.
This approach looks good to me! Thank you!
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Adds support for Agentless Scanning in SaaS mode: only IAM permissions, no scanner infra. A single managed policy with all the scanning permissions is attached to the Datadog integration role, mirroring
datadog_agentless_saas.yamlin cloudformation-template.Changes
modules/agentless-scanning-policy(new): policy documents only (no resources).orchestrator_json,worker_json,dspm_json: the existing self-hosted documents, unchanged.json: all of them merged into one document for SaaS mode (statements shared by the orchestrator and worker are merged by Sid).scanning-delegate-role: same policies, attachments and outputs as before; their content now comes from the module outputs.examples/saas(new):aws_iam_policyfrommodule.agentless_scanning_policy.json, attached to the integration role, plusdatadog_agentless_scanning_aws_scan_options. Pinned to0.13.0.arn:aws.Self-hosted upgrade (0.12.4 → this branch)
Offline
terraform plan -refresh=falseagainst a state built from 0.12.4, for all four combinations ofsensitive_data_scanning_enabled/sensitive_data_scanning_rds_enabled: identical to the plan of unchanged 0.12.4 against the same state, with byte-identical policy JSON. No breaking change, nomovedblocks.In GovCloud/China the S3/ECR/KMS statements change because of the partition fix; they never matched anything there before.
SaaS policy
Same permissions as the three self-hosted documents combined: 22 statements, no duplicate Sids, ~4.5k of the 6,144-character limit.
Things to know
scanning-delegate-rolenow loads../agentless-scanning-policy. That works with the usualgit::…//modules/…source, but breaks if someone copied only the module folder.datadog_agentless_scanning_aws_scan_optionshas no field for SaaS mode or the policy ARN yet (CloudFormation sendsSaaSScanningPolicyArnto the API).ec2:DescribeImages, which Terraform grants. To be aligned separately.🤖 Generated with Claude Code