
This image can be used to integrate continuous security into your CI/CD pipeline using the ZeroNorth platform. For more information, please visit ZeroNorth at [***]
System level environment variables
| Name | Description | Allowed Values | Default |
|---|---|---|---|
| PROJECT_NAME | A unique name for this project. (Deprecated: Now using policy name.) | Sample Project | |
| CYBRIC_USER | Your ZeroNorth username (email) | ||
| CYBRIC_PASSWORD | Your ZeroNorth password | ||
| CYBRIC_API_KEY | An alternate way to specify your ZeroNorth credentials | ||
| CYBRIC_ENVIRONMENT | Which ZeroNorth environment to use to scan. | development, production, {hostname suffix} | production |
| API_URL | Override the API hostname | ||
| UI_URL | Override the UI hostname | ||
| UPLOAD_URL | Override the upload server hostname | ||
| SONARQUBE_URL | Override the hostname to the Sonarqube server | ||
| BLACKDUCKHUB_URL | Override the hostname to the BlackDuckHub server | ||
| CYBRICFILE_FILENAME | The name of the Cybricfile to use. | .cybric.yml | |
| INTEGRATION_NAME | A unique name for artifact integration. | Sample Integration | |
| LOG_LEVEL | The log level to use. | DEBUG, INFO, WARN, ERROR | INFO |
| OUTPUT_FORMAT | The format to write the scan results out in. | JSON,XML | JSON |
| WAIT_FOR_COMPLETION | If set to 'true', the IC will initiate a scan and wait for it to finish. NOTE A value of 'false' is inappropriate in a CI scenario where you need to know whether vulnerabilities were found in order to fail a build. | true,false | false |
| STAGE | The stage to execute. | SOURCE, BUILD, CONTAINER, HOST | SOURCE |
| PATH_TARGET | Sets the url path for a target | ||
| POLICY_ID | Set to the ID of an existing policy or leave unset to create a new one for this project. | Existing policy ID or unset | unset |
| POLICY_NAME | Value is used to search for the existing policies. If multiple policies are found for a given name it will exit and ask to specifiy the POLICY_ID on the command line. | Sample Policy | |
| PORT_TARGET | Sets the port for a target | ||
| PROTOCOL_TARGET | Sets the protocol used for a target | https://, http:// | |
| TARGET_ID | Set the ID of an existing target to use during policy creation (If policy already exists, target from the policy will take precedence). | ||
| TARGET_NAME | Value is used to search for existing targets during policy creation. If multiple targets are found for a given name it will exit and ask to specifiy the TARGET_ID on the command line | ||
| SCENARIO | The scenario to use to scan your hosts and artifacts. Use the scenarios.py tool (see below) to find a list of activated scenarios and specify its name here. If you don't see the list that you expect, contact your ZeroNorth administrator, or ZeroNorth directly. | Scenario Name | |
| HOST_TARGET | The hostname or IP address of the host to scan | Must be a publicly visible host | |
| INCLUDE_FILES | A comma-separated list of glob specifications for files to include in the scan. | ||
| EXCLUDE_FILES | A comma-separated list of glob specifications for files to exclude from the scan. | ||
| FAIL_ON_HIGH_SEVERITY | Exit with a failure code if issues are found that cross the specified threshold. If set to '1' or 'CRITICAL', will fail if critical issues are found. If set to '0', will completely disregard issue criticality. If set to 'HIGH', 'MEDIUM', 'LOW' or 'INFO', will fail if issues are found at the specified level or higher. | 1, 0, CRITICAL, HIGH, MEDIUM, LOW, INFO | 0 |
| S3_PATH | To pull artifacts from an S3 bucket directly. Use the AWS CLI format for S3 URLs (s3://bucket/directory/ or s3://bucket/filename.tgz) | ||
| MSBUILD_OVERRIDE | Override the default MSBuild options for SonarQube | unset | |
| SONARQUBE_OVERRIDE | Override the default SonarQube MSBuild Runner options for SonarQube | unset | |
| TAGS | A comma-separated list of tags to add to the scan | unset | |
| VERIFY_SSL | Whether or not to verify SSL connections to the ZeroNorth hosts. This is useful if you have your own installation of ZeroNorth and you're having problems using the generated root CA certificate. | true, false | true |
| ZAP_PORT | Changes the zap runners default port | 8080 | |
| CUSTOMER_ARTIFACTS_PATH | See section bellow | File path | /shared/customer_artifacts |
Docker specific environment variables
These values must be specified if you've set STAGE to container.
| Name | Description | Default |
|---|---|---|
| REGISTRY_USER | The user to authenticate with the registry as. | |
| REGISTRY_PASSWORD | The password of the registry user. | |
| REGISTRY_URL | The URL of the Docker registry where the images are stored. | DockerHub |
| DOCKER_IMAGE | The image to scan. If it's in a private registry, it must be fully qualified. |
Specifying proxy settings
If you need to use a proxy server, you can pass the following variables in:
| Name | Description |
|---|---|
| HTTP_PROXY | Hostname and port to use for proxied HTTP requests |
| HTTPS_PROXY | Hostname and port to use for proxied HTTPS requests |
| NO_PROXY | Comma-separated list of hosts to bypass the proxy for |
Integration with the ZeroNorth platform can happen in 5 separate stages:
If you're using the ZeroNorth shared SaaS platform, this should always be set to the default value of production (unless you're a ZeroNorth engineer).
If you're running your own private instance of the ZeroNorth platform in AWS, this should be set to the hostname suffix of your installation. For example, if your ZeroNorth hostname is https://fabric.example.com, then set CYBRIC_ENVIRONMENT to example.com. If your installation is at https://fabric.cybric.company.com then set CYBRIC_ENVIRONMENT to cybric.company.com
If you're running ZeroNorth in a virtual machine and the ZeroNorth services don't have the standard hostnames (api, fabric, uploads), then set CYBRIC_ENVIRONMENT to vm and set the following variables to their correct values:
For example: CYBRIC_ENVIRONMENT=vm API_URL=http://api:7123 UI_URL=http://ui:7223 UPLOAD_URL=http://upload:1080
By default the Bamboo service (API) runs on port 7123, Burlap (UI) runs on 7223 and the upload service runs on 1080. If these services are being load balanced, then just set the URLs to point at the load ***s.
You can limit the number of files sent to ZeroNorth by using the INCLUDE_FILES and EXCLUDE_FILES variables. These parameters use the Unix globbing syntax.
The values passed to these variables can be a comma-separated list if you need to specify multiple types of files (eg, *.js,*.py,*.html).
If neither variable is specified, all files within the code directory will be included and sent to ZeroNorth.
If only the INCLUDE_FILES variable is specified, then only files matching the specified patterns will be included. If only the EXCLUDE_FILES variable is specified, all files with the exception of files matching the pattern will be included. If both are specified, the files in the code directory will first be filtered by the patterns in INCLUDE_FILES and then be filtered by the patterns in EXCLUDE_FILES.
If you'd like to see whether a file was included or excluded, enable debugging by setting LOG_LEVEL to debug. NOTE: This will be VERY noisy and is only recommended for debugging purposes.
The SCENARIO variable will need to be configured with the name of the scenario that you'd like to use to scan your hosts and artifacts. To get a list of what's currently available, run the scenarios script:
Do not specify both a SCENARIO and a POLICY_ID since these are mutually exclusive.
bashdocker run -e CYBRIC_USER=[your zeronorth username] -e CYBRIC_PASSWORD=[your zeronorth password] zeronorth/integration:latest python scenarios.py
We will return the names of the scenarios that your administrator has activated and what they can be applied to. Use this table to map a scenario's type to the STAGE that it can be run with.
| Type | Stage |
|---|---|
| repository | SOURCE |
| build | BUILD |
| container | CONTAINER |
| instance | HOST |
The container requires 2 bind mounted volumes:
/code is the location to your source or build artifacts.
/results is the location where the container will dump the scan results to a file named scan.out
NOTE: If you're using S3_PATH, then you don't need to mount the /code volume since your code will be pulled from S3.
You can optionally add a third volume mount to use a custom certificate authority. This is useful if you're running a private ZeroNorth instance and you've signed your SSL certificates with your own certificate authority. This will enable the integration container to trust your CA.
Create a folder on your local or build machine containing your CA root certificate in pem format and mount that directory to /usr/local/share/ca-certificates
For example:
bash-v /mnt/custom_ca:/usr/local/share/ca-certificates/
On startup, the integration container will copy any certificates in /mnt/custom_ca to the trust store so that HTTPS calls to the ZeroNorth API will validate properly.
The CUSTOMER_ARTIFACTS_PATH should reference a customer_artifacts_folder which contains artifacts that will be presented to the runner. The folder structure described bellow is important for the runner to see those artifact(s).
Adding a customer provided certificate (PEM format). The certificate needs to be named certificate.
customer_artifacts_folder/certificates/certificate
Adding a license which is required for a specific tool scan. License name specified during license creation on the ZeroNorth platform.
customer_artifacts_folder/license/<License Name>
Adding ZAP context files (auth script, context, url file, etc). The artifact name specified during artifact creation on the ZeroNorth platform.
customer_artifacts_folder/authScript/<Artifact Name> customer_artifacts_folder/context/<Artifact Name> customer_artifacts_folder/urlFile/<Artifact Name>
Adding a ZAP hosts file. The hosts file name is specified during creation of the host file on the ZeroNorth platform.
customer_artifacts_folder/hosts/<Hosts file name>
Performing a source code scan is done by setting the STAGE environment variable to SOURCE and calling the integration container:
bashdocker run -v [host location of checked out source code]:/code -v [host location of results]:/results -e LOG_LEVEL=DEBUG -e CYBRIC_USER=[your zeronorth username] -e CYBRIC_PASSWORD=[your zeronorth password] -e SCENARIO=brakeman-default -e STAGE=SOURCE zeronorth/integration:latest python cybric.py
For example, if I had just completed a step to check out source code from another container, and that container had written the source code to a bind-mounted volume on the Docker host called /mnt/shared/source, my source code scan would be executed like this:
bashdocker run -v /mnt/shared/source:/code -v /mnt/shared/results:/results -e LOG_LEVEL=DEBUG -e CYBRIC_USER=barry@cybric.io -e CYBRIC_PASSWORD=****** -e SCENARIO=brakeman-default -e STAGE=SOURCE zeronorth/integration:latest python cybric.py
The source code will be compressed and sent to ZeroNorth for scanning and analysis. The results of this scan will be stored on the ZeroNorth platform, ingested for analytic analysis and results returned for consumption by your system. Results will be returned as a JSON structure for easy programmatic parsing.
If you host your source and build artifacts in S3, you can pull them down by referencing them with the S3_PATH environment variable. If you need to specify your AWS IAM credentials, you can also pass in AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.
If your code lives in a subdirectory on S3, scan it like this:
bashdocker run -it -e AWS_ACCESS_KEY_ID=your-access-key-here -e AWS_SECRET_ACCESS_KEY=your-secret-key-here -e SCENARIO=sonarqube-agent -e CYBRIC_USER=barry@cybric.io -e CYBRIC_PASSWORD=****** -e STAGE=source -e S3_PATH=s3://your-bucket-name/directory-name/ zeronorth/integration:latest python cybric.py
You can also reference .zip and .tgz/.tar.gz files in S3 and they will be pulled down. For .tgz/.tar.gz files, they are sent directly to ZeroNorth for scanning, but .zip files need to be downloaded and recompressed as .tgz files.
NOTE Make sure that your archive has all of the code that you want to scan under a single top-level directory.
If you set FAIL_ON_HIGH_SEVERITY to 1 then any high severity issues found during scan will cause the container to exit with a code of 1. This can be helpful where the ZeroNorth integration container is used in a build pipeline and you'd like the pipeline to fail when high severity errors are found.
In addition to scanning source, build and container artifacts for vulnerabilities, ZeroNorth can also scan deployed applications for vulnerabilities as well.
To do an nmap discovery scan of a server
bashdocker run -v /mnt/shared/results:/results -e LOG_LEVEL=DEBUG -e CYBRIC_USER=[your zeronorth username] -e CYBRIC_PASSWORD=[your zeronorth password] -e SCENARIO=nmap-discovery -e STAGE=HOST HOST_TARGET=[ip or host of the server to scan] zeronorth/integration:latest python cybric.py
NOTE Be extremely careful about using some of the more invasive tools and configurations against important hosts. Many of these tools have aggressive settings that will actively try to compromise any exploits that they find, which can be very useful in penetration testing.
If you have an Application in your ZeroNorth account and you'd like to ensure that none of the Targets within them have vulnerabilities above a criticality threshold, you can call the checkapp.py script.
Go to FabricOPS > Application, locate your appication, and then grab the application's ID by clicking the icon next to the application's name. Run the checkapp.py script as follows:
bashdocker run -e APPLICATION_ID={your applications ID} -e CYBRIC_API_KEY={your API key} FAIL_ON_HIGH_SEVERITY={severity level to fail on} zeronorth/integration:latest python checkapp.py
The severity level can be one of INFO, LOW, MEDIUM, HIGH or CRITICAL. If any of the Targets in the specified Application have vulnerabilities at or exceeding the specified criticality level, the command will exit with a status code of 1. This will allow you to fail builds based on vulnerabilities across many targets and ensure that the entire Application is secure.
Instead of specifying the scan parameters using environment variables, you can also use a Cybricfile. A Cybricfile is a YAML file checked in at the base of your project's code tree named .cybric.yml.
yamlversion: '1.0' output_format: json log_level: DEBUG source: project_name: Project A Source fail_on_high_severity: true include_files: - src/** exclude_files: - build/** scenario: brakeman-default build: project_name: Project A Build container: project_name: Project A Container scenario: docker-image-scan-default image: mycompany/projecta:latest host: project_name: Project A Web Server scenario: nmap-discovery host_target: staging.mycompany.com
The top-level keys correlate to the STAGE. To execute the source stage with this file checked into the project tree, execute the command like this:
bashdocker run -v [host location of checked out source code]:/code -v [host location of results]:/results -e LOG_LEVEL=DEBUG -e CYBRIC_USER=[your zeronorth username] -e CYBRIC_PASSWORD=[your zeronorth password] -e STAGE=SOURCE zeronorth/integration:latest python cybric.py
NOTE: Environment variables passed in will override any values specified in the Cybricfile.
NOTE: You can not specify keys or secrets in the Cybricfile. This was done intentionally to prevent secrets from being checked into version control. All keys & secrets must be passed in as environment variables.
The results will be written to /results/scan.out in the format specified in OUTPUT_FORMAT.
Windows 10 has some... complexities with pyinstaller
PreInstall Steps
Install python3.6.2
[***]
Install Windows 10 SDK
[***]
Set env path for python, python scripts and windows 10 sdk x64 dlls
C:\Users\Administrator\AppData\Local\Programs\Python\Python36 C:\Users\Administrator\AppData\Local\Programs\Python\Python36\Scripts C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\Dlls\x64
Install virtualenv
cmdpip install virtualenv==16.1
Activate a new virtualenv in the integration code directory
cmdcd C:\path\to\integration virtualenv venv . venv\Scripts\activate
Install pycurl wheel since it has dependency issues on Windows otherwise
cmdpip install lib\pycurl-7.43.0-cp36-cp36m-win_amd64.whl
Install dependencies
cmdpip install -r requirements.txt python setup.py install pip install pywin32
Install pyinstaller
cmdpip install pyinstaller
Run pyinstaller to create a single exe binary to run on windows 10 based systems
cmdpyinstaller --onefile --additional-hooks-dir=.\hooks --distpath=.\bin\windows_amd64 cybric_cli.py --path "C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\Dlls\x64"
Before you can create the CLI, you will need credentials to the ZeroNorth Nexus server. Export your Nexus username and password before running the following make task:
export NEXUS_USERNAME={your nexus username} export NEXUS_PASSWORD={your nexus password}
Once this is done, you can now run make centos_cli for a CentOS/RHEL version or make ubuntu_cli for an Ubuntu/Debian version.
When it finishes, you will have a file called cybric_cli in the appropriate folder in bin (eg. bin/centos7_amd64 or bin/ubuntu_amd64). It does use Docker to build the CLI, so you will need to have the Docker daemon running.
Copyright © 2017, 2018, 2019 ZeroNorth, Inc. All rights reserved.
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
不支持 push
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务