Skip to content

Increase publish workflow security and tighten permissions - #273

Merged
DougReeder merged 1 commit into
masterfrom
secure-publish-workflow
Jul 7, 2026
Merged

Increase publish workflow security and tighten permissions#273
DougReeder merged 1 commit into
masterfrom
secure-publish-workflow

Conversation

@Exairnous

@Exairnous Exairnous commented Jun 28, 2026

Copy link
Copy Markdown
Member

What?

Sets permissions to none, pins calls to external actions to specific commits, prevents credentials from actions/checkout from persisting, and replaces direct use of the GitHub variables in the shell execution with indirect usage via shell variables.

Why?

To minimize the chance of the workflow being hacked or vulnerable to a supply chain hack (pinning the external action calls helps with this), and in preparation to globally restrict permissions for all Hubs Foundation workflows.

According to Zizmor, filtering GitHub variables through environment variables prevents code injection via template expansion. Essentially, this should ensure an attacker can't manipulate data in GitHub to achieve remote code execution when the workflow is run.

Examples

N/A

How to test

  1. The majority of the workflow can be tested by just pushing the changes to a fork and running them.
  2. To test the actual publishing:
  3. Create a new branch on the Hubs Foundation's repository, ensure it is up-to-date with the latest changes from the master branch, then modify the workflow to allow your new branch to sync, then run the workflow.
  4. See that the workflow runs and completes successfully.

To verify that all the Zizmor issues have been addressed, run the following command from the repository folder and see that Zizmor reports no issues (that we care about) for the publish workflow.

docker run --rm --name zizmor -v .:/usr/repo ghcr.io/zizmorcore/zizmor --fix=all /usr/repo

Documentation of functionality

This doesn't change the functionality of the workflow, so no documentation update is needed.

Known limitations

This doesn't update any of the external workflow versions. I feel it is out of scope for this PR and can/should be done along with all the others in further PRs when addressing GitHub's required update to use Node 24+.

Alternatives considered

None.

Open questions

None.

Additional details or related context

These security improvements were advised by the Zizmor tool and GitHubSecurityLab/actions-permissions/monitor@bf82d13b9b10051d224345ab9184f5ede0a94289 #v1 Beta 9

Part of Hubs-Foundation/.github#13

What:

Sets permissions to none, pins calls to external actions to specific commits, prevents credentials from actions/checkout from persisting, and replaces direct use of the GitHub variables in the shell execution with indirect usage via shell variables.

Why:

To minimize the chance of the workflow being hacked or vulnerable to a supply chain hack (pinning the external action calls helps with this), and in preparation to globally restrict permissions for all Hubs Foundation workflows.

According to Zizmor, filtering GitHub variables through environment variables prevents code injection via template expansion.  Essentially, this should ensure an attacker can't manipulate data in GitHub to achieve remote code execution when the workflow is run.

Note:

These security improvements were advised by the Zizmor tool and GitHubSecurityLab/actions-permissions@bf82d13 #v1 Beta 9
@Exairnous Exairnous added the Roadmap: Programming Indicates that this issue/pull request is on the Programming Team roadmap label Jun 28, 2026
@Exairnous

Copy link
Copy Markdown
Member Author

Updated description.

@DougReeder DougReeder left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@DougReeder
DougReeder merged commit b434afc into master Jul 7, 2026
7 checks passed
@DougReeder
DougReeder deleted the secure-publish-workflow branch July 7, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Roadmap: Programming Indicates that this issue/pull request is on the Programming Team roadmap

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants