Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin dependencies in github action workflows and Dockerfile #595

Merged
merged 3 commits into from
Jan 13, 2022

Conversation

bobcallaway
Copy link
Member

Addressing https://github.com/ossf/scorecard/blob/main/docs/checks.md#pinned-dependencies

data from running: scorecard --show-details --repo=https://github.com/sigstore/rekor/ --checks Pinned-Dependencies --format json:

{
  "date": "2022-01-12",
  "repo": {
    "name": "github.com/sigstore/rekor",
    "commit": "91ff490a51a99b9bd726255f851aa22e6b2ce802"
  },
  "scorecard": {
    "version": "b79b3c3",
    "commit": "b79b3c357c99a38afabbdbdab1047c15c0db4afd"
  },
  "score": 2,
  "checks": [
    {
      "details": [
        "Warn: GitHub-owned action not pinned by hash: .github/workflows/build.yml:37",
        "Warn: third-party action not pinned by hash: .github/workflows/build.yml:38",
        "Warn: GitHub-owned action not pinned by hash: .github/workflows/build.yml:43",
        "Warn: third-party action not pinned by hash: .github/workflows/build.yml:50",
        "Warn: third-party action not pinned by hash: .github/workflows/build.yml:55",
        "Warn: GitHub-owned action not pinned by hash: .github/workflows/codeql-analysis.yml:38",
        "Warn: GitHub-owned action not pinned by hash: .github/workflows/codeql-analysis.yml:42",
        "Warn: GitHub-owned action not pinned by hash: .github/workflows/codeql-analysis.yml:46",
        "Warn: GitHub-owned action not pinned by hash: .github/workflows/codeql-analysis.yml:51",
        "Warn: GitHub-owned action not pinned by hash: .github/workflows/main.yml:49",
        "Warn: GitHub-owned action not pinned by hash: .github/workflows/main.yml:52",
        "Warn: third-party action not pinned by hash: .github/workflows/main.yml:55",
        "Warn: GitHub-owned action not pinned by hash: .github/workflows/main.yml:70",
        "Warn: GitHub-owned action not pinned by hash: .github/workflows/main.yml:75",
        "Warn: GitHub-owned action not pinned by hash: .github/workflows/main.yml:81",
        "Warn: GitHub-owned action not pinned by hash: .github/workflows/main.yml:29",
        "Warn: GitHub-owned action not pinned by hash: .github/workflows/main.yml:32",
        "Warn: GitHub-owned action not pinned by hash: .github/workflows/milestone.yml:26",
        "Warn: GitHub-owned action not pinned by hash: .github/workflows/validate-release.yml:42",
        "Warn: GitHub-owned action not pinned by hash: .github/workflows/validate-release.yml:45",
        "Warn: third-party action not pinned by hash: .github/workflows/validate-release.yml:48",
        "Warn: third-party action not pinned by hash: .github/workflows/validate-release.yml:50",
        "Warn: GitHub-owned action not pinned by hash: .github/workflows/verify.yml:25",
        "Warn: GitHub-owned action not pinned by hash: .github/workflows/verify.yml:28",
        "Warn: GitHub-owned action not pinned by hash: .github/workflows/verify.yml:43",
        "Warn: third-party action not pinned by hash: .github/workflows/verify.yml:47",
        "Warn: docker image not pinned by hash: Dockerfile:16",
        "Warn: docker image not pinned by hash: Dockerfile:33",
        "Warn: docker image not pinned by hash: Dockerfile:42",
        "Warn: go installation not pinned by hash: Dockerfile:43",
        "Info: no insecure (not pinned by hash) dependency downloads found in shell scripts",
        "Warn: go installation not pinned by hash: .github/workflows/verify.yml:33"
      ],
      "score": 2,
      "reason": "dependency not pinned by hash detected -- score normalized to 2",
      "name": "Pinned-Dependencies",
      "documentation": {
        "url": "https://github.com/ossf/scorecard/blob/b79b3c357c99a38afabbdbdab1047c15c0db4afd/docs/checks.md#pinned-dependencies",
        "short": "Determines if the project has declared and pinned its dependencies."
      }
    }
  ],
  "metadata": null
}

Signed-off-by: Bob Callaway [email protected]

Summary

Ticket Link

Fixes

Release Note


@bobcallaway bobcallaway requested a review from cpanato January 12, 2022 16:09
Copy link
Contributor

@asraa asraa left a comment

Choose a reason for hiding this comment

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

Does dependabot automatically pick up github actions workflow or do we need a dependabot config?

@cpanato
Copy link
Member

cpanato commented Jan 12, 2022

Does dependabot automatically pick up github actions workflow or do we need a dependabot config?

we already have the config for that https://github.com/sigstore/rekor/blob/main/.github/dependabot.yml#L27 but I'm not sure if dependabot will work for this approach or it only work for "tags"
lets see :)

@bobcallaway
Copy link
Member Author

Does dependabot automatically pick up github actions workflow or do we need a dependabot config?

we already have the config for that https://github.com/sigstore/rekor/blob/main/.github/dependabot.yml#L27 but I'm not sure if dependabot will work for this approach or it only work for "tags" lets see :)

Apparently they've been supporting this (update on digest, not just tag) for over a year - see https://github.com/google/go-github/pull/2049/files for an example

@bobcallaway
Copy link
Member Author

Does dependabot automatically pick up github actions workflow or do we need a dependabot config?

we already have the config for that https://github.com/sigstore/rekor/blob/main/.github/dependabot.yml#L27 but I'm not sure if dependabot will work for this approach or it only work for "tags" lets see :)

Apparently they've been supporting this (update on digest, not just tag) for over a year - see https://github.com/google/go-github/pull/2049/files for an example

@cpanato Only thing to be aware of is that the # vX.Y.Z comment at the end of the digest value isn't automatically updated by dependabot so ideally we'd manually update this for each dependabot PR when they come in (until they add this capability)

@dlorenc dlorenc merged commit 3912444 into sigstore:main Jan 13, 2022
@github-actions github-actions bot added this to the v1.0.0 milestone Jan 13, 2022
@cpanato
Copy link
Member

cpanato commented Jan 13, 2022

that is ok, we can do that :)

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