Container scanner

Last updated: Nov 5, 2026


Quick scan vs. configuration file

The container scanner has two modes of operation.

Quick scan: Analyze one public image directly from the command line, without a configuration file:

cs scan alpine:3.17

By default, this command gives a SARIF report.

Configuration file: Use a YAML configuration file when a quick scan is not sufficient. With a configuration file, you can:

  • Scan private or ECR images
  • Scan many images at the same time
  • Set custom output paths
  • Export an SBOM with a vulnerability report

Use this command:

cs scan --config config.yaml

The remaining part of this page shows the configuration file options.

For the common configuration file keys of all the scanners, read Use a configuration file.

Specific configuration file keys

The container scanner has this key. Use it to do an SCA analysis of container images.

containers_sca

This key has an images list of the container images to scan. Each entry supports these options:

  • image_uri (mandatory): The URI of the container image to analyze. It accepts standard image references, for example, alpine:3.17.
  • image_config (optional): More settings to pull and analyze the image. For details, read image_config options.

For example:

containers_sca:
  images:
    - image_uri: alpine:3.17
    - image_uri: registry.example.com/myapp:latest
      image_config:
        docker_credentials:
          docker_username: user
          docker_password: token

The containers_sca key also accepts the feature_preview option (optional). When you set it to true, the scanner also reports the detections that are in beta and that wait for approval. The default value is false.

image_config options

The image_config sub-key supports these options:

  • use_docker_daemon (optional): When you set it to true, the scanner connects to your local Docker daemon to analyze local images. This option is available only on Linux systems.
  • os_override (optional): Changes the target OS for the image analysis. The default value is linux.
  • arch_override (optional): Changes the target architecture for the image analysis. The default value is arm64.

For example, to scan an amd64 Windows image:

containers_sca:
  images:
    - image_uri: mcr.microsoft.com/windows/server:2022
      image_config:
        os_override: windows
        arch_override: amd64
  • docker_credentials (optional): The credentials to authenticate to a Docker-compatible registry:

    • docker_username: The registry username.
    • docker_password: The password or token with read access to the image.

    The two fields support the ${VAR_NAME} syntax. Read the example.

  • ecr_credentials (optional): The credentials to authenticate to AWS Elastic Container Registry (ECR). It accepts static credentials or role assumption:

    Static credentials:

    • access_key_id (mandatory): The AWS access key ID.
    • secret_access_key (mandatory): The AWS secret access key.
    • session_token (optional): Necessary when you use temporary credentials (when access_key_id starts with ASIA).
    • aws_region (optional): The AWS region of the ECR registry. The default value is us-east-1.

    access_key_id, secret_access_key, and session_token support the ${VAR_NAME} syntax. Read the example.

    Role assumption:

    • role_arn (mandatory): The ARN of the IAM role to assume.
    • external_id (mandatory): The external ID that is necessary for the role assumption.
    • aws_region (optional): The AWS region of the ECR registry. The default value is us-east-1.

    role_arn and external_id support the ${VAR_NAME} syntax. Read the example.

Output configuration

Vulnerability report

Use the top-level output key to configure the vulnerability report:

  • file_path (optional): The path of the report. The default value is .fluidattacks-containers-sca-results.sarif or .fluidattacks-containers-sca-results.csv, for the format that you select.
  • format (optional): The report format. The accepted values are SARIF (default) and CSV.
output:
  file_path: /results/fluid-attacks-results.sarif
  format: SARIF

SBOM output

Use the sbom key to export a Software Bill of Materials (SBOM):

  • output.name (optional): The path of the SBOM.
  • output.format (optional): The SBOM format. The accepted values are fluid-json (default), cyclonedx-json, cyclonedx-xml, spdx-json, and spdx-xml.
sbom:
  output:
    name: /results/fluid-sbom.json
    format: fluid-json

Configuration file examples

Scanning a public image

language: EN
output:
  file_path: /results/fluid-attacks-results.sarif
  format: SARIF
containers_sca:
  images:
    - image_uri: alpine:3.17

Scanning an image from a private registry

language: EN
output:
  file_path: /results/fluid-attacks-results.csv
  format: CSV
containers_sca:
  images:
    - image_uri: registry.example.com/myapp:latest
      image_config:
        docker_credentials:
          docker_username: user
          docker_password: token

Scanning an ECR image with static credentials

language: EN
output:
  file_path: /results/fluid-attacks-results.sarif
  format: SARIF
containers_sca:
  images:
    - image_uri: 123456789012.dkr.ecr.us-east-1.amazonaws.com/myapp:latest
      image_config:
        ecr_credentials:
          access_key_id: access_key_id
          secret_access_key: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
          aws_region: us-east-1

Scanning an ECR image via IAM role assumption

language: EN
output:
  file_path: /results/fluid-attacks-results.sarif
  format: SARIF
containers_sca:
  images:
    - image_uri: 123456789012.dkr.ecr.us-east-1.amazonaws.com/myapp:latest
      image_config:
        ecr_credentials:
          role_arn: arn:aws:iam::123456789012:role/MyECRReadRole
          external_id: my-external-id
          aws_region: us-east-1

Scanning an image with envars

The credential fields accept the ${VAR_NAME} syntax. During the scan, the scanner reads the value from the environment variable with that name.

language: EN
output:
  file_path: /results/fluid-attacks-results.sarif
  format: SARIF
containers_sca:
  images:
    - image_uri: registry.example.com/myapp:latest
      image_config:
        docker_credentials:
          docker_username: user
          docker_password: ${REGISTRY_PASSWORD}
    - image_uri: 123456789012.dkr.ecr.us-east-1.amazonaws.com/myapp:latest
      image_config:
        ecr_credentials:
          role_arn: arn:aws:iam::123456789012:role/MyECRReadRole
          external_id: ${ECR_EXTERNAL_ID}
          aws_region: us-east-1

Scanning a locally stored image (Linux only)

language: EN
output:
  file_path: /results/fluid-attacks-results.sarif
  format: SARIF
containers_sca:
  images:
    - image_uri: myapp:local
      image_config:
        use_docker_daemon: true

Scanning multiple images with SBOM export

namespace: my_app
language: EN
output:
  file_path: /results/fluid-attacks-results.sarif
  format: SARIF
sbom:
  output:
    name: /results/fluid-sbom.json
    format: fluid-json
containers_sca:
  images:
    - image_uri: alpine:3.17
    - image_uri: 123456789012.dkr.ecr.us-east-1.amazonaws.com/myapp:latest
      image_config:
        ecr_credentials:
          role_arn: arn:aws:iam::123456789012:role/MyECRReadRole
          external_id: my-external-id

On this page