-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
bug: SARIF URI scheme "git" did not match the checkout URI scheme "file" #5003
Comments
I had the same error when I am using the below modules terraform-aws-modules/lambda/aws |
Any update on this? The only release that works is 0.8.0. All the others fail. |
Adding some notes from testing: I cannot reproduce this running I'm hoping the reproductions below help! OS: MacOS 13.5.2 Works (local)$ trivy --version
Version: 0.45.1
Vulnerability DB:
Version: 2
UpdatedAt: 2023-09-22 00:23:59.552431691 +0000 UTC
NextUpdate: 2023-09-22 06:23:59.552431291 +0000 UTC
DownloadedAt: 2023-09-22 04:44:16.227725 +0000 UTC
Policy Bundle:
Digest: sha256:fd5f1ce3d8efb1fe158cb41f9adb9d7c7cc5c4c863b261053c962e6d950350b3
DownloadedAt: 2023-09-22 04:44:24.462946 +0000 UTC
# Grep finds no invalid results
$ trivy repo --quiet \
--scanners config \
--format sarif \
https://github.com/terraform-aws-modules/terraform-aws-lambda \
| grep '"uri": "git:' Broken (docker)$ docker run --rm ghcr.io/aquasecurity/trivy:0.45.1 --version
Version: 0.45.1
# Grep finds several invalid URIs in result
$ docker run --rm ghcr.io/aquasecurity/trivy:0.45.1 repo --quiet \
--scanners config \
--format sarif \
https://github.com/terraform-aws-modules/terraform-aws-lambda \
| grep '"uri": "git:'
"uri": "git::https:/github.com/terraform-aws-modules/terraform-aws-s3-bucket?ref=v3.0.1/main.tf",
"uri": "git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=v5.0.0/main.tf",
"uri": "git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=v5.0.0/main.tf",
"uri": "git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=v5.0.0/main.tf",
"uri": "git::https:/github.com/terraform-aws-modules/terraform-aws-vpc?ref=v5.0.0/main.tf", |
I think this was introduced by this PR aquasecurity/defsec#1202 which basically reverted this year-old fix aquasecurity/defsec#889 Edit: maybe not by looking at all the dates and contexts, but it seems related See also GitHub Code Scanning API limitations for the SARIF format: github/codeql-action#754 (comment) |
* fix(sarif): removes git::http from uri in sarif ## Description ## Related issues - Fixes aquasecurity#5003 ## Checklist - [ ] I've read the [guidelines for contributing](https://aquasecurity.github.io/trivy/latest/community/contribute/pr/) to this repository. - [ ] I've followed the [conventions](https://aquasecurity.github.io/trivy/latest/community/contribute/pr/#title) in the PR title. - [ ] I've added tests that prove my fix is effective or that my feature works. - [ ] I've updated the [documentation](https://github.com/aquasecurity/trivy/blob/main/docs) with the relevant information (if needed). - [ ] I've added usage information (if the PR introduces new options) - [ ] I've included a "before" and "after" example to the description (if the PR is a user interface change).
* fix(sarif): removes git::http from uri in sarif * fix(sarif): removes git::http from uri in sarif ## Description ## Related issues - Fixes #5003 ## Checklist - [ ] I've read the [guidelines for contributing](https://aquasecurity.github.io/trivy/latest/community/contribute/pr/) to this repository. - [ ] I've followed the [conventions](https://aquasecurity.github.io/trivy/latest/community/contribute/pr/#title) in the PR title. - [ ] I've added tests that prove my fix is effective or that my feature works. - [ ] I've updated the [documentation](https://github.com/aquasecurity/trivy/blob/main/docs) with the relevant information (if needed). - [ ] I've added usage information (if the PR introduces new options) - [ ] I've included a "before" and "after" example to the description (if the PR is a user interface change). * fix lint --------- Co-authored-by: Simar <simar@linux.com>
It seems the PR did not fixed it, I still get the error with Trivy v0.46.0, URI schemes are not removed 😕 $ trivy version
Version: v0.46.0
$ trivy config --format sarif --output trivy-results.sarif .
$ jq '[
.runs[].results[].locations[].physicalLocation.artifactLocation.uri
| select(startswith("git::https:/"))
] | length' trivy-results.sarif
41 I am currently working around it with: sed -i 's#git::https:/##g' trivy-results.sarif |
Same in |
Still an issue in |
Unfortunately, still an issue for us. Thanks, @maxbrunet, for the temporary fix! |
also used the workaround above with current version of Trivy - works great but any chance you can reopen this @knqyf263 ? |
@nikpivkin Can you please take a look? |
source: https://github.com/aquasecurity/tfsec/issues/1955
Config example:
Output:
I used this service for SARIF validation: https://sarifweb.azurewebsites.net/Validation
Validation result:
Description of the uri property in the SARIF specification.
The text was updated successfully, but these errors were encountered: