Prisma Cloud Application Security: Checkov exits with status code 1
2781
Created On 10/08/23 13:51 PM - Last Modified 02/19/25 18:02 PM
Question
Why Checkov exits with status code 1?
Command did not exit successfully bridgecrew -d $CODEBUILD_SRC_DIR -o json --soft-fail-on LOW,INFORMATIONAL,MEDIUM,HIGH exit status 1 Phase complete: POST_BUILD State: FAILED Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: bridgecrew -d $CODEBUILD_SRC_DIR -o json --soft-fail-on LOW,INFORMATIONAL,MEDIUM,HIGH. Reason: exit status 1
Environment
- Prisma Cloud Enterprise
- Checkov
- AWS CodeBuild
Answer
Checkov exits with status code 1 By Design in case it found misconfigurations.
With no API key and no severities in the findings the --soft-fail flag works. The --soft-fail-on with severities will only work with an API key.
If you use the api-key, you may want to use soft-fail-on or hard-fail-on to fine tune exactly which cases cause the Checkov scan to return a pass or fail result as detailed in this link here.
Additional Information
The bc-api-key is your :
<PRISMA_ACCESS_KEY>::<PRISMA_SECRET_KEY>
To generated new key go to Settings > Access Control > Access keys > Add new Access key and use the values.