Connect Container Image CI/CD Pipelines

Connect your CI/CD pipeline to Tenable One Cloud Exposure, and grant access to the relevant code repository.

This is an integration guide for connecting container image CI/CD pipelines to Tenable.

Note: Use only the latest version of the CI/CD scanner image. Older versions fail with an invalid version error when they connect to Tenable. If you run the image directly, use the latest tag and add --pull=always.

Add Azure Pipelines

After you add a pipeline with Azure pipelines, you can use the Azure Pipelines Parameters to configure scan/sync settings and fine-tune how Cloud Exposure scans your environment.

Requirements:

  • Node.js and npm must be installed on the build agent.

    Note: Although these are included by default on Microsoft-hosted agents, if you are using a self-hosted build agent, you may need to explicitly install/activate them in your environment's PATH variable. You can do this by adding Microsoft's NodeTool task. Failure to do so may result in the following error: Parameter 'toolPath' cannot be null or empty
  • Docker must be installed. For more information, refer to the relevant Azure documentation.

To add a pipeline:

  1. In the Cloud Exposure Console, navigate to Settings > Integrations and click Add Integration.
  2. In the Integrations Library, click Azure Pipelines. The Add Azure Pipelines wizard opens.
  3. Create an API token (Step 1 in wizard). To create the token, enter a Token Name and then click Next.
  4. Store the API token (Step 2 in wizard). Copy and store the generated Token in a secure location and then click Next. You will need it for the next step in the wizard. The generated token allows API access to Tenable, and should be treated as a secret.
  5. Install the Tenable Azure DevOps extension (Step 3 in wizard):
    1. Click this link to access the extension from the Visual Studio marketplace.
    2. Click Get it free. There is no added cost for using the extension.
    3. Select the relevant Azure DevOps organization, and then click Install.
    4. The extension is now installed, and you can click Proceed to organization to go to your Azure DevOps site.
  6. (Recommended) Add a secret variable (Step 4 in wizard). To set a secret variable using the UI, follow these steps:

    Note: To protect Tenable's API token, it is recommended to use either secret variables, or an alternative secret store, if you're currently using one. Azure Pipelines variables can be stored on different scopes, depending on how you plan to use Tenable's scanning. It is recommended, but not mandatory, to only associate Tenable's token with workflows linked to repositories with IaC code.
    1. Log into Azure DevOps and click Pipelines.
    2. Select the relevant pipeline, and then click Edit.
    3. Click Variables.
    4. Click on the plus sign (+) or on New variable.
    5. Fill in the following details, and then click OK:
      • Set Name to TENABLE_API_TOKEN.
      • Paste the token created in the previous step as the Value.
      • Check Keep this value secret.

    When finished, click Next in the Cloud Exposure Console wizard to continue.

  7. Add tasks. Add the Cloud Exposure Container Image Scan task to your Azure Pipelines (Step 5 in wizard):
    1. Log into Azure DevOps and click Pipelines.
    2. Click on the three dots next to the relevant pipeline, and then click Edit.
    3. In your code, select the stage where you want to add Tenable’s task.
    4. In the task assistant, search for and click the Cloud Exposure Container Image Scan task.
    5. To add the task, type these values and then click Add:
      • API Token: $(TENABLE_API_TOKEN)
      • API URL: https://app.tenable.com/
      • Name: (Enter your image name here)
      • Use any Advanced settings as needed (see Azure Pipelines Parameters for more details).
    6. Save the updated pipeline YAML. Once the action is triggered, you should start seeing scan results under Risks > Container Image CI/CD Scans.
  8. In the Cloud Exposure Console wizard, click Finish.

Add GitHub Actions

After you add an action, you can use the GitHub Action Parameters to configure scan settings and fine-tune how Tenable scans your environment.

To add a GitHub action:

  1. In the Cloud Exposure Console, navigate to Settings > Integrations and click Add Integration.
  2. In the Integrations Library, click GitHub Actions. The Add GitHub Actions wizard opens.
  3. Create an API token (Step 1 in wizard). Enter a name for the token, and then click Next to create the token.
  4. Store the API token (Step 2 in wizard). Copy and store the generated token in a secure location. You will need it for the next step in the wizard. When finished, click Next.
  5. (Recommended) Add a GitHub secret (Step 3 in wizard). To store the API token securely, it is recommended to use either GitHub Actions Secrets, or some other secret store, if you're currently using one.

    To create a new secret in your GitHub repository, perform the following steps:

    1. On GitHub.com, navigate to the main page of the repository.
    2. Under your repository name, click Settings.
    3. In the Security section of the sidebar, select Secrets, then click Actions.
    4. Click New repository secret.
    5. Type TENABLE_API_TOKEN in the Name input box.
    6. Enter the value of the token that you created in the previous step.
    7. Click Add secret.
      When finished, click Next in the Cloud Exposure Console wizard.
  6. Add actions (Step 4 in wizard). Add the following Container Image Scan action to your GitHub workflow:

    Copy

    YAML

    steps:
    - uses: actions/checkout@v3
    - name: Scan container image with Tenable One Cloud Exposure
      uses: tenable/cloud-security-actions/container-image/scan@v1
      with:
        api-token: ${{ secrets.TENABLE_API_TOKEN }}
        api-url: https://app.tenable.com/
        name: <place your image name here>        

    After the action is triggered, you should start seeing scan results in Cloud Exposure under Risks > Container Image CI/CD Scans.

  7. When done, click Finish.

Add a GitLab Pipeline

After you add a GitLab pipeline, you can use the CLI in Tenable Docker Image to configure scan settings and fine-tune how Cloud Exposure scans your environment.

For more information about configuration options for GitLab's CI/CD YAML configuration, refer to GitLab documentation.

To add a GitLab pipeline:

  1. In the Cloud Exposure Console, navigate to Settings > Integrations and click Add Integration.
  2. In the Integrations Library, click GitLab CI/CD. The Add GitLab CI/CD wizard opens.
  3. Create an API token (Step 1 in wizard). To create the token, enter a Token Name and then click Next.
  4. Store the API token (Step 2 in wizard). Copy and store the generated Token in a secure location and then click Next. You will need it for the next step in the wizard. The generated token allows API access to Tenable, and should be treated as a secret.
  5. (Recommended) Add a variable (Step 3 in wizard). To define a CI/CD variable on a project, follow these steps:

    Note: To protect Tenable's API token, it is recommended to use either masked variables, or some other secret store, if you're currently using one. GitLab CI/CD variables can be stored on multiple levels, depending on how you plan to use Tenable's scanning. It is recommended, but not mandatory, to only associate Tenable's token with pipelines linked to repositories with IaC code.
    1. Log into GitLab.
    2. Go to your project’s Settings > CI/CD.
    3. Under Variables, click Expand.
    4. Click Add variable.
    5. Fill in the following details:
      1. Set Key to TENABLE_API_TOKEN.
      2. Paste the token created in the previous step as the Value.
      3. Select an Environment scope, if applicable.
      4. Under Flags, check the box that says Mask variable.
      5. Click Add variable.

    When finished, click Next in the Cloud Exposure Console wizard.

  6. Add stages (Step 4 in wizard). Add the following Container Image Scan step to your .gitlab-ci.yml file:

    Copy

    YAML

    include:
    - component: $CI_SERVER_FQDN/tenb/cloud-security/components/container-image-scan@1
    inputs:
      api-token: $TENABLE_API_TOKEN
      api-url: https://app.tenable.com/
      name: <place your image name here>
      stage: tenable-cloud-security

    stages:
    - tenable-cloud-security

    After the scan is triggered, you should start seeing scan results in Cloud Exposure under Risks > Container Image CI/CD Scans.

  7. Click Finish in the Cloud Exposure Console wizard.

Add a Jenkins Pipeline

After you add a Jenkins pipeline, you can use the CLI in Tenable Docker Image to configure scan/sync settings and fine-tune how Cloud Exposure scans your environment.

Requirements:

  • Docker must be installed on the host
  • Docker plugin must be installed in Jenkins
  1. In the Cloud Exposure Console, navigate to Settings > Integrations and click Add Integration.
  2. In the Integrations Library, click Jenkins Pipeline. The Add Jenkins Pipeline wizard opens.
  3. Create an API token (Step 1 in wizard). To create the token, enter a Token Name and then click Next.
  4. Store API token (Step 2 in wizard). Copy and store the generated Token in a secure location and then click Next. You will need it for the next step in the wizard. The generated token allows API access to Tenable, and should be treated as a secret.
  5. (Recommended) Add Jenkins credential (Step 3 in wizard). To add new global credentials to Jenkins, follow these steps:

    Note: To protect Tenable's API token, it is recommended to use either Jenkins credentials, or some other secret store, if you're currently using one. Jenkins credentials can be stored on multiple levels, depending on how you plan to use Tenable's scanning. It is recommended, but not mandatory, to only associate Tenable's token with pipelines linked to repositories with IaC code.
    1. Log into Jenkins (as a user with the Credentials > Create permission).
    2. From the home page, click Manage Jenkins > Manage Credentials.
    3. Under Stores scoped to Jenkins on the right, click on Jenkins.
    4. Under System, click the Global credentials (unrestricted) link to access the default domain.
    5. Click Add Credentials on the left (or add some credentials if none exist).
      1. From the Kind field, choose Secret text.
      2. From the Scope field, choose Global.
      3. Copy the API token created earlier in the wizard, and paste it in the Secret field.
      4. In the ID field, specify tenable-api-token.
      5. Add an optional Description for the token.
      6. Click OK to save the credentials.

    When finished, click Next in the Cloud Exposure Console wizard.

  6. Add stages (Step 4 in wizard). To generate scan results, add the following Container Image Scan step/s to your Jenkins pipeline, adjusting as needed for your environment:

    Note: To generate scan results, ensure that you have include the environment variables. The TENABLE_API_TOKEN field is sensitive, and should be treated as a secret. It's recommended to run the scan within a Git repository. If for some reason this isn't possible, see Additional Variable for Non-Git Repositories.
    Copy

    Groovy

    pipeline {
       agent any
        stages {
            stage('Checkout') {
                steps {
                    git '<PLACE YOUR REPOSITORY URL HERE>'
                }
            }
            stage('Scan container image with Tenable One Cloud Exposure') {
                environment {
                    TENABLE_API_TOKEN = credentials('tenable-api-token')
                    TENABLE_API_URL = 'https://app.tenable.com/'
                    TENABLE_CODE_BRANCH = "${env.CHANGE_BRANCH ?: env.GIT_BRANCH}"
                    TENABLE_CODE_COMMIT_HASH = "${env.GIT_COMMIT}"
                    TENABLE_CODE_COMMIT_USER = "${env.CHANGE_AUTHOR}"
                    TENABLE_PIPELINE_RUN_ID = "${env.BUILD_ID}"
                    TENABLE_PIPELINE_RUN_TRIGGER = "${currentBuild.getBuildCauses()[0].shortDescription}"
                    TENABLE_PIPELINE_RUN_URL = "${env.BUILD_URL}"
                }
                steps {
                    script {
                            docker.image('tenable/cloud-security-scanner:latest').inside("--entrypoint='' -u 0 --pull=always") {
                                sh 'tenable container-image scan \
                                    --name <place you image name here> \
                                    --no-color \
                                    --output-file-formats JUnit \
                                    --output-path .'
                                junit skipPublishingChecks: true, testResults: 'results.junit.xml'
                               }
                        }
                    }
                }
            }
        }

    Once the action is triggered, you should start seeing scan results in Cloud Exposure under Risks > Container Image CI/CD Scans.

    Note: The above example assumes that you are using the Docker Pipelines plugin.
  7. When done, click Finish.

Additional Variable for Non-Git Repositories

It's recommended to run the scan/sync within a Git repository. If for some reason this isn't possible, it's required to add the following variable, in addition to those listed in the Add Jenkins Pipeline wizard (see Add a Jenkins Pipeline).

Copy
TENABLE_CODE_REPOSITORY_URL=https://github.com/acme/repo1 

Replace the sample value above, as follows:
TENABLE_CODE_REPOSITORY_URL: Replace with the URL of your code repository

Add a Different Pipeline

In addition to the pipelines listed above, Cloud Exposure supports connecting other CI/CD pipelines via a generic workflow. The following procedure gives general instructions for connecting docker-based pipelines, but the actual syntax used when adding environment variables and running the docker scan depend on the specific pipeline, and will need to be adjusted accordingly.

To add a generic pipeline:

  1. In the Cloud Exposure Console, navigate to Settings > Integrations and click Add Integration.
  2. In the Integrations Library, click Generic (Docker). The Add Generic (Docker) wizard opens.
  3. Create an API token (Step 1 in wizard). Enter a name for the token, and then click Next to create the token.
  4. Store the API token (Step 2 in wizard). Copy and store the generated token in a secure location. You will need it for the next step in the wizard. When finished, click Next.
  5. Add environment variables (Step 3 in wizard). Add the following environment variables in the relevant pipeline step to report results to Tenable.

    Note: All variables are required, since Tenable uses them to catalog and display relevant data when you view scan results in the Cloud Exposure Console. In addition to the variables listed here, you can configure any flags included in the Tenable docker image, including global flags, as environment variables to further fine-tune scan settings. See Use Flags as Environment Variables for more information, including how to convert a flag for use as a variable.
    Copy
    TENABLE_API_TOKEN=<api-token here>
    TENABLE_API_URL=https://app.tenable.com/
    TENABLE_PIPELINE_RUN_ID=134235
    TENABLE_PIPELINE_RUN_TRIGGER=pull_request 
    TENABLE_PIPELINE_RUN_URL=https://github.com/acme/repo1/actions/runs/134235 
    Note: Replace the sample values above, as follows: TENABLE_API_TOKEN: Replace with the value displayed in the add-pipeline wizard TENABLE_PIPELINE_RUN_ID: Replace with the run ID of the pipeline TENABLE_PIPELINE_RUN_TRIGGER: Replace with the name of the event that triggered the workflow run TENABLE_PIPELINE_RUN_URL: Replace with the URL where the results of this run can be found

    When finished, click Next.

  6. Run Docker commands (Step 4 in wizard). To scan your container images, add the following step to your pipeline, adjusting it as necessary for your environment. To report scan results to Tenable, ensure that you have added environment variables, as mentioned earlier in this wizard. The TENABLE_API_TOKEN field is sensitive, and should be treated as a secret.

    Note: It's recommended to run the scan within a Git repository. If for some reason this isn't possible, see Additional Variables for Non-Git Repositories.
    Copy

    Dockerfile

    docker run --workdir /tmp/tenable --volume /home/user/code:/tmp/tenable --env-file environment.variables --pull=always tenable/cloud-security-scanner:latest container-image scan --name <your image name>

    The example step above assumes the following:

    • You're using docker run to run Tenable’s scanner in a container.
    • You have created a Docker env file named environment.variables.
    • You're running a scan with the default flags.
    • --env-file — The path in which the environment.variables file you created in the previous step is located.
    • --name — The image name.
    • --volume — Change the left side (before the ":") to the path in which the code is located; keep the right side as is.
  7. When done, click Finish.

Additional Variables for Non-Git Repositories

It's recommended to run the scan/sync within a Git repository. If for some reason this isn't possible, it's required to add the following variables, in addition to those listed in the Add Generic (Docker) wizard (see Add a Different Pipeline).

Copy
TENABLE_CODE_BRANCH=main 
TENABLE_CODE_COMMIT_HASH=fa4e0ef3e25b89e1f6c348afd51b073f2bbcf1bb
TENABLE_CODE_COMMIT_USER=john-doe 
TENABLE_CODE_REPOSITORY_URL=https://github.com/acme/repo1 

Replace the sample values above, as follows:

  • TENABLE_CODE_BRANCH: Replace with the branch name
  • TENABLE_CODE_COMMIT_HASH: Replace with the commit hash of the code
  • TENABLE_CODE_COMMIT_USER: Replace with the username of the user that triggered the initial workflow run
  • TENABLE_CODE_REPOSITORY_URL: Replace with the URL of your code repository

Configure Scan Settings

Configure input parameters to fine-tune how Cloud Exposure scans your environment. Use the relevant method for your pipeline:

Azure Pipelines Parameters

Configure the following task input parameters in the YAML schema of the relevant pipeline in Azure Pipelines to fine-tune how Cloud Exposure scans your environment. For more information about configuring the YAML schema, refer to the relevant Microsoft documentation .

Parameter Description Default Example
apiToken (Required) The API token used to communicate with Cloud Exposure. Generated in the Cloud Exposure Console during initial GitHub Actions setup.
apiUrl (Required) The URL of the Cloud Exposure API. https://app.tenable.com/
excludeVulnerabilities The vulnerability IDs to exclude from the scan, entered as a comma separated list. CVE-2021-44228
failOnMinSeverity

The minimum CVE severity that should return an exit code different from 0, and fail the build workflow. If no value is defined, the workflow will not fail. Possible values:

  • information
  • low medium
  • high
  • critical
critical
failOnMinCvssScore The minimum CVSS score of detected vulnerabilities that should return an exit code different from 0, and fail the build workflow. If no value is defined, the workflow will not fail. Possible values: any number between 0.0 and 10.0 (including decimal points)
failOnMinVprScore The minimum VPR score of detected vulnerabilities that should return an exit code different from 0, and fail the build workflow. If no value is defined, the workflow will not fail. Possible values: any number between 0.0 and 10.0 (including decimal points) 7.8
logs

Whether to print log messages to the standard workflow output. Log messages include information about the run process of the scanner and debug information. Possible values:

  • true
  • false
true
minSeverity

The minimum CVE severity of that you want included in the scan. Possible values:

  • information
  • low
  • medium
  • high
  • critical
information medium
minCvssScore The minimum CVSS score of detected vulnerabilities that you want included in the scan. Possible values: any number between 0.0 and 10.0 (including decimal points) 7.8
minVprScore The minimum VPR score of detected vulnerabilities that you want included in the scan. Possible values: any number between 0.0 and 10.0 (including decimal points) 7.8
name The container name (alpine:latest / alpine / alpine@sha256:51b67269f354137895d43f3b3d810bfacd3945438e94dc5ac55fdac340352f48 / f8c20f8bbcb6 ) alpine:latest alpine:latest
outputFileFormats

The format/s of the report output file/s which is exported. Possible values:

  • cyclonedx
  • json
  • junit
  • md
json json,csv
outputFileName The name of the report output file/s which is exported. If multiple formats are selected, all files will have the same name. results results
outputIncludeIgnoredVulnerabilities A boolean value determining whether to include ignored vulnerabilities in the scan results (no effect on cyclonedx output). false
outputJunitTestNamePrefix Prefix for JUnit test output name. Used to create a first-level hierarchy in test results. Can be used when junit is defined as an output file format. Scan1
outputPath The export path for the report output file/s. results/
registryPassword The password for your private container registry. Used to allow Tenable to authenticate to private registries.
registryUsername The username for your private container registry. Used to allow Tenable to authenticate to private registries.
serverCertificateValidationEnabled

Specifies whether the Azure Pipeline agent or task must perform full SSL/TLS certificate validation when connecting to the remote server.
Possible values:

  • true
  • false
true
silent

Whether to print scan result content to the standard workflow output. Scan result output contains detailed information about issues found during scanning. Independent from logs. Possible values:

  • true
  • false
false false

Additional Parameters Required When Using Classic Release Pipelines

Parameter Description Default Example
codeCommitUser The username of the author who performed the commit.
codeRepositoryUrl The repository URL. https://github.com/orgName/repoName
pipelineRunTrigger The activity that triggered pipeline execution. Manual, PullRequest, BuildCompletion

Example: Send Scan Results via Proxy Server

Use the HTTP_PROXY and HTTPS_PROXY environment variables to send scan results to Cloud Exposure via a proxy server. The following is an example of an Azure Pipelies task that includes these variables:

Copy

YAML

trigger:
- main
pool:
  vmImage: ubuntu-latest
  steps:
  - task: ErmeticContainerImageScan@1
    env:
      HTTP_PROXY: http://localhost:80
      HTTPS_PROXY: https://localhost:443
    inputs:
      apiToken: '$(TENABLE_API_TOKEN)'
      apiUrl: 'https://app.tenable.com/'
      name: 'mongo:7.0.4'
      excludePaths: '/Dev'
      excludeVulnerabilities: 'CVE-2023-22946'
      failOnMinCvssScore: '9.0'
      failOnMinSeverity: 'high'
      logs: true
      minCvssScore: '7.0'
      minSeverity: 'medium'
      outputFileFormats: 'json'
      outputFileName: 'output'
      outputJunitTestNamePrefix: 'jprefix'
      outputPath: '/Dev'
      registryPassword: 'Password1234'
      registryUsername: 'Username1234'

GitHub Action Parameters

Configure the following input parameters in the GitHub action to fine-tune how Cloud Exposure scans your environment.

Parameter Description Default Example
api-token (Required) The API token used to communicate with Cloud Exposure. Generated in the Cloud Exposure Console during initial GitHub Actions setup.
api-url (Required) The URL of the Cloud Exposure API. https://app.tenable.com/
exclude-paths The ability to exclude specific files or directories from scans.
exclude-unresolvable A comma-separated list of vulnerability IDs that do not have a vendor-provided fix or patch to exclude from the scan. false
exclude-vulnerabilities A comma-separated list of vulnerability IDs to exclude from the scan. CVE-2021-44228
fail-on-min-severity

The minimum CVE severity that should return an exit code different from 0, and fail the build workflow. If no value is defined, the workflow will not fail. Possible values:

  • information
  • low
  • medium
  • high
  • critical
critical
fail-on-min-cvss-score The minimum CVSS score of detected vulnerabilities that should return an exit code different from 0, and fail the build workflow. If no value is defined, the workflow will not fail. Possible values: any number between 0.0 and 10.0 (including decimal points) 7.8
fail-on-min-vpr-score The minimum VPR score of detected vulnerabilities that should return an exit code different from 0, and fail the build workflow. If no value is defined, the workflow will not fail. Possible values: any number between 0.0 and 10.0 (including decimal points) 7.8
logs

Whether to print log messages to the standard workflow output. Log messages include information about the run process of the scanner and debug information, such as the number of files/lines scanned. Possible values:

  • true
  • false
true
min-severity

The minimum CVE severity that you want included in the scan. Possible values:

  • information
  • low
  • medium
  • high
  • critical
information medium
min-cvss-score The minimum CVSS score of detected vulnerabilities that you want included in the scan. Possible values: any number between 0.0 and 10.0 (including decimal points) 7.8
min-vpr-score The minimum VPR score of detected vulnerabilities that you want included in the scan. Possible values: any number between 0.0 and 10.0 (including decimal points) 7.8
name The container name alpine:latest / alpine / alpine@sha256:51b67269f354137895d43f3b3d810bfacd3945438e94dc5ac55fdac340352f48 / f8c20f8bbcb6
output-file-formats

The format/s of the report output file/s which is exported. Possible values:

  • cyclonedx
  • json
  • md
json json,csv
output-file-name The name of the report output file/s which is exported. If multiple formats are selected, all files will have the same name. results results
output-include-ignored-vulnerabilities A boolean value determining whether to include ignored vulnerabilities in the scan results (no effect on cyclonedx output). false
output-path The export path for the report output file/s. results/
registry-password The password for your private container registry. Used to allow Tenable to authenticate to private registries.
registry-username The username for your private container registry. Used to allow Tenable to authenticate to private registries.
silent

