internal: Verify provider signatures on install#24617
Conversation
d6a5225 to
2eb234b
Compare
Codecov Report
|
apparentlymart
left a comment
There was a problem hiding this comment.
This looks good to me! I have some inline thingies, but they are minor and I think the overall approach here is nice.
| // concrete types: PackageLocalArchive, PackageLocalDir, or PackageHTTPURL. | ||
| type PackageLocation interface { | ||
| packageLocation() | ||
| String() string |
There was a problem hiding this comment.
This is a nice change! I like how this change looks in dir_modify.go
justincampbell
left a comment
There was a problem hiding this comment.
This looks great so far!
b5a9ab3 to
a78890d
Compare
apparentlymart
left a comment
There was a problem hiding this comment.
This makes sense to me! 🎉 Nice work.
Providers installed from the registry are accompanied by a list of checksums (the "SHA256SUMS" file), which is cryptographically signed to allow package authentication. The process of verifying this has multiple steps: - First we must verify that the SHA256 hash of the package archive matches the expected hash. This could be done for local installations too, in the future. - Next we ensure that the expected hash returned as part of the registry API response matches an entry in the checksum list. - Finally we verify the cryptographic signature of the checksum list, using the public keys provided by the registry. Each of these steps is implemented as a separate PackageAuthentication type. The local archive installation mechanism uses only the archive checksum authenticator, and the HTTP installation uses all three in the order given. The package authentication system now also returns a result value, which is used by command/init to display the result of the authentication process. There are three tiers of signature, each of which is presented differently to the user: - Signatures from the embedded HashiCorp public key indicate that the provider is officially supported by HashiCorp; - If the signing key is not from HashiCorp, it may have an associated trust signature, which indicates that the provider is from one of HashiCorp's trusted partners; - Otherwise, if the signature is valid, this is a community provider.
a78890d to
a5b3d49
Compare
|
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Providers installed from the registry are accompanied by a list of checksums (the "SHA256SUMS" file), which is cryptographically signed to allow package authentication. The process of verifying this has multiple steps:
Each of these steps is implemented as a separate
PackageAuthenticationtype. The local archive installation mechanism uses only the archive checksum authenticator, and the HTTP installation uses all three in the order given.The package authentication system now also returns a result value, which is used by command/init to display the result of the authentication process.
There are three tiers of signature, each of which is presented differently to the user:
Screenshots
Official, partner, and community providers: