GitHub Workflows security hardening#2274
Merged
Merged
Conversation
Signed-off-by: Alex <[email protected]>
Member
|
Thanks, I agree that this makes sense. |
Contributor
|
Should this for completeness also be applied to the other workflows? Though I guess they might need a few more permissions, they upload artifacts and CodeQL analysis creates security events. |
Contributor
Author
|
The other workflows run on |
Contributor
|
Ah you are right, thanks for the explanation! |
tibor-universe
pushed a commit
to getuniverse/gson
that referenced
this pull request
Jan 20, 2023
Signed-off-by: Alex <[email protected]> Signed-off-by: Alex <[email protected]> (cherry picked from commit c33e03b)
DanySK
pushed a commit
to DanySK/gson-extras
that referenced
this pull request
Jan 30, 2025
## [3.0.0](2.0.0...3.0.0) (2025-01-30) ### ⚠ BREAKING CHANGES * Merge remote-tracking branch 'google/main' ### Dependency updates * **api-deps:** update dependency com.google.code.gson:gson to v2.12.0 ([#802](#802)) ([e85a651](e85a651)) ### Bug Fixes * ParseBenchmark json property typo ([google#2473](https://github.com/DanySK/gson-extras/issues/2473)) ([1e7625b](1e7625b)) ### Revert previous changes * Revert "Bump org.codehaus.plexus:plexus-utils from 3.5.1 to 4.0.0 ([google#2468](https://github.com/DanySK/gson-extras/issues/2468))" ([google#2469](https://github.com/DanySK/gson-extras/issues/2469)) ([db4a58a](db4a58a)) ### Build and continuous integration * harden build.yml permissions ([google#2274](https://github.com/DanySK/gson-extras/issues/2274)) ([c33e03b](c33e03b)) * track the Gradle wrapper `distributionSha256Sum` ([c3b208d](c3b208d)) ### General maintenance * Merge remote-tracking branch 'google/main' ([8abc8fa](8abc8fa))
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds explicit permissions section to workflows. This is a security best practice because by default workflows run with extended set of permissions (except from
on: pull_requestfrom external forks). By specifying any permission explicitly all others are set to none. By using the principle of least privilege the damage a compromised workflow can do (because of an injection or compromised third party tool or action) is restricted.It is recommended to have most strict permissions on the top level and grant write permissions on job level case by case.