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

Allow plugin version to be specified as SHA-1 hash #1486

Closed
morancj opened this issue Aug 16, 2022 · 4 comments
Closed

Allow plugin version to be specified as SHA-1 hash #1486

morancj opened this issue Aug 16, 2022 · 4 comments

Comments

@morancj
Copy link

morancj commented Aug 16, 2022

Introduction

Allow plugin version to be specified as commit hash, as well as tag. Similar to pinning GitHub Actions versions to a commit.

Proposal

For example, instead of

plugin "aws" {
  enabled = true
  version = "0.16.0"
  source  = "github.com/terraform-linters/tflint-ruleset-aws"
}

I'd like to be able to use version = "fa6372da4fafa89fdc1052d966742a070a716725".

plugin "aws" {
  enabled = true
  version = "fa6372da4fafa89fdc1052d966742a070a716725"  # "0.16.0"
  source  = "github.com/terraform-linters/tflint-ruleset-aws"
}

References

https://michaelheap.com/ensure-github-actions-pinned-sha/
https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-third-party-actions

@bendrucker
Copy link
Member

Verification is currently provided via a signing_key:

https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/plugins.md#signing_key

In theory we could also provide the ability to set a checksum directly rather than trusting the one in the GitHub release.

0.16.0 refers to a release via a tag. It is the release that contains the built artifacts (compressed binaries, checksums).

In GitHub Actions, the content is stored directly in git, rather than as release artifacts. Git provides built-in immutable identifiers for all content (commit SHAs). Releases are inherently mutable and can be referenced by ID or tag only. It's not possible to refer to releases by a commit SHA.

@wata727
Copy link
Member

wata727 commented Aug 17, 2022

Maybe we need a dependency lockfile like terraform.lock.hcl?

@bendrucker
Copy link
Member

Yeah I'd agree that's the right solution. Finding and pasting checksums is a poor user experience and in practice leads most people opt out of integrity checking. Lock files make integrity checking part of the default workflow.

@wata727
Copy link
Member

wata727 commented Dec 29, 2022

Opened #1634 for the introduction of dependency lockfile. Closing this issue.

@wata727 wata727 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants