Skip to content

Add guidance on pinning GitHub Actions and container images #69

@pellared

Description

@pellared

Why

A bad actor can force push a tag so that GitHub Action to do some malicious actions.

A bad actor can push a malicious container image under the same name.

What

We should use digest pinning to mitigate the possibility of using a malicious GitHub Actions and container images.
It should also make the build more reproducible.
Some references:

When using GitHub Actions we can add a comment with a after the digest (e.g. actions/checkout@01aecccf739ca6ff86c0539fbc67a7a5007bbc81 # v2.1.0).
Both Renovate and Dependabot can bump both the digest and the tag in the comment:

When using container images we can add the digest at the end (e.g. node:14.15.1@sha256:d938c1761e3afbae9242848ffbb95b9cc1cb0a24d889f8bd955204d347a7266e).
Both Renovate and Dependabot can bump the image name and the digest as well:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions