Skip to content

Secure GHA with zizmor - #400

Merged
gforcada merged 7 commits into
2.xfrom
384-add-zizmor
Aug 8, 2026
Merged

Secure GHA with zizmor#400
gforcada merged 7 commits into
2.xfrom
384-add-zizmor

Conversation

@gforcada

@gforcada gforcada commented Aug 2, 2026

Copy link
Copy Markdown
Member

Part of #384

Note

⚠️ I'm not adding zizmor either as a GHA nor within pre-commit or such. The reason being that zizmor complains, rightfully so, about GHA not using hash-pinning, but can not update it.

pinact or tools like that can, but need to be checked first how to integrate them.

While we discuss and prototype how to best integrate it, the first quick fixes from zizmor are already worth merging IMHO.

@ericof if you run uvx zizmor . in this repository there are a few warning about some actions that you added, could you have a look whenever you have time, they are about token permissions and their scope, which I don't have enough knowledge about the actions themselves to make an estimated guess on what would be the proper fix.

@gforcada gforcada added the 04 type: enhancement making existing stuff better label Aug 2, 2026
@gforcada
gforcada force-pushed the 384-add-zizmor branch 2 times, most recently from c28c6e5 to ecd12ba Compare August 2, 2026 13:28
@ericof

ericof commented Aug 2, 2026

Copy link
Copy Markdown
Member

@gforcada thanks for the heads up. I need to review all the existing workflows and actions when it comes to permissions and versions

@gforcada
gforcada force-pushed the 384-add-zizmor branch 2 times, most recently from 422b455 to 35b41fa Compare August 7, 2026 18:02
shell: bash
run: |
uvx ruff@${{ inputs.version-ruff }} format --diff
uvx ruff@${INPUTS_VERSION_RUFF} format --diff

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.

I do not understand the indirection, but you got my attention here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's about template injection: https://docs.zizmor.sh/audits/#template-injection

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.

I will also add this checks to cookieplone-templates.

@ericof ericof 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

@gforcada
gforcada merged commit 111bd98 into 2.x Aug 8, 2026
4 checks passed
@gforcada
gforcada deleted the 384-add-zizmor branch August 8, 2026 07:18
ericof added a commit that referenced this pull request Aug 12, 2026
…uts (#405)

* Document every shared workflow and the quoting rules for options inputs

Since #400 the options-style inputs are expanded by the shell from an
environment variable instead of being substituted into the script as
literal text. Unquoted parameter expansion still splits on whitespace,
but it does not perform quote removal, so quote characters in the value
end up as literal characters in the argument. A value such as

    zpretty-options: '--extend-exclude "/rss/(rss\.xml|search-rss)\.pt$"'

now reaches zpretty with the double quotes attached, the pattern matches
nothing, and the excluded files are checked after all. The reference
documentation recommended exactly that form.

Describe the actual behaviour in a dedicated section, mark the two
affected inputs, and fix the example to the unquoted form.

While here, close the remaining gaps in the same reference:

- Document the inputs of all fifteen reusable workflows. Only
  backend-lint had a table.
- Add the five workflows that were missing entirely: coverage, circular,
  dependencies, qa and release_ready.
- Correct the three composite action tables, which between them omitted
  five inputs and misdescribed setup_uv.
- Correct the container registry secret names, documented as
  registry-username and registry-password rather than username and
  password.
- Distinguish container-image-build from container-image-push by their
  shared registry-backed build cache.
- Record that reusable workflows declare no permissions of their own, and
  state what frontend-storybook needs from its caller in order to deploy.

Closes #404

* Let Dependabot reach the composite actions

For the github-actions ecosystem, directory "/" covers .github/workflows
and a root-level action.yml. Our composite actions live in
.github/actions/<name>/action.yml, which is neither, so their
dependencies were never updated.

The dependency graph confirms the blind spot: actions/setup-node does not
appear at all, and astral-sh/setup-uv appears only at the versions used by
the workflows, never at the version pinned inside the composite actions.
Every commit touching .github/actions since it was created has been a
manual bump.

Use the directories key so the composite actions are scanned as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

04 type: enhancement making existing stuff better

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants