Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jf docker scan is not failing build pipelines as expected #247

Open
Persi opened this issue Nov 26, 2024 · 1 comment
Open

jf docker scan is not failing build pipelines as expected #247

Persi opened this issue Nov 26, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Persi
Copy link

Persi commented Nov 26, 2024

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:
Image

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

@Persi Persi added the bug Something isn't working label Nov 26, 2024
@codeart1st
Copy link

It seems to working now. Previous runs with

17:25:07 [Info] The downloaded Xray Indexer version is 3.109.3
...
17:25:40 [Info] Scan completed successfully.

and now it fails correctly with

08:04:49 [Info] The downloaded Xray Indexer version is 3.111.6
...
08:05:21 [Error] One or more of the detected violations are configured to fail the build that including them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants