Connect Container Image CI/CD Pipelines
Connect your CI/CD pipeline to Tenable One Cloud Exposure, and grant access to the relevant code repository.
- Add Azure Pipelines
- Add GitHub Actions
- Add a GitLab Pipeline
- Add a Jenkins Pipeline
- Add a Different Pipeline
This is an integration guide for connecting container image CI/CD pipelines to Tenable.
- For a how-to guide about viewing scan results, see Container Image CI/CD.
- For an overview of container image scanning capabilities in Tenable, see Container Image Scanning.
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:
- In the Cloud Exposure Console, navigate to Settings > Integrations and click Add Integration.
- In the Integrations Library, click Azure Pipelines. The Add Azure Pipelines wizard opens.
- Create an API token (Step 1 in wizard). To create the token, enter a Token Name and then click Next.
- 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.
- Install the Tenable Azure DevOps extension (Step 3 in wizard):
- Click this link to access the extension from the Visual Studio marketplace.
- Click Get it free. There is no added cost for using the extension.
- Select the relevant Azure DevOps organization, and then click Install.
- The extension is now installed, and you can click Proceed to organization to go to your Azure DevOps site.
-
(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.- Log into Azure DevOps and click Pipelines.
- Select the relevant pipeline, and then click Edit.
- Click Variables.
- Click on the plus sign (+) or on New variable.
-
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.
- Add tasks. Add the Cloud Exposure Container Image Scan task to your Azure Pipelines (Step 5 in wizard):
- Log into Azure DevOps and click Pipelines.
- Click on the three dots next to the relevant pipeline, and then click Edit.
- In your code, select the stage where you want to add Tenable’s task.
- In the task assistant, search for and click the Cloud Exposure Container Image Scan task.
-
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).
- Save the updated pipeline YAML. Once the action is triggered, you should start seeing scan results under Risks > Container Image CI/CD Scans.
- 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:
- In the Cloud Exposure Console, navigate to Settings > Integrations and click Add Integration.
- In the Integrations Library, click GitHub Actions. The Add GitHub Actions wizard opens.
- Create an API token (Step 1 in wizard). Enter a name for the token, and then click Next to create the token.
- 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.
-
(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:
- On GitHub.com, navigate to the main page of the repository.
- Under your repository name, click Settings.
- In the Security section of the sidebar, select Secrets, then click Actions.
- Click New repository secret.
- Type TENABLE_API_TOKEN in the Name input box.
- Enter the value of the token that you created in the previous step.
- Click Add secret.
When finished, click Next in the Cloud Exposure Console wizard.
-
Add actions (Step 4 in wizard). Add the following Container Image Scan action to your GitHub workflow:
CopyYAML
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.
- 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:
- In the Cloud Exposure Console, navigate to Settings > Integrations and click Add Integration.
- In the Integrations Library, click GitLab CI/CD. The Add GitLab CI/CD wizard opens.
- Create an API token (Step 1 in wizard). To create the token, enter a Token Name and then click Next.
- 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.
-
(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.- Log into GitLab.
- Go to your project’s Settings > CI/CD.
- Under Variables, click Expand.
- Click Add variable.
-
Fill in the following details:
- Set Key to TENABLE_API_TOKEN.
- Paste the token created in the previous step as the Value.
- Select an Environment scope, if applicable.
- Under Flags, check the box that says Mask variable.
- Click Add variable.
When finished, click Next in the Cloud Exposure Console wizard.
-
Add stages (Step 4 in wizard). Add the following Container Image Scan step to your .gitlab-ci.yml file:
CopyYAML
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-securityAfter the scan is triggered, you should start seeing scan results in Cloud Exposure under Risks > Container Image CI/CD Scans.
- 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
- In the Cloud Exposure Console, navigate to Settings > Integrations and click Add Integration.
- In the Integrations Library, click Jenkins Pipeline. The Add Jenkins Pipeline wizard opens.
- Create an API token (Step 1 in wizard). To create the token, enter a Token Name and then click Next.
- 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.
-
(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.- Log into Jenkins (as a user with the Credentials > Create permission).
- From the home page, click Manage Jenkins > Manage Credentials.
- Under Stores scoped to Jenkins on the right, click on Jenkins.
- Under System, click the Global credentials (unrestricted) link to access the default domain.
-
Click Add Credentials on the left (or add some credentials if none exist).
- From the Kind field, choose Secret text.
- From the Scope field, choose Global.
- Copy the API token created earlier in the wizard, and paste it in the Secret field.
- In the ID field, specify tenable-api-token.
- Add an optional Description for the token.
- Click OK to save the credentials.
When finished, click Next in the Cloud Exposure Console wizard.
-
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.CopyGroovy
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. - 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).
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:
- In the Cloud Exposure Console, navigate to Settings > Integrations and click Add Integration.
- In the Integrations Library, click Generic (Docker). The Add Generic (Docker) wizard opens.
- Create an API token (Step 1 in wizard). Enter a name for the token, and then click Next to create the token.
- 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.
-
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.CopyTENABLE_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/134235Note: 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 foundWhen finished, click Next.
-
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.CopyDockerfile
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.
- 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).
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:
|
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 | |
| minSeverity |
The minimum CVE severity of that you want included in the scan. Possible values:
|
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:
|
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.
|
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:
|
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:
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:
|
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 | |
| min-severity |
The minimum CVE severity that you want included in the scan. Possible values:
|
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:
|
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:
|
false | false |
| summary |
The parameter allows the summary output to be printed at the end of the pipeline step execution. Possible values:
|
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:
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:
|
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 | medium |
| output-file-formats |
The format/s of the report output file/s which is exported. Possible values:
|
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:
|
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.
Usage:
tenable container-image scan [flags]
Flags:
--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")
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:
--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:
- Remove the dashes before the flag name.
- Replace any dashes with underscores.
- Type TENABLE_ (with an underscore) as a preface.
- Use ALL CAPS.
- 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.