Skip to content

Infrastructure as Code

Infrastructure as Code scanning reads the templates of a Git repository, or of every repository of a GitHub organization (Terraform, CloudFormation, Kubernetes manifests and more).

  • What DRACO uses: Templates of a Git repository, or of all repositories of a GitHub organization, for posture scans.
  • What for: Compliance checks and posture dashboards.

Add it in Connectors > Add connector: pick Infrastructure as Code, then choose what DRACO collects and what it may change. Add more later with Add a part on its connector page. See Connectors for how connectors, sign-in and tags work.

Parts

Part What DRACO uses Access Permissions
Posture IaC read None for a public repository; a read-only token for a private one (GitHub fine-grained token with Contents: Read; GitLab project access token with read_repository; Bitbucket repository access token with Repositories: Read). One connection per repository, or one per GitHub organization: a fine-grained token with Metadata and Contents: Read on All repositories, or a classic token with the repo scope.

DRACO's Infrastructure as Code (IaC) provider enables scanning of infrastructure code in Git repositories for security and compliance issues using Trivy. This provider supports a wide range of IaC frameworks, allowing assessment of code before deployment.

Supported IaC Formats

DRACO IaC provider scans the following Infrastructure as Code configurations for misconfigurations and secrets:

Configuration Type File Patterns
Kubernetes *.yml, *.yaml, *.json
Docker Dockerfile, Containerfile
Terraform *.tf, *.tf.json, *.tfvars
Terraform Plan tfplan, *.tfplan, *.json
CloudFormation *.yml, *.yaml, *.json
Azure ARM Template *.json
Helm *.yml, *.yaml, *.tpl, *.tar.gz, etc.
YAML *.yaml, *.yml
JSON *.json
Ansible *.yml, *.yaml, *.json, *.ini, without extension

How It Works

  • DRACO clones the repository and leverages Trivy to scan it for supported IaC files.
  • Public repositories need no credentials. For private repositories, enter a read-only token in Access Token (Optional): a GitHub fine-grained token with Contents: Read on the repository, a GitLab project access token with read_repository, or a Bitbucket repository access token with Repositories: Read. Any Git host reached over HTTPS works.
  • A whole GitHub organization: enter the organization URL, such as https://github.com/acme, instead of a repository URL (a user account such as https://github.com/octocat works the same way). Each scan lists the organization's repositories, so new repositories are picked up on their own, and scans them one after another. Archived repositories, forks, empty repositories and repositories over 2 GB are skipped, and a repository that takes longer than 10 minutes is skipped while the scan goes on with the next one. Findings name the repository: the resource is acme/infra/terraform/main.tf and the region is acme/infra:main (repository and branch).
  • The token of an organization must read all of its repositories: a fine-grained token with Repository access: All repositories and Metadata and Contents: Read, or a classic token with the repo scope for private repositories. Public repositories need no token. Check connection fails with a plain sentence for a wrong token, an organization the token cannot see, or an organization with no repository to scan.
  • Mutelist logic (filtering) is handled by Trivy, not DRACO.
  • Findings appear with those of every other provider.

Connect the provider in DRACO

Supported Scanners

Scanner selection is not configurable in DRACO. Default scanners, misconfig and secret, run automatically during each scan.

Step 1: Access DRACO

  1. Sign in to DRACO
  2. Open Connectors, click Add connector and pick Infrastructure as Code: the wizard opens at Link a Provider.

  3. Add the repository URL (or the GitHub organization URL) and an optional alias, then click "Next"

Step 2: Enter Authentication Details

  1. For a private repository or organization, enter the access token, then click Authenticate

    A GitHub organization already connected to DRACO with its own GitHub App (see GitHub) needs no token: click Use the GitHub App of . Both connectors then sign in with the same app; the scan makes a fresh access token from it every hour, so a long scan of hundreds of repositories never runs on an expired token, and it reads the repositories the app was installed on. An app of your own also works: open Or sign in with a GitHub App of the organization and paste its App ID and private key (.pem).

Step 3: Verify Connection & Start Scan

  1. Click Check connection; when the connection works, launch the first scan (Run now or On a schedule)