Skip to content

Conversation

@kartben
Copy link
Contributor

@kartben kartben commented Mar 17, 2025

This commit updates all GitHub Actions workflows to use specific SHAs for the actions instead of using tag-based versioning since tags are mutable.

Alternatively, we could keep actions/ and zephyrproject-rtos/ actions unpinned as they are rather unlikely to be compromised.

Will probably want to backport, too.

@kartben kartben marked this pull request as ready for review March 17, 2025 08:57
@zephyrbot zephyrbot added platform: nRF BSIM Nordic Semiconductors, nRF BabbleSim area: Continuous Integration labels Mar 17, 2025
Copy link
Member

@aescolar aescolar left a comment

Choose a reason for hiding this comment

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

+0
No complaints from me.
I only checked that the shas in the actions used from the bsim workflows seem to point to verified commits in the actions repos themselves and not forks. But not their code content.

pdgendt
pdgendt previously approved these changes Mar 17, 2025
Copy link
Contributor

@pdgendt pdgendt left a comment

Choose a reason for hiding this comment

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

+1, but we'll probably want to have dependabot working so we don't need to manually keep track of this.

@stephanosio / @nashif can it be verified that dependabot update PRs could be created?

I've submitted an issue dependabot/dependabot-core#11657 but I'm also not entirely sure if there's simply a setting disabled in the repository.
Looking at zephyr-testing, the updates do seem to work: zephyrproject-rtos/zephyr-testing#311

@nashif
Copy link
Member

nashif commented Mar 17, 2025

You would think we should be trusting actions from gh, i.e. those hosted at github.com/actions and apply the SHA solution only to non-github actions....

@nashif
Copy link
Member

nashif commented Mar 17, 2025

+1, but we'll probably want to have dependabot working so we don't need to manually keep track of this.

@stephanosio / @nashif can it be verified that dependabot update PRs could be created?

I checked everything related to that and it seems we have everything in place, not sure what is missing.

@kartben
Copy link
Contributor Author

kartben commented Mar 17, 2025

updated to only pins non actions/* (GitHub-owned) actions

This commit updates all GitHub Actions workflows to use specific
SHAs for the actions when they're not GitHub owned (`actions/*`)
instead of using tag-based versioning since tags are mutable.

Signed-off-by: Benjamin Cabé <[email protected]>
@kartben
Copy link
Contributor Author

kartben commented Mar 17, 2025

updated to only pins non actions/* (GitHub-owned) actions

FWIW it might still be best practice to pin everything - at least as per scorecard checks (https://scorecard.dev/viewer/?uri=github.com/zephyrproject-rtos/zephyr --- they do give a "not-so bad" score for Github-owned vs non-Github actions, but only way to get a 10/10 is to pin everything) -- I would be happy to revert to the original approach of pinning everything depending on people's feedback/thoughts on this.

@nashif
Copy link
Member

nashif commented Mar 17, 2025

FWIW it might still be best practice to pin everything - at least as per scorecard checks (scorecard.dev/viewer?uri=github.com/zephyrproject-rtos/zephyr --- they do give a "not-so bad" score for Github-owned vs non-Github actions, but only way to get a 10/10 is to pin everything) -- I would be happy to revert to the original approach of pinning everything depending on people's feedback/thoughts on this.

I have no problem with that, I was just wondering....

the scorcard needs lots of work in many areas, right now it is very bad in general (5.3)

@pdgendt
Copy link
Contributor

pdgendt commented Mar 17, 2025

Dependabot is able to run: see #87204, so I would be in favor of pinning all action versions.

@kartben
Copy link
Contributor Author

kartben commented Mar 17, 2025

Dependabot is able to run: see #87204, so I would be in favor of pinning all action versions.

Yeah I would agree -- basically we should be fine pinning ourselves to whatever SHA at a given point in time for all actions since we typically don't care about getting latest updates for minor bug fixes except when they're security fixes which Dependabot will let us know about.

Waiting a bit more to hear from others and will switch back to original "pin everything" approach if nobody feels strongly against it.

@nashif nashif added the Hotfix Fix for issues blocking development, i.e. upstream CI issues, tests failing in upstream CI , etc. label Mar 17, 2025
@nashif nashif merged commit e808ccf into zephyrproject-rtos:main Mar 18, 2025
23 checks passed
@pdgendt
Copy link
Contributor

pdgendt commented Mar 18, 2025

Why did this PR become a hotfix?

@kartben
Copy link
Contributor Author

kartben commented Mar 18, 2025

Dependabot is able to run: see #87204, so I would be in favor of pinning all action versions.

@pdgendt see #87309

jaci-nordic added a commit to jaci-nordic/sdk-nrf-1 that referenced this pull request Aug 20, 2025
Pinning to specific version and hashes helps with preventing supply
chain attacks.
Do not use custom tokens, rely on GH provided and managed tokens.
Update GitHub Actions workflows to follow principle of least privilege
Based on zephyr changes:
zephyrproject-rtos/zephyr#87184
zephyrproject-rtos/zephyr#87609
zephyrproject-rtos/zephyr#87510
zephyrproject-rtos/zephyr#87254

Signed-off-by: Jakub Ciesla <[email protected]>
@kartben kartben deleted the ci_actions_shas branch October 22, 2025 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Continuous Integration Hotfix Fix for issues blocking development, i.e. upstream CI issues, tests failing in upstream CI , etc. platform: nRF BSIM Nordic Semiconductors, nRF BabbleSim

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants