FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Restrict Actions token permissions in CodeQL workflow. by chrisgavin · Pull Request #457 · github/codeql-action · GitHub

Restrict Actions token permissions in CodeQL workflow. - #457

Merged
chrisgavin merged 4 commits into
mainfrom
restrict-permissions
Apr 30, 2021
Merged

chrisgavin merged 4 commits into
mainfrom
restrict-permissions

Conversation

Copy link
Copy Markdown
Contributor

This both helps improve the security of the workflow and ensures we don't accidentally add a dependency on any new permissions without realizing.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.

chrisgavin force-pushed the restrict-permissions branch from d4fd699 to 7e85b5d Compare April 22, 2021 16:07
chrisgavin marked this pull request as ready for review April 22, 2021 16:16

Copy link
Copy Markdown
Contributor Author

It turns out that while this is probably still useful, it was actually passing with less permissions than it should have. This was for two reasons:

  • actions: read is needed, but only if the repository being analyzed is private. If it is public then actions: read is effectively always granted.
  • security-events: write is not needed in pull requests. This is handled somewhat magically by GitHub in the pull request case, but for pushes it has to be explicitly specified.

I feel like we can probably still test whether the required permissions have changed, but it will involve having to test changes against a private repository which is a bit of a pain.

I'll merge this anyway because it seems like it's good practice to start being more explicit about what permissions we require.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL