Add support for CodeQL#2660
Conversation
|
@seanbudd, This has been tested in https://github.com/nvdaes/addon-datastore/actions/runs/8287950825 |
|
@nvdaes - can you show an example of a failure? |
| # If you wish to specify custom queries, you can do so here or in a config file. | ||
| # By default, queries listed here will override any specified in a config file. | ||
| # Prefix the list here with "+" to use these queries and those in the config file. | ||
| # queries: ./path/to/local/query, your-org/your-repo/queries@main | ||
|
|
||
| # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | ||
| # If this step fails, then you should remove it and run the build manually (see below) | ||
| - name: Autobuild | ||
| uses: github/codeql-action/autobuild@v3 | ||
|
|
||
| # ℹ️ Command-line programs to run using the OS shell. | ||
| # 📚 https://git.io/JvXDl | ||
|
|
||
| # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines | ||
| # and modify them (or add more) to build your code if your project | ||
| # uses a compiled language | ||
|
|
||
| #- run: | | ||
| # make bootstrap | ||
| # make release |
There was a problem hiding this comment.
are these comments relevant to our repository?
There was a problem hiding this comment.
No, I'm remove them. This code is based on the Javascript action template used for my build-discussion action, currently used in the store repo, and I supposed that comments would make easier to review changes adding some info about CodeQL.
Unfortunately, the CodeQL action seems to fail just when is triggered in a PR, not for other events for example not when the code is analized on workflow_call or schedule events. |
|
We may use the .sarif files generated by the analyze action to see if the results property contains elements, and then post a comment in the corresponding issue requesting authors to contact NV Access. I'll convert this to a draft for now. |
|
I think this can be reviewed again. I've tested this in the following workflow runs:
Note that some workflows fail due to things not related to analysis. |
|
cc: @CyrilleB79 (security reporter and analyst) |
|
Note that some workflows fail due to things not related to analysis.
@nvdaes Given that you propose blocking submission on failure, can you please
explain this point in more detail?
|
I was meaning workflows on my fork of the store, shown here as examples of tests made by me. Some workflows may fail if the used add-on is already on my fork of the store, and I mentioned it to indicate that the important thing in those cases is to pay attention to the workflow until the analysis job. |
|
Can you please add documentation on how to handle these failures as a reviewer? Even better, can these Sarif files become viewable in GitHub? |
seanbudd
left a comment
There was a problem hiding this comment.
Code changes look good, just needs documentation
|
Do you confirm that this check is mandatory to have an add-on included or updated in the store? If yes, this probably needs to be documented. Thanks. |
|
I would say that any failures will need to be manually overruled by NV Access |
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
|
Sean wrote:
I think this is a good idea. Anyway I'll try to add documentation in the submitters guide. I think this is the best place, and, after testing the VS Code extension, I'll add a note about it, as well as about how to see sarifs on GitHub, though I don't know if this would be fully accessible, deppending of the number of errors and so on. |
|
Is there anything other than VS Code extension (which many/most add-on devs
don't use), or "possibly inaccessible" GitHub solution?
|
According to my tests, in the security code scanning page of GitHub, alerts are shown like issues and we can press enter in the alert title. Title: Incomplete URL substring sanitization High Incomplete URL substring sanitization Also, since this maybe incomplete, when the analysis fails, in this PR we make that GitHub Actions download the add-on and the sarif files containing failures to the artifact sections of the GitHub workflow. |
|
results-python.zip |
|
I'll mention this VS Code extension. Name: SARIF Explorer Output after clicking: py/incomplete-url-substring-sanitization Result marked as TODO No result selected |
|
I've made a commit to add the GitHub workflow link to the issue when the bot comments about code analysis failure, so that documenting and seing results and artifacts can be easier. See tests for this at |
|
@seanbudd , I've added documentation. This is ready for review. |
|
I think we should remove the info about Sarif Explorer extension for VS Code. I don't get consistent results across different computers, and now I cannot use the extension after installing it. |
| @@ -15,8 +15,13 @@ For an overview of the whole Add-on Store, read [the design overview](./docs/des | |||
| ### About security | |||
| Ensuring that an add-on is safe to run is a difficult challenge that isn't addressed here. | |||
| However, the metadata for a new submission (add-on release) can be confirmed to match its manifest description. | |||
There was a problem hiding this comment.
thoughts on removing these 2 sentences and replacing it with something like?
It seems like we are trying to tackle the first sentence now, and the second sentence doesn't really seem relevant to security.
Add-ons are run at user's own risk, add-ons in the add-on store do not undergo human security audits.
The add-on store includes the following security measures:
|
I'll apply all suggested changes, including the quotation about security. |
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
|
@seanbudd, I think this is ready. |
|
Thanks for merging this, @seanbud. |
Issue number
fixes #2655
Summary of the issue
Some vulnerabilities can be detected analyzing source code of add-ons submitted to the store.
Development strategy