loopbackio / security

[WORK IN PROGRESS] A centralised repository for all security-related matters on the LoopBack Project.
MIT License
4 stars 1 forks source link

Pin GitHub Actions to Git commit hash #27

Open achrinza opened 2 years ago

achrinza commented 2 years ago

Currently, we're inconsistently referencing third-party GitHub Actions by Git tags, Git branches and the Git commit hash.

Git tags and Git branches can be re-pointed to a different Git commit hash without our explicit knowledge. Hence, this poses a security risk as a malicious GitHub Action that we depend on can go under the radar without our knowledge.

We should standardise on referencing by Git commit hash.

Renovate currently handles keeping the GitHub Actions up-to-date. It supports updating Git commit hash while following the Git tags:

The syntax would be either of the following:

- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # renovate: tag=v2.4.0
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # tag=v2.4.0
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2.4.0

Loosely-related to https://github.com/loopbackio/security/issues/25 (Part of OpenSSF Scorecard check).

GitHub repositories