Code Analysis is not available for the site.

Try the Beta!

Code Analysis is in public beta.

Overview

If you don’t use GitHub Actions, you can run the Datadog CLI directly in your CI pipeline platform.

Prerequisites:

  • unzip
  • trivy
  • Node.js 14 or later

Configure the following environment variables:

NameDescriptionRequiredDefault
DD_API_KEYYour Datadog API key. This key is created by your Datadog organization and should be stored as a secret.Yes
DD_APP_KEYYour Datadog application key. This key is created by your Datadog organization and should be stored as a secret.Yes
DD_SITEThe Datadog site to send information to. Your Datadog site is .Nodatadoghq.com

Provide the following inputs:

NameDescriptionRequiredDefault
serviceThe name of the service to tag the results with.Yes
envThe environment to tag the results with. ci is a helpful value for this input.Nonone
subdirectoryThe subdirectory path the analysis should be limited to. The path is relative to the root directory of the repository.No
# Set the Datadog site to send information to
export DD_SITE="datadoghq.com"

# Install dependencies
npm install -g @datadog/datadog-ci

# Output Trivy results
trivy fs --output /tmp/trivy.json --format cyclonedx </path/to/code>

# Upload results
datadog-ci sbom upload --service "my-app" --env "ci" /tmp/trivy.json

Further Reading

Additional helpful documentation, links, and articles: