Skip to content

Update workflows and enhance security - #5537

Merged
dani-garcia merged 1 commit into
dani-garcia:mainfrom
BlackDex:workflow-adjustments
Feb 3, 2025
Merged

dani-garcia merged 1 commit into
dani-garcia:mainfrom
BlackDex:workflow-adjustments

Conversation

@BlackDex

@BlackDex BlackDex commented Feb 3, 2025

Copy link
Copy Markdown
Collaborator

This commit updates the workflow files and also fixes some security issues which were reported by using zizmor https://github.com/woodruffw/zizmor

@BlackDex
BlackDex requested a review from dani-garcia as a code owner February 3, 2025 16:18

@dfunkt dfunkt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Haven't had the chance to test these changes yet, just a quick surface look.

Comment thread .github/workflows/build.yml
Comment thread .github/workflows/hadolint.yml
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/releasecache-cleanup.yml
@BlackDex

BlackDex commented Feb 3, 2025

Copy link
Copy Markdown
Collaborator Author

@dfunkt, i think those items are not correct.
The GitHub documentation also states that you can either provide a global permission, or a per job setting.
But maybe adding a default of not allowing anything is a good option though, to prevent more broader access if someone adds a new job without adding permissions.

@dfunkt

dfunkt commented Feb 3, 2025

Copy link
Copy Markdown
Contributor

You can disregard my previous suggestions, completly forgot that I was checking the files with --pedantic enabled.

This commit updates the workflow files and also fixes some security issues which were reported by using zizmor https://github.com/woodruffw/zizmor

Signed-off-by: BlackDex <black.dex@gmail.com>
@BlackDex
BlackDex force-pushed the workflow-adjustments branch from 227379b to efb941b Compare February 3, 2025 19:40
@BlackDex

BlackDex commented Feb 3, 2025

Copy link
Copy Markdown
Collaborator Author

You can disregard my previous suggestions, completly forgot that I was checking the files with --pedantic enabled.

Well, you made me thinking, and having some added security by setting no permissions at all for the whole workflow by default, and then setting it per job is probably a nice way of enforcing it everywhere.

In that case, when forks still have a read-write token by default that is also a bit more hard to exploit there.
Also converted a few other items, and now i get a result of 0 items wrong, also checked with a GitHub Token for some added online checks.

@BlackDex
BlackDex requested a review from dfunkt February 3, 2025 19:45
@BlackDex

BlackDex commented Feb 3, 2025

Copy link
Copy Markdown
Collaborator Author

I also run these workflows through https://rhysd.github.io/actionlint/ and they are also clean there.

@dani-garcia
dani-garcia merged commit a02fb0f into dani-garcia:main Feb 3, 2025
@BlackDex
BlackDex deleted the workflow-adjustments branch February 4, 2025 08:12
@dimejo

dimejo commented Feb 10, 2025

Copy link
Copy Markdown

@BlackDex:
In case you want to further tighten permissions you can run GitHubSecurityLab/actions-permissions to scan and print minimally required permissions per job.

@BlackDex

Copy link
Copy Markdown
Collaborator Author

@BlackDex: In case you want to further tighten permissions you can run GitHubSecurityLab/actions-permissions to scan and print minimally required permissions per job.

Thanks, that might be a nice thing to add :)

zaid-marji pushed a commit to zaid-marji/vaultwarden that referenced this pull request May 27, 2026
This commit updates the workflow files and also fixes some security issues which were reported by using zizmor https://github.com/woodruffw/zizmor

Signed-off-by: BlackDex <black.dex@gmail.com>
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.

4 participants