Eze the one stop solution for security testing in modern development, image with pre installed tools
3.9K
Eze the one stop solution developed by RiverSafe Ltd for security testing in modern development
The eze-cli Dockerfile contains the eze cli, and a selection of common opensource tools out the box
Eze cli scans can help you find vulnerable dependencies, insecure code, hardcoded secrets, and license violations across a range of languages
Please contact [email protected] for help/enquires with Eze cli
Simple usage, mount your codebase into volume /data, then run docker with "test" argument, and generate a configuration file ".ezerc.toml" based off the current codebase
docker run -t -v FOLDER_TO_SCAN:/data riversafe/eze-cli test
add -t to docker to enable terminal colours
add --debug to docker to enable terminal colours
for sysadmin and power users wanting to build their own images, see the README-DEVELOPMENT.md
These commands will run a security scan against code in the current folder
| CLI | Command |
|---|---|
| linux/mac os bash | docker run -it -v "$(pwd)":/data riversafe/eze-cli test |
| windows git bash | docker run -it -v $(pwd -W):/data riversafe/eze-cli test |
| windows powershell | docker run -it -v ${PWD}:/data riversafe/eze-cli test |
| windows cmd | docker run -it -v %cd%:/data riversafe/eze-cli test |
| Language | SBOM | SCA | SAST |
|---|---|---|---|
| Java | Y | Y | Y |
| Node | Y | Y | Y |
| Python | Y | Y | Y |
| C# | Y | Y | Y |
| Docker | Y* | Y* | Y |
| Terraform | Y | ||
| Go | Y | ||
| Ruby | Y | ||
| ocaml | Y | ||
| PHP | Y |
Eze runs off a local .ezerc.toml file, when this config is not present, a sample config will be generated automatically by scanning the codebase (eze test). You can customise it to:
When .ezerc.toml is not present, Eze will auto configure tools according to a "autoconfig.json" file, and generated a .ezerc.toml for you
The default autoconfig settings is in "eze/data/default_autoconfig.json"
Can be set to a custom file with --autoconfig flag
docker run -t -v FOLDER_TO_SCAN:/data riversafe/eze-cli test --autoconfig PATH
{
"_help_message": "<DEVELOPER COMMENTS>",
"license": {
"_help_message": "eze.enums.LicenseScanType value",
"license_mode": "PROPRIETARY|PERMISSIVE|OPENSOURCE|OFF"
},
"tools": {
"<tool-id>": {
"_help_message": "<DEVELOPER COMMENTS>",
"enabled_always": "true or false",
"enable_on_file": [
"<LIST OF FILE NAMES IF FOUND WILL ENABLE TOOL>"
],
"enable_on_file_ext": [
"<LIST OF FILE EXTENSIONS IF FOUND WILL ENABLE TOOL>"
],
"config": {
"<FIELD>": "<VALUE>"
}
}
},
"reporters": {
"<reporter-id>": {
"_help_message": "LISTED REPORTERS ARE ALWAYS ENABLED",
"config": {
"<FIELD>": "<VALUE>"
}
}
}
}
Normally when a project is checked out of git, the location can be read from the .git folder.
For CI servers git is check out headlessly (with no .git) and environments are provided for git repo / build number etc, eze will read these environment variables when detecting headless git repos.
These environment variables will need to be feed to eze's docker image.
aka for ado pipeline
docker run --rm -e "BUILD_SOURCEBRANCHNAME=$BUILD_SOURCEBRANCHNAME" -e "BUILD_REPOSITORY_URI=$BUILD_REPOSITORY_URI" -e "SYSTEM_PULLREQUEST_SOURCEBRANCH=$SYSTEM_PULLREQUEST_SOURCEBRANCH" -v "$(pwd)":/data riversafe/eze-cli test
| CI server | Environment Variables |
|---|---|
| ADO | BUILD_SOURCEBRANCH BUILD_SOURCEBRANCHNAME SYSTEM_PULLREQUEST_SOURCEBRANCH |
| AWS Amplify | AWS_BRANCH |
| AWS Codebuild | AWS_BRANCH |
| JENKINS | GIT_LOCAL_BRANCH GIT_BRANCH |
| IBMCLOUD toolchain | GIT_BRANCH |
| GCP | BRANCH_NAME |
| Gitlab CI | CI_COMMIT_BRANCH CI_MERGE_REQUEST_TARGET_BRANCH_NAME CI_EXTERNAL_PULL_REQUEST_TARGET_BRANCH_NAME CI_DEFAULT_BRANCH |
| Github CI | GITHUB_REF |
On top of the auto-configuration, you can edit your local .ezerc.toml to run custom tools with custom configuration
When a .ezerc.toml is present, this will be used instead of the autoconfiguration settings
see list of available tools and reporters using these commands
docker run -t riversafe/eze-cli tools list
docker run -t riversafe/eze-cli tools help <TOOL>
docker run -t riversafe/eze-cli reporters list
docker run -t riversafe/eze-cli reporters help <TOOL>
https://en.wikipedia.org/wiki/TOML
# create template with "docker run -t --rm -v DIRECTORY:/data riversafe/eze-cli housekeeping create-local-config'"
# ===================================
# GLOBAL CONFIG
# ===================================
[global]
# LICENSE_CHECK
LICENSE_CHECK = "PROPRIETARY|PERMISSIVE|OPENSOURCE|OFF"
# LICENSE_ALLOWLIST, list of licenses to exempt from license checks
LICENSE_ALLOWLIST = []
# LICENSE_DENYLIST, list of licenses to always report usage as a error
LICENSE_DENYLIST = []
# ========================================
# TOOL CONFIG
# ========================================
[TOOL_1]
# Full List of Fields and Tool Help available "docker run riversafe/eze-cli tools help <TOOL_NAME>"
TOOL_CONFIG_FIELD = "TOOL_CONFIG_VALUE"
[TOOL_2]
"..." = "..."
# ========================================
# REPORT CONFIG
# ========================================
[REPORTER_1]
# Full List of Fields and Reporter Help available "docker run riversafe/eze-cli reporters help REPORTER_NAME"
REPORTER_CONFIG_FIELD = "REPORTER_CONFIG_VALUE"
[REPORTER_2]
"..." = "..."
# ========================================
# SCAN CONFIG
# ========================================
[scan]
tools = ["TOOL_1","..."]
reporters = ["REPORTER_1", "..."]
| Type | Name | Version | License | Description |
|---|---|---|---|---|
| SCA | anchore-grype | 0.33.1 | Apache-2.0 | opensource multi language SCA and container scanner |
| SBOM | anchore-syft | 0.39.3 | Apache-2.0 | opensource multi language and container bill of materials (SBOM) generation utility |
| SCA | container-trivy | 0.18.2 | Apache-2.0 | opensource container scanner |
| SBOM | dotnet-cyclonedx | 2.3.0.0 | Apache-2.0 | opensource C#/dotnet bill of materials (SBOM) generation utility |
| SECRET | gitleaks | 7.5.0 | MIT | opensource static key scanner |
| SCA | kics | 1.5.2 | Apache-2.0 | opensource infrastructure scanner |
| SBOM | java-cyclonedx | 2.5.3 | Apache-2.0 | opensource java bill of materials (SBOM) generation utility, also runs SCA via osv |
| SCA | java-dependencycheck | 7.0.0 | Apache-2.0 | opensource java SCA tool class |
| SAST | java-spotbugs | 4.5.3 | LGPL | opensource java SAST tool class |
| SCA | node-npmaudit | 8.5.1 | NPM | opensource node SCA scanner |
| SCA | node-npmoutdated | 8.5.1 | NPM | opensource node outdated dependency scanner |
| SBOM | node-cyclonedx | 3.4.1 | Apache-2.0 | opensource node bill of materials (SBOM) generation utility |
| SAST | python-safety | 1.10.3 | MIT | opensource python SCA scanner |
| SCA | python-piprot | 0.9.11 | MIT | opensource python outdated dependency scanner |
| SAST | python-bandit | 1.7.3 | Apache-2.0 | opensource python SAST scanner |
| SBOM | python-cyclonedx | 3.0.0 | Apache-2.0 | opensource python bill of materials (SBOM) generation utility, also runs SCA via pypi |
| MISC | raw | 0.15.0-alpha | inbuilt | input for saved eze json reports |
| SAST | semgrep | 0.82.0 | LGPL | opensource multi language SAST scanner |
| SECRET | trufflehog | 3.0.4 | GPL | opensource secret scanner |
An updated list of tools, licenses, and sizes pre-installed in latest Eze Cli Dockerimage can be found using the command
docker run -t --rm riversafe/eze-cli tools list
docker run -t --rm riversafe/eze-cli tools help <tool-name>
# aka docker run -t --rm riversafe/eze-cli tools help trufflehog
| Name | Version | License | Description |
|---|---|---|---|
| console | 0.15.0-alpha | inbuilt | standard command line reporter |
| json | 0.15.0-alpha | inbuilt | json output file reporter |
| s3 | 0.15.0-alpha | inbuilt | s3 uploader reporter |
| junit | 0.15.0-alpha | inbuilt | junit output file reporter |
| quality | 0.15.0-alpha | inbuilt | quality gate check reporter |
| eze | 0.15.0-alpha | inbuilt | eze management console reporter |
| bom | 0.15.0-alpha | inbuilt | json cyclonedx bill of materials reporter |
| bom-formatted | 0.22.0 | Apache-2.0 | bill of materials multiformat reporter |
| sarif | 0.15.0-alpha | inbuilt | sarif output file reporter |
| markdown | 0.15.0-alpha | inbuilt | markdown output file formatter |
| html | 0.15.0-alpha | inbuilt | html output file formatter |
An updated list of reporters can be found using the command
docker run -t --rm riversafe/eze-cli reporters list
docker run -t --rm riversafe/eze-cli reporters help <reporter-name>
# aka docker run -t --rm riversafe/eze-cli reporters help console
Started a local eze scan but want to stop the scan without waiting the 30-40 seconds for the scan to complete
To immediately stop a docker image do the following
# get docker container id
$ docker stats
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
f0bef6e0bba7 optimistic_burnell 0.01% 104.8MiB / 12.33GiB 0.83% 221MB / 4.73MB 0B / 0B 17
# docker stop container id
$ docker stop -t 0 f0bef6e0bba7
(Windows) Mounted volumes are extremely slow, by default eze will copy source files into a tmp folder for use by SAST tools, this will speed up scans be as much as 80%, as don't need to needlessly scan depedencies or compiled assets
You can turn this off with
docker run -t -e "USE_SOURCE_COPY=false" -v FOLDER_TO_SCAN:/data riversafe/eze-cli test
Many tools such as maven and npm download dependencies from the internet
Maven can be slow downloading all the artifacts it requires
When you provide a persistent .m2 folder which will speed up scans from 100s to as low as 20s per tool
# example of sharing your local .m2
docker run -t -v LOCATION:/data -v ~/.m2/:/home/ezeuser/.m2/ eze-cli test
Dotnet can be slow downloading all the artifacts it requires
When you provide a persistent .nuget/packages/ folder which will speed up scans
# example of sharing your local .nuget/packages/
docker run -t -v LOCATION:/data -v ~/.nuget/packages/:/home/ezeuser/.nuget/packages/ eze-cli test
NPM can be slow downloading all the artifacts it requires
When you provide a persistent .npm/ folder which will speed up scans
ps your local node_modules will help as well
# example of sharing your local .npm
docker run -t -v LOCATION:/data -v ~/.npm/:/home/ezeuser/.npm/ eze-cli test
terraform can be slow downloading all the artifacts it requires
When you provide a persistent .terraform.d/ folder which will speed up scans
ps your local node_modules will help as well
# example of sharing your local .terraform.d
docker run -t -v LOCATION:/data -v ~/.terraform.d/:/home/ezeuser/.terraform.d/ eze-cli test
It's recommended for organisations with mature devops teams to download and tailor this Docker image, adding/removing the pre-installed security tools as needed to optimise size of the image, as well as making their own .ezerc.toml files.
*Aka: Some tools for example semgrep are upto 200mb by themselves, tailoring the image to remove unused tools will save significant amounts of space
Dockerfile Source: https://github.com/RiverSafeUK/eze-cli
Content type
Image
Digest
sha256:9355cc62c…
Size
574.8 MB
Last updated
almost 4 years ago
docker pull riversafe/eze-cli