Skip to content

ci: fix zizmor security lints#95

Merged
ubiratansoares merged 1 commit intorust-lang:masterfrom
oscarosk:fix-zizmor-security-lints
Apr 15, 2026
Merged

ci: fix zizmor security lints#95
ubiratansoares merged 1 commit intorust-lang:masterfrom
oscarosk:fix-zizmor-security-lints

Conversation

@oscarosk
Copy link
Copy Markdown
Contributor

Ran zizmor with the pedantic persona and fixed 6 out of 8 findings:

  • Pinned actions/checkout to v4 SHA (was unpinned at v2)
  • Pinned rust-lang/simpleinfra action to SHA (was unpinned at master)
  • Added persist-credentials: false to checkout step
  • Added permissions: contents: read at workflow level
  • Added concurrency group to prevent redundant CI runs
  • Added a zizmor CI job to catch future regressions

2 secrets-outside-env warnings remain because the deploy step passes AWS credentials directly to the upload-docker-image action as inputs. This cant be changed without modifying the upstream action.

Before: 8 findings (2 high, 5 medium, 1 low), After: 2 findings (2 medium)

Copy link
Copy Markdown
Contributor

@ubiratansoares ubiratansoares left a comment

Choose a reason for hiding this comment

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

Hi @oscarosk . Looks we are in the right track here, added one request and one suggestion to improve the PR a bit.

Comment thread .github/workflows/main.yml Outdated
Comment on lines +48 to +63
zizmor:
name: Zizmor
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout the source code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false

- name: Install zizmor
run: pip install zizmor

- name: Run zizmor
run: zizmor --persona=pedantic .github/workflows/ No newline at end of file
Copy link
Copy Markdown
Contributor

@ubiratansoares ubiratansoares Apr 12, 2026

Choose a reason for hiding this comment

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

Perhaps we can make the most of the official zizmor action here.

In addition, I personally don't think we need to configure the check as pedantic on CI, since they intended to be more informational audits and have no security impact in practice.

Comment thread .github/workflows/main.yml
@oscarosk
Copy link
Copy Markdown
Contributor Author

Thanks for the review @ubiratansoares I'll switch to the official zizmor action and drop the pedantic persona for CI. Will push the update shortly.

@oscarosk
Copy link
Copy Markdown
Contributor Author

Updated! Switched to the official zizmor-action and dropped the pedantic persona as suggested. Thanks for the pointers. Let me know if there's anything else to adjust.

Comment thread .github/workflows/main.yml Outdated
Comment on lines +59 to +60
- name: Install zizmor
run: pip install zizmor
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.

@oscarosk We can remove this step

@oscarosk
Copy link
Copy Markdown
Contributor Author

Removed the leftover pip install step.

@github-advanced-security
Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@oscarosk
Copy link
Copy Markdown
Contributor Author

oscarosk commented Apr 12, 2026

I have updated the workflow to use the official zizmor action, removed the pedantic configuration and install step and aligned it with the recommended setup. please let me know if anything else should be adjusted.

Comment thread .github/workflows/main.yml Outdated
security-events: write
steps:
- name: Checkout the source code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
Copy link
Copy Markdown
Member

@marcoieni marcoieni Apr 13, 2026

Choose a reason for hiding this comment

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

why you are using v4 instead of v6 for this new job?

Comment thread .github/workflows/main.yml Outdated

- name: Checkout the source code
uses: actions/checkout@v2
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
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.

why you updated to v4 instead of v6?

@oscarosk
Copy link
Copy Markdown
Contributor Author

Thanks for pointing that. I have updated actions/checkout to v6 in both jobs and pushed the change. Please let me know if there are any other adjustments needed.

@marcoieni
Copy link
Copy Markdown
Member

Thanks! Btw, why you chose v4 initially instead of v6?

@oscarosk
Copy link
Copy Markdown
Contributor Author

Thanks! Btw, why you chose v4 initially instead of v6?

I initially updated it from v2 to v4 while addressing the zizmor findings and didn’t check for a newer major version at that moment.

Copy link
Copy Markdown
Contributor

@ubiratansoares ubiratansoares left a comment

Choose a reason for hiding this comment

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

@oscarosk thanks for the updates.

I think me and @marcoieni agree that, when adding a CI check to lint with zizmor, we want the job to fail if there zizmor finds (new) issues. Hence, please adjust your PR, in a way that we allow these secrets outside an env for now.

In addition, squash your commits into a single one.

Comment thread .github/workflows/main.yml
- switch to official zizmor action
- opt out of advanced-security for now
- allow known secrets-outside-env finding temporarily
- update actions/checkout to v6
@oscarosk oscarosk force-pushed the fix-zizmor-security-lints branch from f014824 to 8659a08 Compare April 15, 2026 10:02
@oscarosk
Copy link
Copy Markdown
Contributor Author

I have squashed the commits into a single one as requested and confirmed that all checks are passing. Please let me know if anything else should be adjusted.

Copy link
Copy Markdown
Contributor

@ubiratansoares ubiratansoares left a comment

Choose a reason for hiding this comment

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

Thanks for this contribution @oscarosk

@ubiratansoares ubiratansoares merged commit ece150a into rust-lang:master Apr 15, 2026
2 checks passed
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