Adding decryption support to keystore backends#54428
Conversation
f6e998a to
c42490e
Compare
64fe22b to
b84468a
Compare
b84468a to
3b7b4bb
Compare
3b7b4bb to
e4ef25d
Compare
nklaassen
left a comment
There was a problem hiding this comment.
it's looking pretty good to me there's just a few lingering comments
| } | ||
|
|
||
| // GetDecrypter returns the [crypto.Decrypter] associated with a given EncryptionKeyPair if accessible. | ||
| func (m *Manager) GetDecrypter(ctx context.Context, keyPair *types.EncryptionKeyPair) (crypto.Decrypter, error) { |
There was a problem hiding this comment.
in reality if you have multiple auths with PKCS#11 HSMs, you're going to have multiple possible EncryptionKeyPairs, and I don't think you're going to know which one to pass here. This is why the signer equivalents like GetJWTSigner pass the whole CA and then the keystore.Manager selects the key it can actually use with the available keystore backends. but maybe it will be better to just refactor this in a later PR
There was a problem hiding this comment.
I account for this in a later PR by calling GetDecrypter for each EncryptionKeyPair. I could modify this to accept a slice or an iterator of EncryptionkeyPairs, but it actually ends up being useful to know the result for each key during a rotation as a check for which keys are accessible to a given keystore.Manager. In particular when a key is being rotated the Manager can resolve both the rotated pair and the new pair, but the caller needs to make decisions based on the state of both of them (e.g. if the new pair is still unfulfilled, the key marked as rotating is still the active key. If it's fulfilled then the rotating key needs to be marked as rotated).
|
@nklaassen @vapopov friendly bump! |
c3b364d to
6a5041a
Compare
6a5041a to
d4161b8
Compare
d4161b8 to
027543d
Compare
027543d to
cd91ba6
Compare
gcp, pkcs11, and software backends
cd91ba6 to
12ade31
Compare
…#54428) gcp, pkcs11, and software backends
…#54428) gcp, pkcs11, and software backends
…#54428) gcp, pkcs11, and software backends
…#54428) gcp, pkcs11, and software backends
* adding support for encryption/decryption keys to keystore manager (#54428, #55652) * adds new protos for resources related to encrypted session recordings and updates the existing SessionRecordingConfig protos to include a Status (#54780) * adding local service implementation for recording encryption resources (#54816) * adding Manager for RecordingEncryption resources that handles shared ops more complex than CRUD (#55078) * Adding session recording plugin for `age` (#55120) * adding Manager for RecordingEncryption resources that handles shared ops more complex than CRUD * adding age plugin wrapping default X25519 Identity/Recipient implementation with hooks to more efficiently lookup private keys given their respective public key * Adding recording encryption and playback for `sync` modes (#54901) * adding cache for RecordingEncryption (#55857) * adding recording_encryption service protos (#55121) * adding async recording encryption with gRPC multipart uploader (#55859) * adding file configuration for encrypted session recording (#56200) * Switching recording encryption to unwrap keys using direct keystore RSA decryption (#56776) * adding manual key management config (#56920) * updating protos for recording encryption (#57055) * Add missing handling for recording encryption configs and keys (#57279) * updating protos for recording encryption * changing labels for encryption keys to prevent automatic cleanup, adjusting pkcs11 host UUID check to allow for key sharing of encryption keys, preventing cloud tenants from enabling manual key management, preventing use of recording encryption in FIPS mode * adding new protos for rotated keys and the local service for interacting (#57576) with them * Switching encryption keys from PEM to ASN.1 DER encoding (#58137) * using pregenerated RSA4096 key for keystore tests because generation is too slow (#58138) * extending precomputed RSA keys to support 4096-bit keys (#58251) * adding rotation process to Manager and exposing with new RPCs and (#57577) * adding rotation sub commands for recording encryption keys and fixing (#57780) broken session_recording_config when using fileconf * using more reliable method of validating key bit length
This PR adds support for generating encryption/decryption keypairs as well as retrieving decrypters from keystore backends.