Add tpm package with Attestation/Validation functionality#40351
Add tpm package with Attestation/Validation functionality#40351strideynet merged 37 commits intomasterfrom
tpm package with Attestation/Validation functionality#40351Conversation
That is gonna big PR, no? Hard to spot changes and fixes also. Are you sure that's a good idea? |
Perhaps I'm overly worried about releasing "half complete" changes in v15/14 - there's nothing about them that makes me think it would be inherently bad about only some of the changes being released, it might just be odd for CLI commands etc to start showing up but for the backend implementation to not be complete |
|
Set a feature flag, hide all public facing changes until done, make RPCs return unimplemented when appropriate, then profit? |
|
(I do understand your worries about half complete changes though.) |
Seems reasonable. I can do that :) |
Co-authored-by: Alan Parra <alan.parra@goteleport.com>
Co-authored-by: Alan Parra <alan.parra@goteleport.com>
Co-authored-by: Alan Parra <alan.parra@goteleport.com>
Co-authored-by: Alan Parra <alan.parra@goteleport.com>
|
@strideynet See the table below for backport results.
|
* Add structure of `tpm` package * Add proto conversion methods * Add tests for proto conversions * Add startup stuff for tpm sim based tests * try and fail to write a fake ekcert to the tpm * Working ability to write to a TPM ekcert index * Tidy up * Add finishing touches to test and add godocs * Go mod tidy * Appease linter * Remove incorrectly copied comment * Tidy up line wrapping * Add license header * Update lib/tpm/tpm.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Update lib/tpm/tpm_simulator_test.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Update lib/tpm/validate.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Update lib/tpm/tpm.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Update lib/tpm/tpm_simulator_test.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Update lib/tpm/tpm_simulator_test.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Update lib/tpm/tpm_simulator_test.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Avoid managing closure in the attestWithTPM func * Use ekCertSerialHex const * Simpler JoinAuditAttributes method Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Add missing err return * Add remark on the nvram rsa ekcert index * Update lib/tpm/tpm_simulator_test.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Add subtests * Clarify in hex * Switch to testing exported iface * Use x509.CertPool and switch to testing public APi * Remove overly cautious check * Validate Validate params * Reuse strings builder when handling an odd number of hex digits * Switch to gocmp and struct for ekcert * Use return struct for Attest * Avoid marshalling PKIX key twice * Update lib/tpm/validate.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> --------- Co-authored-by: Alan Parra <alan.parra@goteleport.com>
* Add structure of `tpm` package * Add proto conversion methods * Add tests for proto conversions * Add startup stuff for tpm sim based tests * try and fail to write a fake ekcert to the tpm * Working ability to write to a TPM ekcert index * Tidy up * Add finishing touches to test and add godocs * Go mod tidy * Appease linter * Remove incorrectly copied comment * Tidy up line wrapping * Add license header * Update lib/tpm/tpm.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Update lib/tpm/tpm_simulator_test.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Update lib/tpm/validate.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Update lib/tpm/tpm.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Update lib/tpm/tpm_simulator_test.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Update lib/tpm/tpm_simulator_test.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Update lib/tpm/tpm_simulator_test.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Avoid managing closure in the attestWithTPM func * Use ekCertSerialHex const * Simpler JoinAuditAttributes method Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Add missing err return * Add remark on the nvram rsa ekcert index * Update lib/tpm/tpm_simulator_test.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Add subtests * Clarify in hex * Switch to testing exported iface * Use x509.CertPool and switch to testing public APi * Remove overly cautious check * Validate Validate params * Reuse strings builder when handling an odd number of hex digits * Switch to gocmp and struct for ekcert * Use return struct for Attest * Avoid marshalling PKIX key twice * Update lib/tpm/validate.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> --------- Co-authored-by: Alan Parra <alan.parra@goteleport.com>
…40495) * Add structure of `tpm` package * Add proto conversion methods * Add tests for proto conversions * Add startup stuff for tpm sim based tests * try and fail to write a fake ekcert to the tpm * Working ability to write to a TPM ekcert index * Tidy up * Add finishing touches to test and add godocs * Go mod tidy * Appease linter * Remove incorrectly copied comment * Tidy up line wrapping * Add license header * Update lib/tpm/tpm.go * Update lib/tpm/tpm_simulator_test.go * Update lib/tpm/validate.go * Update lib/tpm/tpm.go * Update lib/tpm/tpm_simulator_test.go * Update lib/tpm/tpm_simulator_test.go * Update lib/tpm/tpm_simulator_test.go * Avoid managing closure in the attestWithTPM func * Use ekCertSerialHex const * Simpler JoinAuditAttributes method * Add missing err return * Add remark on the nvram rsa ekcert index * Update lib/tpm/tpm_simulator_test.go * Add subtests * Clarify in hex * Switch to testing exported iface * Use x509.CertPool and switch to testing public APi * Remove overly cautious check * Validate Validate params * Reuse strings builder when handling an odd number of hex digits * Switch to gocmp and struct for ekcert * Use return struct for Attest * Avoid marshalling PKIX key twice * Update lib/tpm/validate.go --------- Co-authored-by: Alan Parra <alan.parra@goteleport.com>
…0351) (#40496) * Add `tpm` package with Attestation/Validation functionality (#40351) * Add structure of `tpm` package * Add proto conversion methods * Add tests for proto conversions * Add startup stuff for tpm sim based tests * try and fail to write a fake ekcert to the tpm * Working ability to write to a TPM ekcert index * Tidy up * Add finishing touches to test and add godocs * Go mod tidy * Appease linter * Remove incorrectly copied comment * Tidy up line wrapping * Add license header * Update lib/tpm/tpm.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Update lib/tpm/tpm_simulator_test.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Update lib/tpm/validate.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Update lib/tpm/tpm.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Update lib/tpm/tpm_simulator_test.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Update lib/tpm/tpm_simulator_test.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Update lib/tpm/tpm_simulator_test.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Avoid managing closure in the attestWithTPM func * Use ekCertSerialHex const * Simpler JoinAuditAttributes method Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Add missing err return * Add remark on the nvram rsa ekcert index * Update lib/tpm/tpm_simulator_test.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Add subtests * Clarify in hex * Switch to testing exported iface * Use x509.CertPool and switch to testing public APi * Remove overly cautious check * Validate Validate params * Reuse strings builder when handling an odd number of hex digits * Switch to gocmp and struct for ekcert * Use return struct for Attest * Avoid marshalling PKIX key twice * Update lib/tpm/validate.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> --------- Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Move indirect to correct block --------- Co-authored-by: Alan Parra <alan.parra@goteleport.com>
Part of #38558
As per RFD #38613
This is the foundational package for the new TPM joining functionality. It adds the client side element of attestation and the server side which can verify that attestation.