Finding returns the following:
trivyfs-docker...........................................................Failed
- hook id: trivyfs-docker
- exit code: 1
- files were modified by this hook
2024-03-25T12:27:20.991Z INFO Vulnerability scanning is enabled
2024-03-25T12:27:20.991Z INFO Secret scanning is enabled
2024-03-25T12:27:20.991Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-03-25T12:27:20.991Z INFO Please see also https://aquasecurity.github.io/trivy/v0.49/docs/scanner/secret/#recommendation for faster secret detection
2024-03-25T12:27:21.617Z INFO Number of language-specific files: 1
2024-03-25T12:27:21.617Z INFO Detecting nuget vulnerabilities...
src/Codito.Esb.B2b.Order.Import/integrationtests/packages.config (nuget)
Total: 2 (UNKNOWN: 0, LOW: 0, MEDIUM: 1, HIGH: 1, CRITICAL: 0)
┌──────────────────────────────┬────────────────┬──────────┬────────┬───────────────────┬───────────────┬──────────────────────────────────────────────────────────┐
│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │
├──────────────────────────────┼────────────────┼──────────┼────────┼───────────────────┼───────────────┼──────────────────────────────────────────────────────────┤
│ Microsoft.Rest.ClientRuntime │ CVE-2022-26907 │ MEDIUM │ fixed │ 2.3.19 │ 2.3.24 │ Azure SDK for .NET Information Disclosure Vulnerability. │
│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2022-26907 │
├──────────────────────────────┼────────────────┼──────────┤ ├───────────────────┼───────────────┼──────────────────────────────────────────────────────────┤
│ Newtonsoft.Json │ CVE-2024-21907 │ HIGH │ │ 10.0.3 │ 13.0.1 │ Improper Handling of Exceptional Conditions in │
│ │ │ │ │ │ │ Newtonsoft.Json │
│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2024-21907 │
└──────────────────────────────┴────────────────┴──────────┴────────┴───────────────────┴───────────────┴──────────────────────────────────────────────────────────┘
To ignore these findings I add these to the .trivyignore:
CVE-2024-21907
CVE-2022-26907
Executing git add -A and then git commit -m "message" returns a failed test but no findings:
trivyfs-docker...........................................................Failed
- hook id: trivyfs-docker
- files were modified by this hook
2024-03-25T12:29:51.737Z INFO Vulnerability scanning is enabled
2024-03-25T12:29:51.737Z INFO Secret scanning is enabled
2024-03-25T12:29:51.737Z INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-03-25T12:29:51.737Z INFO Please see also https://aquasecurity.github.io/trivy/v0.49/docs/scanner/secret/#recommendation for faster secret detection
2024-03-25T12:29:52.417Z INFO Number of language-specific files: 1
2024-03-25T12:29:52.417Z INFO Detecting nuget vulnerabilities...
Adding the detected vulnerabilities should return a Passed test.
pre-commit-config looks like this for pre-commit-trivy
- repo: https://github.com/mxab/pre-commit-trivy
rev: v0.11.0
hooks:
- id: trivyfs-docker
args:
- --skip-dirs
- ./tests
- ./
Running on Windows 11.
Finding returns the following:
To ignore these findings I add these to the .trivyignore:
Executing
git add -Aand thengit commit -m "message"returns a failed test but no findings:Adding the detected vulnerabilities should return a
Passedtest.pre-commit-configlooks like this forpre-commit-trivyRunning on Windows 11.