Whether to print scan result content to the standard workflow output. Scan result output contains detailed information about issues found during scanning. Independent from logs. Possible values:

  • true
  • false
false false
summary

The parameter allows the summary output to be printed at the end of the pipeline step execution. Possible values:

  • true
  • false
true false

Example: Send Scan Results via Proxy Server

Use the HTTP_PROXY and HTTPS_PROXY environment variables to send scan results to Cloud Exposure via a proxy server. The following is an example of a GitHub action that includes these variables:

Copy

YAML

steps:
  - uses: actions/checkout@v3
  - name: Set PROXY environment variables
    run: echo "HTTP_PROXY=http://localhost:80" >> $GITHUB_ENV && echo "HTTPS_PROXY=https://localhost:443" >> $GITHUB_ENV
  - name: Scan IaC with Tenable One Cloud Exposure
    uses: ermetic/actions/iac/scan@v1
    with:
      api-token: ${{ secrets.TENABLE_API_TOKEN }}
      api-url: https://app.tenable.com/

GitLab CI/CD Parameters

Configure the following input parameters in the GitLab CI/CD to fine-tune how Cloud Exposure scans your environment.

Parameter Description Default Example
api-token (Required) The API token used to communicate with Cloud Exposure. Generated in the Cloud Exposure Console during initial GitLab CI/CD setup.
api-url (Required) The URL of the Cloud Exposure API. https://app.tenable.com/
name (Required) The container name (alpine:latest / alpine / alpine@sha256:51b67269f354137895d43f3b3d810bfacd3945438e94dc5ac55fdac340352f48 / f8c20f8bbcb6 ) alpine:latest
stage (Required) The GitLab CI/CD pipeline stage to run the job. tenable-cloud-security
exclude-paths The ability to exclude specific files or directories from scans.
exclude-unresolvable A comma-separated list of vulnerability IDs that do not have a vendor-provided fix or patch to exclude from the scan. false
exclude-vulnerabilities A comma-separated list of vulnerability IDs to exclude from the scan. CVE-2021-44228
fail-on-min-cvss-score The minimum CVSS score of detected vulnerabilities that should return an exit code different from 0, and fail the build workflow. If no value is defined, the workflow will not fail. Possible values: any number between 0.0 and 10.0 (including decimal points) 7.8
fail-on-min-vpr-score The minimum VPR score of detected vulnerabilities that should return an exit code different from 0, and fail the build workflow. If no value is defined, the workflow will not fail. Possible values: any number between 0.0 and 10.0 (including decimal points) 7.8
fail-on-min-severity

The minimum CVE severity that should return an exit code different from 0, and fail the build workflow. If no value is defined, the workflow will not fail. Possible values:

  • information
  • low
  • medium
  • high
  • critical
critical
logs Whether to print log messages to the standard workflow output. Log messages include information about the run process of the scanner and debug information, such as the number of files/lines scanned. Possible values: true false false true
min-cvss-score The minimum CVSS score of detected vulnerabilities that you want included in the scan. Possible values: any number between 0.0 and 10.0 (including decimal points) 7.8
min-vpr-score The minimum VPR score of detected vulnerabilities that you want included in the scan. Possible values: any number between 0.0 and 10.0 (including decimal points) 7.8
min-severity

The minimum CVE severity that you want included in the scan. Possible values:

  • information
  • low
  • medium
  • high
  • critical
information medium
output-file-formats

The format/s of the report output file/s which is exported. Possible values:

  • cyclonedx
  • json
  • junit
  • md
json json,csv
output-file-name The name of the report output file/s which is exported. If multiple formats are selected, all files will have the same name. results results
output-include-ignored-vulnerabilities A boolean value determining whether to include ignored vulnerabilities in the scan results (no effect on cyclonedx output). false
output-junit-test-name-prefix Prefix for JUnit test output name. Used to create a first-level hierarchy in test results. Can be used when junit is defined as an output file format. Scan1
output-path The export path for the report output file/s. results/
registry-password The password for your private container registry. Used to allow Tenable to authenticate to private registries.
registry-username The username for your private container registry. Used to allow Tenable to authenticate to private registries.
silent

