Running the Scan Engine
After you configure the Image Assurance policy and install the Scan Engine, you can run it on your CI/CD pipeline.
The Scan Engine scans container images for security risks and vulnerabilities.
Usage
shiftleft [-t timeout] image-scan [OPTIONS] -e <ENVIRONMENT_ID> -i <IMAGE_PATH>
Argument | Description |
---|---|
-e, |
|
-h, |
Show help |
-i, |
Path to docker image TAR file |
-j, |
JSON JavaScript Object Notation. A lightweight data interchange format. output |
-o, |
Full CLI output to the provided file path |
-t, |
Scan timeout in seconds (default: 3600) Note: Make sure to use the |
-v, |
Show version |
Exit Codes
The exit code of the command is non-zero in case of a policy violation or an error.
Exit Code | Description |
---|---|
0 |
Image scan succeeded, empty assessment / Assessment passed, no rules failed. Image is compliant. |
1 | Network error |
3 | Authentication error |
4 | Missing arguments |
5 | Internal error |
6 |
Image scan succeeded, assessment is not empty / Assessment failed at least on one rule. Image is not compliant. |
11 | Error in getting the assessment result. Try again or contact support. |
99 | Insufficient memory for image scanning |
101 |
Insufficient disk space for image scanning |
253 | Scan timeout |
Scanning a Container Image TAR File
To scan a container image myrepo/myimage:version
for vulnerabilities and security threats, run:
|
The Scan Engine scans the container TAR file at the provided path /home/mycontainer.tar
. For the assessment, the policy uses all CloudGuard rulesets attached to the provided environment. The assessment results are published as findings associated with the applicable ShiftLeft image entity in the ShiftLeft environment. Use the Scan Engine flags to print the results as text or JSON.
Scan Timeout
When you scan a large image, you can receive a timeout error from the program.
To solve the issue, increase the default one-hour timeout with the -t
flag.
For example, if the scan in the above example fails after a one-hour timeout, run this command to start another scan with a two-hour timeout:
|