The rules, scanning groups, and custom rules described on this page are configured in Datadog. A configuration file in your repository adds separate control over which files are scanned. See File configuration.
Scanning groups
There are two scanning groups that configure Secret Scanning rules.
Managed scanning group
The managed scanning group is managed by Datadog’s security team. It automatically receives new rules and updates to rules, and is enabled by default for all organizations.
To customize the severity and keywords of a managed default rule, hover over the rule and click the pencil icon on the right.
The edit dialog opens.
After editing the rule and clicking Update at the bottom right, the modified rule appears as Customized in the managed scanning group.
Customized rules do not automatically receive severity/default keyword updates from Datadog's security team. To restore a rule to its managed state, hover over a customized rule and click the restore icon at the right.
Creating custom rules
To create a custom rule, go to the custom scanning group and click Add scanning rule at the bottom or Add rule at the top right. Create your regex rule, then configure the severity and keywords. After they’re enabled, your repositories are scanned with the new rules on the next commit.
To update a custom rule, hover over the rule and click the pencil icon on the right.
Disabling rules
Disable a rule by clicking the blue toggle on the right.
After a specific rule is disabled, existing findings from that rule are auto-closed in Secret Scanning on the next commit.
File configuration
Rules are configured in Datadog as described in the Configuring rules section. Which files Secret Scanning reads is configured under the secrets key in the Code Security configuration. Define it in Datadog, or in a code-security.datadog.yaml file at the root of your repository.
The configuration must begin with schema-version: v1.5, followed by a secrets key containing a global-config object. The global-config object controls repository-wide settings:
Property
Type
Description
Default
only-paths
Array
File paths or glob patterns. Only matching files are analyzed.
None
ignore-paths
Array
File paths or glob patterns to exclude. Matching files are not analyzed.
None
use-gitignore
Boolean
Whether to include entries from the .gitignore file in ignore-paths.
true
ignore-generated-files
Boolean
Whether to include common generated file patterns in ignore-paths.
true
max-file-size-kb
Number
Maximum file size (in kB) to analyze. Larger files are ignored.
10240
Example configuration
schema-version:v1.5secrets:global-config:# Only analyze the following paths/filesonly-paths:- "src"- "**/*.py"# Do not analyze the following paths/filesignore-paths:- "tests"- "**/*.lock"use-gitignore:trueignore-generated-files:truemax-file-size-kb:10240
1
2
rulesets:- %!s(<nil>) # Rules to enforce .
Request a personalized demo
Get Started with Datadog
Ask AI
AI-generated responses may be inaccurate. Verify important info.