Whether to print scan result content to the standard workflow output. Scan result output contains detailed information about issues found during scanning. Independent from logs. Possible values:

  • true
  • false
false true

CLI in Tenable Docker Image

Configure the following commands via the Tenable Docker image CLI to fine-tune how Tenable scans your environment.

Note: The image is extracted when you connect your CI/CD pipeline to Tenable.

Usage:

Copy
tenable container-image scan [flags]

Flags:

Copy
--api-token string                        It is required to provide these parameters in order to send the scan results to Tenable for CVE detection 
--api-url string                          It is required to provide these parameters in order to send the scan results to Tenable for CVE detection
--archive-path string                     path to image tar archive
--code-branch string                      (auto detected)
--code-commit-hash string                 (auto detected)
--code-commit-user string                 (auto detected)
--code-repository-url string              (auto detected)
--exclude-unresolvable strings            exclude vulnerability IDs that do not have a fix or patch (default "false")
--exclude-vulnerabilities strings         exclude vulnerability IDs
--fail-on-min-cvss-score float            minimum cvss score that should return an exit code different from 0
--fail-on-min-vpr-score float             minimum vpr score that should return an exit code different from 0
--fail-on-min-severity string             minimum severity that should return an exit code different from 0
--help, -h                                help for scan
--json-version-legacy                     
--min-cvss-score float                    The minimum CVSS score of detected vulnerabilities that you want included in the scan
--min-vpr-score float                     The minimum VPR score of detected vulnerabilities that you want included in the scan             
--min-severity string                     information ,low, medium, high, critical (default "information")
--name string                             image name alpine:latest / alpine / alpine@sha256:51b67269f354137895d43f3b3d810bfacd3945438e94dc5ac55fdac340352f48 / f8c20f8bbcb6
--output-file-formats strings             cyclone-dx,json,j-unit,md (default [json])
--output-file-name string                 (default "results")
--output-include-ignored-vulnerabilities  A boolean value determining whether to include ignored vulnerabilities in the scan results
--output-junit-test-name-prefix string    
--output-path string                      
--pipeline-run-id string                  
--pipeline-run-trigger string             
--pipeline-run-url string                 
--registry-password string                
--registry-username string                
--server-certificate-validation-enabled    (default "true")
Important: Keep in mind: When running the docker command locally, if you want to access an output file using the --output-path flag, use the -v argument in the command to create a mapping between the docker folder and your local folder. In the following example, local-output represents where you want to store the file locally, and docker-output represents the corresponding docker directory.
Copy
docker run -v ./local-output:/docker-output--env-file environment.variables --pull=always tenable/cloud-security-scanner:latest container-image scan --name storm:latest --output-file-formats json --output-path /docker-output

Global Flags:

Copy
--logs       print log messages to standard output
--no-color   print output without color
--silent     do not print output to standard output

Use Flags as Environment Variables

When you add a generic docker pipeline to Cloud Exposure, you configure a set of environment variables. Tenable uses these variables to catalog and display relevant data when you view scan results in the Tenable Console. For more advanced configuration requirements, and to further fine-tune scan settings, you can also configure all flags included in the Tenable docker image, including global flags, as environment variables.

Flag vs Environment Variable Syntax

CLI flags and environment variables use different syntax. Use the following procedure to convert any given flag into an environment variable.

To convert flag syntax for use as an environment variable:

  1. Remove the dashes before the flag name.
  2. Replace any dashes with underscores.
  3. Type TENABLE_ (with an underscore) as a preface.
  4. Use ALL CAPS.
  5. Boolean flags (see Global Flags) should be set to TRUE to activate.

So, for example, the --code-repository-url flag becomes TENABLE_CODE_REPOSITORY_URL, when used as an environment variable.