GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||
GeezerVison is showing docs.datadoghq.com — Set up Static Code Analysis (SAST) For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/code_security/static_analysis/setup.md.
A documentation index is available at /llms.txt.
Set up Static Code Analysis (SAST)This product is not supported for your selected Datadog site. (). Code Security is not available for the site. OverviewTo set up Datadog SAST in-app, navigate to Security > Code Security. Select where to run Static Code Analysis scansScan with Datadog-hosted scanningYou can run Datadog Static Code Analysis (SAST) scans directly on Datadog infrastructure. Supported repository types include:
To get started, navigate to the Code Security page. Scan in CI pipelinesDatadog Static Code Analysis runs in your CI pipelines using the First, configure your Datadog API and application keys. Add Next, run Static Code Analysis by following instructions for your chosen CI provider below. See instructions based on your CI provider: Select your source code management providerDatadog Static Code Analysis supports all source code management providers, with native support for GitHub, GitLab, Azure DevOps, and Bitbucket Cloud Premium. Configure a GitHub App with the GitHub integration tile and set up the source code integration to enable inline code snippets and pull request comments. When installing a GitHub App, the following permissions are required to enable certain features:
See the GitLab source code setup instructions to connect GitLab repositories to Datadog. Both GitLab.com and Self-Managed instances are supported. Note: Your Azure DevOps integrations must be connected to a Microsoft Entra tenant. Azure DevOps Server is not supported. See the Azure source code setup instructions to connect Azure DevOps repositories to Datadog. See the Bitbucket source code setup instructions to connect Bitbucket Cloud workspaces to Datadog. If you are using another source code management provider, configure Static Code Analysis to run in your CI pipelines using the Customize your configurationBy default, Datadog Static Code Analysis (SAST) scans your repositories with Datadog’s default rulesets for each programming language. You can customize which rulesets or rules run, along with other parameters, in Datadog or in a Link findings to Datadog services and teamsDatadog associates code and library scan results with Datadog services and teams to automatically route findings to the appropriate owners. This enables service-level visibility, ownership-based workflows, and faster remediation. For Static Code Analysis, Software Composition Analysis, Secret Scanning, and IaC Security findings, mapped services also provide runtime context. To determine the services that a finding belongs to, Datadog combines the results of several mapping sources. Each source can map a finding to one or more services, and Datadog keeps every valid mapping instead of selecting a single source or service:
A mapping means that the finding’s file is related to the service. It does not confirm that the file is part of the deployed version of the service. Mappings apply at the directory level, so files in the same directory map to the same services. For repositories that Datadog identifies as forks, Datadog uses only Software Catalog code locations. Using service definitions that include code locations in the Software Catalog is the only way to explicitly control how findings are mapped to services. Code locations add mappings; they do not remove mappings from the other sources. The other sources are not user-configurable and depend on data from other Datadog products, such as APM and Source Code Integration. Mapping using the Software Catalog (recommended)Services in the Software Catalog identify their codebase content using the
If you want all the files in a repository to be associated with a service, you can use the glob The schema for this field is described in the Software Catalog entity model. Datadog goes through all Software Catalog definitions and checks whether the finding’s file path matches. For a finding to be mapped to a service through Some findings might not contain a file path. In those cases, Datadog cannot evaluate Services defined with a Software Catalog schema v2.x do not support codeLocations. Existing definitions can be upgraded to the v3 schema in the Software Catalog. After migration is completed, changes might take up to 24 hours to apply to findings. If you are unable to upgrade to v3, Datadog maps findings with the other sources described in this section. These rely on less precise heuristics, so accuracy might vary depending on the Code Security product and your use of other Datadog features. Example (v3 schema)SAST findingIf a vulnerability appeared in SCA findingIf a library was declared in Instead, if it was declared in Datadog maps a finding to every service whose code locations match the finding's file path. Service inference from file paths or repository namesWhen none of the other mapping sources returns a service, Datadog inspects naming patterns in the repository and file paths. Datadog evaluates whether:
When using the finding’s file path, Datadog performs a reverse search on each path segment until it finds a matching service or exhausts all options. For example, if a finding occurs in When all options have been tried, Datadog checks whether the repository name, This mechanism helps findings receive a service attribution when no other mapping source applies. Link findings to teams through Code OwnersIf Datadog links your finding to a service, then the team that owns that service (if defined) is associated with that finding automatically. Regardless of whether Datadog successfully links a finding to a service (and a Datadog team), Datadog uses the You must accurately map your Git provider teams to your Datadog Teams for team attribution to function properly. Diff-aware scanningDiff-aware scanning enables Datadog’s static analyzer to only scan the files modified by a commit in a feature branch. It accelerates scan time significantly by not having the analysis run on every file in the repository for every scan. To enable diff-aware scanning in your CI pipeline, follow these steps:
Example of commands sequence (these commands must be invoked in your Git repository): Note: When a diff-aware scan cannot be completed, the entire directory is scanned. Upload third-party static analysis results to DatadogSARIF importing has been tested for Snyk, CodeQL, Semgrep, Gitleaks, and Sysdig. Reach out to Datadog Support if you experience any issues with other SARIF-compliant tools. You can send results from third-party static analysis tools to Datadog, provided they are in the interoperable Static Analysis Results Interchange Format (SARIF) Format. Node.js version 14 or later is required. To upload a SARIF report:
SARIF Support GuidelinesDatadog supports ingestion of third-party SARIF files that are compliant with the 2.1.0 SARIF schema. The SARIF schema is used differently by static analyzer tools. If you want to send third-party SARIF files to Datadog, please ensure they comply with the following details:
For example, here’s an example of a SARIF file processed by Datadog: SARIF to CVSS severity mappingThe SARIF format defines four severities: none, note, warning, and error. However, Datadog reports violations and vulnerabilities severity using the Common Vulnerability Scoring System (CVSS), which defined five severities: critical, high, medium, low and none. When ingesting SARIF files, Datadog maps SARIF severities into CVSS severities using the mapping rules below.
Data RetentionDatadog stores findings in accordance with our Data Retention Periods. Datadog does not store or retain customer source code. | ||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |