-
Notifications
You must be signed in to change notification settings - Fork 351
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
🐛 "SARIF URI scheme \"https\" did not match the checkout URI scheme \"file\",", #754
Comments
Can you attach the relevant portion of you sarif file? Also, if your repository is public, can you share a link? |
My repo is public https://github.com/laurentsimon/scorecard-action-test
|
The sarif file looks fine to me. I'm able to upload and download it from code scanning. Can you point me to a failing actions run? Presumably, you have an instance where |
And code-scanning currently only supports character offset/length and start/end line/columns offsets. |
re: support for only character offset.. What if a binary file is reported in the results? Shall I set the line/character offset or that won't work? re: It works well except when it encounters a URL. |
I've forwarded your question on to someone on the team who has more experience with how code scanning processes sarif files. |
Thanks so much! |
I just tested using a Looking forward to your guidance nevertheless. One thing that would benefit UX wise is reporting all locations in the dashboard, instead of only the first one. |
👋 Code Scanning assumes that the locations are for files in the repository. As a result it is trying to relativize your URLs against a Using a relative URL, as you have done in the
Are you talking about the
Right now we just support Start/EndLine and Start/EndColumn because Code Scanning is designed to work with source code. The result view highlights a particular line range in a text file and we haven't thought about how we would display or highlight a range in a binary file. For now I think your best bet is to leave out the line/column information. |
not really. Our tool outputs information about assets and release, so links like https://api.github.com/repos/ossf/scorecard/releases/assets/41580436, https://github.com/ossf/scorecard/releases/download/v2.1.1/scorecard_2.1.1_checksums.txt.sig are the one we wanted to insert for related locations. It would be good enough for a clickable link to show. Those links are useful for users to download and inspect if they wish. My suggestion would be that for links that do not correspond to a file in the repo, you can simply show a clickable link.
No, I was really talking about
|
Thanks, that makes sense. I'll open an issue to consider how we handle URLs internally. In SARIF, relatedLocations are normally used by including a markdown-style link of the form Because of the problem with accepting https URLs you won't currently be able to do this, but you could short-cut the process and directly insert a markdown link into the result message.
Yes, this is a current limitation of our SARIF support, which would be hard to change because of the way the alert view works. Our current suggestion would be either to create multiple results or to have a single result and use relatedLocations to reference the other places. |
Please do keep us up to date with your development! We would be happy to review and offer further suggestions and guidance. |
Thank you so much for the prompt help. Kudos to your team! |
You're welcome! 😁 I'll close this out now, but as I said, very happy to discuss other points in the future. I'll also aim to update you here if we change the behaviour of our absolute URL handling. |
@rneatherway any updates on this topic? |
When this feature was originally suggested, we did not have enough resources to implement it. I am asking again to see if it is something worth implementing now. |
Unfortunately, we do not have any capacity to work on this right now. It's on our backlog and we may decide to pick it up in the future. |
Could we keep this issue open until implemented? |
Also running into this issue - I'm wondering if it's possible to ignore and continue for https URIs in the short-term until the team settles on an appropriate way to handle them. e.g. if I develop a workflow that has relative At present, we're looking at pre-processing the SARIF to exclude the NOTE: Another avenue we explored was omitting location selectively for these artifacts, but that yielded the following:
So this leaves no option but to completely omit results from the SARIF for which the artifact can't be resolved locally by Github's API. That's not really tenable. |
I'm developing a GitHub action following
https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning#physicallocation-object
The doc says the
artifactLocation.uri: If the URI is absolute, code scanning can use the URI to checkout the artifact and match up files in the repository. For example, https://github.com/ghost/example/blob/00/src/promiseUtils.js
When I use a URL though, the analysis keeps failing
Analysis processing failed
.I ran
curl -u laurentimon:$GITHUB_AUTH_TOKEN -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/laurentsimon/scorecard-action-test/code-scanning/analyses
and got the error message below:"error": "SARIF URI scheme \"https\" did not match the checkout URI scheme \"file\",",
which seems to indicate
https
is not supported... but the doc says it is.So my first question is: are URLs supported? I'm using them in SARIF's
relatedLocation.physicalLocation.URI
. If they are, what am I doing wrong?My second question: I'd like to report related locations with urls, e.g. https://api.github.com/repos/ossf/scorecard/releases/assets/41580436, https://github.com/ossf/scorecard/releases/download/v2.1.1/scorecard_2.1.1_checksums.txt.sig. Urls may have different content types, so it's not entirely clear whether I'd need to use
StartLine
,CharOffset
orByteOffset
depending on the content type. Ideally,ByteOffset
should work regardless of content type.Can you advise?
Thanks!
The text was updated successfully, but these errors were encountered: