-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Update IaC Security configuration documentation #36468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6803,9 +6803,9 @@ menu: | |
| url: /security/code_security/iac_security/setup/ | ||
| parent: code_security_iac_security | ||
| weight: 100000 | ||
| - name: Exclusions | ||
| - name: Configuration | ||
| identifier: code_security_iac_security_exclusions | ||
| url: /security/code_security/iac_security/exclusions/ | ||
| url: /security/code_security/iac_security/configuration/ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
In localized builds this menu URL is passed through Useful? React with 👍 / 👎. |
||
| parent: code_security_iac_security | ||
| weight: 100001 | ||
| - name: Rules | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -9,23 +9,28 @@ further_reading: | |||||||||||||||||||||
| - link: /security/code_security/software_composition_analysis/configuration/ | ||||||||||||||||||||||
| tag: Documentation | ||||||||||||||||||||||
| text: Software Composition Analysis (SCA) Configuration | ||||||||||||||||||||||
| - link: /security/code_security/iac_security/configuration/ | ||||||||||||||||||||||
| tag: Documentation | ||||||||||||||||||||||
| text: Infrastructure as Code (IaC) Security Configuration | ||||||||||||||||||||||
| --- | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Datadog Code Security can be configured in Datadog, in a file at the root of your repository, or in both locations. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ## Configuration schema | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| The configuration file must begin with `schema-version: v1.0` or `schema-version: v1.1`, followed by top-level keys for each product you want to configure. Use `v1.1` to enable SCA support. | ||||||||||||||||||||||
| The configuration file must begin with `schema-version: v1.0`, `schema-version: v1.1`, or `schema-version: v1.2`, followed by top-level keys for each product you want to configure. Use `v1.1` to enable SCA support and `v1.2` to enable IaC Security support. | ||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ```yaml | ||||||||||||||||||||||
| schema-version: v1.1 | ||||||||||||||||||||||
| schema-version: v1.2 | ||||||||||||||||||||||
| sast: | ||||||||||||||||||||||
| # Static Code Analysis (SAST) configuration | ||||||||||||||||||||||
| sca: | ||||||||||||||||||||||
| # Software Composition Analysis (SCA) configuration | ||||||||||||||||||||||
| iac: | ||||||||||||||||||||||
| # Infrastructure as Code (IaC) Security configuration | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Both the `sast` and `sca` sections are optional. Any configuration location, including the org level, repository level, or repository file, can include one or both sections. For the full schema for each section, see [Static Code Analysis (SAST) Configuration][1] and [Software Composition Analysis (SCA) Configuration][2]. | ||||||||||||||||||||||
| The `sast`, `sca`, and `iac` sections are optional. Any configuration location, including the org level, repository level, or repository file, can include one or more sections. For the full schema for each section, see [Static Code Analysis (SAST) Configuration][1], [Software Composition Analysis (SCA) Configuration][2], and [Infrastructure as Code (IaC) Security Configuration][3]. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ## Where to define configurations | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
@@ -65,18 +70,18 @@ For each field in a configuration, merge behavior depends on the field type: | |||||||||||||||||||||
|
|
||||||||||||||||||||||
| | Field type | Merge behavior | Example fields | | ||||||||||||||||||||||
| |---|---|---| | ||||||||||||||||||||||
| | Lists | Concatenated, with duplicates removed | `use-rulesets`, `ignore-rulesets`, `ignore-paths`, `only-paths` | | ||||||||||||||||||||||
| | Lists | Concatenated, with duplicates removed | `use-rulesets`, `ignore-rulesets`, `ignore-rules`, `ignore-paths`, `only-paths` | | ||||||||||||||||||||||
| | Scalar values (strings, numbers, booleans) | The value from the highest-precedence configuration is used | `use-default-rulesets`, `use-gitignore`, `max-file-size-kb`, `category` | | ||||||||||||||||||||||
| | Maps | Recursively merged | `ruleset-configs`, `rule-configs`, `arguments` | | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| For the full list of fields, see [Static Code Analysis (SAST) Configuration][1] and [Software Composition Analysis (SCA) Configuration][2]. | ||||||||||||||||||||||
| For the full list of fields, see [Static Code Analysis (SAST) Configuration][1], [Software Composition Analysis (SCA) Configuration][2], and [Infrastructure as Code (IaC) Security Configuration][3]. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| The following example shows how configurations are merged: | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| #### Org-level | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ```yaml | ||||||||||||||||||||||
| schema-version: v1.1 | ||||||||||||||||||||||
| schema-version: v1.2 | ||||||||||||||||||||||
| sast: | ||||||||||||||||||||||
| use-default-rulesets: false | ||||||||||||||||||||||
| use-rulesets: | ||||||||||||||||||||||
|
|
@@ -92,12 +97,18 @@ sast: | |||||||||||||||||||||
| sca: | ||||||||||||||||||||||
| ignore-paths: | ||||||||||||||||||||||
| - "vendor/" | ||||||||||||||||||||||
| iac: | ||||||||||||||||||||||
| ignore-rules: | ||||||||||||||||||||||
| - A | ||||||||||||||||||||||
| global-config: | ||||||||||||||||||||||
| ignore-paths: | ||||||||||||||||||||||
| - "examples/" | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| #### Repo-level | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ```yaml | ||||||||||||||||||||||
| schema-version: v1.1 | ||||||||||||||||||||||
| schema-version: v1.2 | ||||||||||||||||||||||
| sast: | ||||||||||||||||||||||
| use-rulesets: | ||||||||||||||||||||||
| - B | ||||||||||||||||||||||
|
|
@@ -115,12 +126,18 @@ sast: | |||||||||||||||||||||
| sca: | ||||||||||||||||||||||
| ignore-paths: | ||||||||||||||||||||||
| - "third_party/" | ||||||||||||||||||||||
| iac: | ||||||||||||||||||||||
| ignore-rules: | ||||||||||||||||||||||
| - B | ||||||||||||||||||||||
| global-config: | ||||||||||||||||||||||
| ignore-paths: | ||||||||||||||||||||||
| - "generated/" | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| #### Merged result | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ```yaml | ||||||||||||||||||||||
| schema-version: v1.1 | ||||||||||||||||||||||
| schema-version: v1.2 | ||||||||||||||||||||||
| sast: | ||||||||||||||||||||||
| use-default-rulesets: false | ||||||||||||||||||||||
| use-rulesets: | ||||||||||||||||||||||
|
|
@@ -143,11 +160,19 @@ sca: | |||||||||||||||||||||
| ignore-paths: | ||||||||||||||||||||||
| - "vendor/" | ||||||||||||||||||||||
| - "third_party/" | ||||||||||||||||||||||
| iac: | ||||||||||||||||||||||
| ignore-rules: | ||||||||||||||||||||||
| - A | ||||||||||||||||||||||
| - B | ||||||||||||||||||||||
| global-config: | ||||||||||||||||||||||
| ignore-paths: | ||||||||||||||||||||||
| - "examples/" | ||||||||||||||||||||||
| - "generated/" | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| The example demonstrates each merge rule from the table above: | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - **Lists concatenate**: `use-rulesets` merges to `[A, B]`; the SCA `ignore-paths` merges to `["vendor/", "third_party/"]`. | ||||||||||||||||||||||
| - **Lists concatenate**: `use-rulesets` merges to `[A, B]`; the SCA `ignore-paths` merges to `["vendor/", "third_party/"]`; the IaC `ignore-rules` merges to `[A, B]`. | ||||||||||||||||||||||
| - **Scalars use the highest-precedence value**: `maxCount: 22` (repo-level) overrides `maxCount: 10` (org-level). | ||||||||||||||||||||||
| - **Maps merge recursively**: The `foo` rule config keeps `ignore-paths` from the org level while applying `maxCount: 22` from the repo level. New entries like `bar` are added from the repo level. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
@@ -157,3 +182,4 @@ The example demonstrates each merge rule from the table above: | |||||||||||||||||||||
|
|
||||||||||||||||||||||
| [1]: /security/code_security/static_analysis/configuration/ | ||||||||||||||||||||||
| [2]: /security/code_security/software_composition_analysis/configuration/ | ||||||||||||||||||||||
| [3]: /security/code_security/iac_security/configuration/ | ||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove the changes from the non-English language menu files? We have an automated translation pipeline our translation vendor handles.