This orb can be used to run SAST analysis tools via the CI against your codebase. It currently has support for scanning:
- Dockerfiles
- Terraform
- Python
- Scala
- TypeScript
- JavaScript
- Go
All tooling within this Orb has been selected in cooperation with OVO SecEng.
This command will install Semgrep into the environment ready for use. It allows a version to be specified, but if none is selected it will install the latest version.
Parameters
version
- the version of Semgrep to install. Defaults to the latest.
This command will scan a Dockerfile for security vulnerabilities. It runs the tool Hadolint.
Parameters
dockerfile
- the Dockerfile to scan.ignore-rules
- comma-separated list of any vulnerability rules you choose to ignore.trusted-registries
- comma-separated list of trusted registries (e.g.docker.io,my-company.com:5000
) if set, returns an error if Dockerfile use any images from registries not included in this list.
This command will scan Python code for security vulnerabilities. It runs the tool Semgrep to perform the scans.
Parameters
directory
- the directory containing the source code to scan. Defaults to the root of the repository.
This command will scan Scala code for security vulnerabilities. It runs the tool Semgrep to perform the scans.
Parameters
directory
- the directory containing Scala code to scan. Defaults to the root of the repository.
This command will scan TypeScript code for security vulnerabilities. It runs the tool Semgrep to perform the scans.
Parameters
directory
- the directory containing the source code to scan. Defaults to the root of the repository.
This command will scan JavaScript code for security vulnerabilities. It runs the tool Semgrep to perform the scans.
Parameters
directory
- the directory containing the source code to scan. Defaults to the root of the repository.
This command will scan Go code for security vulnerabilities. It runs the tool Semgrep to perform the scans.
Parameters
directory
- the directory containing the source code to scan. Defaults to the root of the repository.
This command runs Checkov static code analysis via the CLI with the specified configuration options.
Parameters
directory
- directory with infrastructure code to scanconfig_file
- checkov configuration filebaseline
- Path to a .checkov.baseline file to compare. Report will include only failed checks that are not in the baseline. If one is not specified, the orb will look for one in the directory and use that as a default
version: '2.1'
orbs:
sast: ovotech/sast@1
workflows:
lint:
jobs:
- sast/scan_dockerfile:
dockerfile: circleci-orbs/sast/examples/Dockerfile
In order to ignore rules that would otherwise cause failed pipeline runs you can add them as a comma-seperated list after the parameter ignore-rules
version: '2.1'
orbs:
sast: ovotech/sast@1
workflows:
lint:
jobs:
- sast/scan_dockerfile:
dockerfile: circleci-orbs/sast/examples/Dockerfile
ignore-rules: 'DL4005,DL3008'
version: '2.1'
orbs:
sast: ovotech/sast@1
workflows:
lint:
jobs:
- sast/scan_python:
directory: ./src
version: '2.1'
orbs:
sast: ovotech/sast@1
workflows:
lint:
jobs:
- sast/scan_scala:
directory: ./src
version: '2.1'
orbs:
sast: ovotech/sast@1
workflows:
lint:
jobs:
- sast/scan_typescript:
directory: ./src
version: '2.1'
orbs:
sast: ovotech/sast@1
workflows:
lint:
jobs:
- sast/scan_javascript:
directory: ./src
version: '2.1'
orbs:
sast: ovotech/sast@1
workflows:
lint:
jobs:
- sast/scan_golang:
directory: ./src
version: '2.1'
orbs:
sast: ovotech/sast@1
workflows:
lint:
jobs:
- sast/scan_terraform:
directory: terraform/examples
In order to generate a baseline against which you want to track changes, you can run the Checkov CLI locally with the following flag to create that baseline which you should then commit to version control:
checkov -d terraform/examples/ --create-baseline
The baseline file keeps track of all the vulnerabilities in your IaC at the point when it was generated. On subsequent scans, Checkov will only fail if there are additional vulnerabilities discovered compared to the baseline file.
The following example shows how to run a scan with with the orb whilst passing in your baseline file:
version: '2.1'
orbs:
sast: ovotech/sast@1
workflows:
lint:
jobs:
- sast/scan_terraform:
directory: terraform/examples
baseline: terraform/examples/.checkov.baseline