jfrog / jfrog/jfrog-cli-security
jf docker scan is not failing build pipelines as expected
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 13
- Forks
- 50
- Avg merge
- 3d 48m
- Merged PRs (30d)
- 26
Description
Describe the bug
When using jf docker scan our Gitlab CI Pipelines should fail if a high or critical CVE is found. Instead the pipelines just succeed.
This worked some time ago as expected and seems to be broken with one of the last jfrog-cli releases. Unfortunately I cannot exactly determine the time frame since this issue occured as we just realized it today.
For me this looks like jfrog-cli is not giving the correct return code, if "fail build" is configured on the relevant policy the cli tool should return rc != 0 if relevant CVEs are found.
Current behavior
We are using a policy with the following configuration:
Our pipelines scan our images as follows:
jf docker scan IMAGE --watches watch_referencing_above_policy
Result e.g. for a current tomcat image scan:
07:14:38 [Info] Waiting for scan to complete on JFrog Xray...
Security Violations
+------------+---------------------------+---------+---------------------------+----------+-----------+-------+----------------+
| SEVERITY | DIRECT | DIRECT | IMPACTED | IMPACTED | FIXED | TYPE | CVE |
| | PACKAGE | PACKAGE | PACKAGE | PACKAGE | VERSIONS | | |
| | | VERSION | NAME | VERSION | | | |
+------------+---------------------------+---------+---------------------------+----------+-----------+-------+----------------+
| 💀Critical | sha256__a35cb2463fc100adc | | org.apache.tomcat:tomcat- | 10.1.28 | [10.1.30] | Maven | CVE-2024-52316 |
| | c6e589bb48fbc21aea5159898 | | catalina | | [11.0.1] | | |
| | e041f4a26a4ad888691477.ta | | | | [9.0.96] | | |
| | r | | | | | | |
| | | | | | | | |
+------------+---------------------------+---------+---------------------------+----------+-----------+-------+----------------+
| 🎃Medium | sha256__a35cb2463fc100adc | | org.apache.tomcat:tomcat- | 10.1.28 | [10.1.31] | Maven | CVE-2024-52317 |
| | c6e589bb48fbc21aea5159898 | | coyote | | [11.0.0] | | |
| | e041f4a26a4ad888691477.ta | | | | [9.0.96] | | |
| | r | | | | | | |
| | | | | | | | |
+------------+---------------------------+---------+---------------------------+----------+-----------+-------+----------------+
License Compliance Violations
+---------------------------------------------+
| No license compliance violations were found |
+---------------------------------------------+
07:14:44 [Info] Scan completed successfully.
...
Job succeeded
This job should fail as it found a critical CVE, but instead it just succeeds.
Reproduction steps
No response
Expected behavior
No response
JFrog CLI-Security version
the one contained in jfrog-cli ...
JFrog CLI version (if applicable)
2.71.5
Operating system type and version
ubuntu:noble
JFrog Xray version
3.106.7
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the jf docker scan entry point and reproduce the command with the reported JFrog CLI 2.71.5, Xray 3.106.7, and policy configuration. Trace how a high or critical CVE affects the process return code, then verify a regression test or pipeline run exits nonzero when the policy requires the build to fail.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- cli, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100