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

ignoring the severity when we use ignore-unfixed: false #192

Closed
kmganna opened this issue Jan 24, 2023 · 7 comments
Closed

ignoring the severity when we use ignore-unfixed: false #192

kmganna opened this issue Jan 24, 2023 · 7 comments

Comments

@kmganna
Copy link

kmganna commented Jan 24, 2023

I am running the trivy vulnerability scan on the docker image in the git action pipeline.

Below is the code.
- name: Run Trivy vulnerability scanner on a container uses: aquasecurity/trivy-action@9ab158e8597f3b310480b9a69402b419bc03dbd5 with: image-ref: '${{ inputs.registry }}/${{ inputs.repo_name }}:${{ inputs.image_version }}' format: 'sarif' severity: 'CRITICAL,HIGH,MEDIUM' output: 'trivy-container-results.sarif' ignore-unfixed: true timeout: ${{ inputs.timeout }}

The above code is working and giving the results based on the severity of the application and it is ignoring unfixed OS fixes(HIGH, MEDIUM and CRITICAL) and LOW fixes as well. Now if I make ignore-unfixed: false then it is giving all the ignored OS fixes along with "LOW severity".

Requirement is:
If I use ignore-unfixed: false and there is a severity CRITICAL, HIGH, and MEDIUM. The output should be application issues and OS issues in the output file based on severity. It should not be LOW and other issues.

Please suggest how to achieve it.

For reference:

The issue has been discussed in the below section
aquasecurity/trivy#1687 (reply in thread)

@kmganna kmganna changed the title ignoring the severity when we use igore-unfixed: false ignoring the severity when we use ignore-unfixed: false Jan 24, 2023
@knqyf263
Copy link
Contributor

@AndreyLevchenko I feel like it is a critical issue. Could you help fix it?

@kmganna
Copy link
Author

kmganna commented Jan 30, 2023

@knqyf263 @AndreyLevchenko, any luck on this issue fix?

@simar7
Copy link
Member

simar7 commented Feb 2, 2023

@AndreyLevchenko worked on a fix which should be in the latest release of the trivy action https://github.com/aquasecurity/trivy-action/releases/tag/0.9.0 , please give it a try. Reopen if issues still persists. Thanks!

@simar7 simar7 closed this as completed Feb 2, 2023
@kmganna
Copy link
Author

kmganna commented Feb 7, 2023

@AndreyLevchenko, thanks, for adding the changes.
The issue has not yet been resolved.

I performed the below tests.

Test 1:
When we performed: In the git actions
Ignored-fixed = false

- name: Run Trivy vulnerability scanner on a container uses aquasecurity/trivy-action@cff3e9a7f62c41dd51975266d0ae235709e39c41 # <====== v0.9.0 - Upgrade Trivy Action version here if: ${{ inputs.scan_container == true }} with: image-ref: '${{ inputs.registry }}/${{ inputs.repo_name }}:${{ inputs.image_version }}' format: 'sarif' severity: 'CRITICAL,HIGH,MEDIUM' # <====== Change "sensitivity" here output: 'trivy-container-results.sarif' ignore-unfixed: false timeout: ${{ inputs.timeout }}

output: Published all severity results: LOW, MEDIUM, HIGH, CRITICAL etc... these results have the issue which are in the screenshot

TEST 2:
When we performed: In the git actions
ignore-fixed: true

- name: Run Trivy vulnerability scanner uses aquasecurity/trivy-action@master with: image-ref: '${{ inputs.registry }}/${{ inputs.repo_name }}:${{ inputs.image_version }}' format: 'sarif' output: 'trivy-results.sarif' severity: 'CRITICAL, HIGH, MEDIUM' ignore-unfixed: true

output: Published the CRITICAL, HIGH, and MEDIUM reports but it has not captured the attached results for the ECR image. AWS captured these results.
Screenshot 2023-02-07 at 1 22 13 pm

The same test I did locally on my mac with the commands. Same results.

trivy image --format sarif --vuln-type os,library --severity CRITICAL,HIGH,MEDIUM --ignore-unfixed --output trivy-container-results.sarif '${{ inputs.registry }}/${{ inputs.repo_name }}:${{ inputs.image_version }}'

trivy image --format sarif --vuln-type os,library --severity CRITICAL,HIGH,MEDIUM --output trivy-container-results.sarif '${{ inputs.registry }}/${{ inputs.repo_name }}:${{ inputs.image_version }}'

Please let me know if you need more information, thank you in advance.

Cc'd @simar7
Regards,
Krishna Mohan

@kmganna
Copy link
Author

kmganna commented Feb 16, 2023

@simar7 @AndreyLevchenko Could you please provide an update?

@simar7
Copy link
Member

simar7 commented Feb 16, 2023

I've pinged @AndreyLevchenko to see if he can take another look at it.

@AndreyLevchenko
Copy link
Contributor

@kmganna
The changes introduce new parameter limit-severities-for-sarif to override default sarif behavior. So it should be set to false in order to use severities parameter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants