-
Notifications
You must be signed in to change notification settings - Fork 295
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
Add check-spelling #2224
Add check-spelling #2224
Conversation
.github/workflows/spelling.yml
Outdated
contents: read | ||
pull-requests: read | ||
actions: read | ||
security-events: write |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks "scary", to me. I noticed the related comments on top, and (I admit only very very briefly) glanced over https://github.com/check-spelling/check-spelling/wiki/Feature:-Sarif-output ... I don't really know what "SARIF support for code scanning" does - perhaps you would like to elaborate "automatically generate shiny annotations" on your Wiki, maybe e.g. with a screenshot illustrating it? But even then... doesn't this, in theory (I'm sure you're trustworthy, but this is more about principle), allow the action, if it were to become malicious, to overwrite "security events"? Unless we can reassured that this is fairly harmless, personally I would be more inclined to accept merging this PR without this particular bit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it scares me too, I really wish the api had an explicit "append only" flavor. The specific apis that this allows are:
https://docs.github.com/en/rest/overview/permissions-required-for-github-apps?apiVersion=2022-11-28#repository-permissions-for-code-scanning-alerts
I believe that technically this is using https://docs.github.com/en/rest/code-scanning/code-scanning?apiVersion=2022-11-28#upload-an-analysis-as-sarif-data -- the code I'm using is https://github.com/github/codeql-action/blob/main/upload-sarif/action.yml -- but sadly just because that's what I'm trying to use doesn't mean that the workflow couldn't access one of the other apis if there's an exploit.
From a risk analysis perspective, it appears that there are two other write enabled apis that I'd be concerned about if I heavily used sarif:
fwiw, you're using the same feature here:
security-events: write |
What that means is that either of these two workflows could probably update or delete the items produced any of these security-events: write
workflows.
I've updated that page to include pictures (they're elsewhere in the wiki, but it makes a lot of sense to include them here, thanks for calling that out!).
I'm quite happy to drop this feature for this repository, it's still new and it's definitely optional -- I can't use it for our commercial work because it requires paying for GHES & GHAS for private repositories, so check-spelling definitely works without it.
I believe I'm trustworthy, but I, like most devs make mistakes and have made mistakes, so being conservative is absolutely reasonable. I'll drop this feature from the PR.
e55fa0c
to
17c2cd6
Compare
Im closing this for now. We're not ready to give write permissions to the action |
@omarismail94: it's optional, I can configure it without that if you're interested. |
IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).
Fixes #2223
Description
Add check-spelling workflow based on spell-check-this: spelling.yml and jsoref@0029254#diff-aa48ce5bca2bfbf528400261b9c5a206f60410e880f71a80499efbe87ea236b2
Alternative(s) considered
Have you considered any alternatives?
There are other tools, I've found them to not be as good as mine.
And if so, why have you chosen the approach in this PR?
@jingtang10 invited me to do this in #2193 (review)
Type
Choose one: Code health
Screenshots (if applicable)
Checklist
./gradlew spotlessApply
and./gradlew spotlessCheck
to check my code follows the style guide of this project../gradlew check
and./gradlew connectedCheck
to test my changes locally.check-spelling is configurable
advice.md
and microsoft/terminal's implementation for some examples) that's appended at the end of reports when the tool finds problems -- this can be tweaked at any time in that file.The main choices are:
pull-requests: write
which people don't really like, and I agree) -- this is configurable in the workflow fileexcludes.txt
) -- this file (or a split of it) can be tweaked at any time.Upgrading from one version to the next should usually work reasonably well, however at the present time if you (but not dependabot) make a change to the workflow file itself, those changes will only be tested if you create a
push
(without a pull request in the same repository) and not when you create apull_request
-- this was an optimization because getting conflicting output between apush
and apull_request
seemed confusing and what matters in general is the result of the merge as opposed to the result of a push.You can play around with this code in https://github.com/check-spelling-sandbox/android-fhir/