Skip to content
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

Set permissions for workflows to follow a good security practice. #300

Merged
merged 24 commits into from
Sep 28, 2022

Conversation

nilsreichardt
Copy link
Member

Having workflows without setting the permission for the workflow is considered a bad security practice and it is causing alerts from our scanning tools.

@SharezoneApp SharezoneApp deleted a comment from github-actions bot Sep 28, 2022
@SharezoneApp SharezoneApp deleted a comment from github-actions bot Sep 28, 2022
@SharezoneApp SharezoneApp deleted a comment from github-actions bot Sep 28, 2022
@SharezoneApp SharezoneApp deleted a comment from github-actions bot Sep 28, 2022
@nilsreichardt nilsreichardt marked this pull request as draft September 28, 2022 13:52
@SharezoneApp SharezoneApp deleted a comment from github-actions bot Sep 28, 2022
@SharezoneApp SharezoneApp deleted a comment from github-actions bot Sep 28, 2022
@nilsreichardt nilsreichardt marked this pull request as ready for review September 28, 2022 15:59
@github-actions
Copy link

github-actions bot commented Sep 28, 2022

Visit the preview URL for this PR (updated for commit fd425c8):

https://sharezone-test--pr300-set-github-action-de-19rcpvpg.web.app

(expires Wed, 05 Oct 2022 22:30:57 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

.github/workflows/alpha.yml Outdated Show resolved Hide resolved
.github/workflows/main.yml Outdated Show resolved Hide resolved
@@ -154,6 +160,9 @@ jobs:
# 4. Adjust website restrictions for Firebase Key "Sharezone Web Key".
web-preview:
runs-on: ubuntu-latest
permissions:
pull-requests: write # for FirebaseExtended/action-hosting-deploy to comment on PRs
checks: write # for FirebaseExtended/action-hosting-deploy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't find what the checks permissions is exactly for. Can you add it to the comment next to it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thing is that I also don't know why it's needed but without it's not posting the comment. It also needs to be write. read is not working.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the comment

for FirebaseExtended/action-hosting-deploy to comment on PRs (without write permissions for checks the action doesn't post a comment to the PR)

Copy link
Collaborator

@Jonas-Sander Jonas-Sander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

.github/workflows/main.yml Outdated Show resolved Hide resolved
@nilsreichardt nilsreichardt enabled auto-merge (squash) September 28, 2022 22:26
@nilsreichardt nilsreichardt merged commit 9fcbee0 into main Sep 28, 2022
@nilsreichardt nilsreichardt deleted the set-github-action-defualt-permission branch September 28, 2022 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants