Skip to content

Adding RotatedKey resource and service#57576

Merged
eriktate merged 1 commit intomasterfrom
eriktate/rotated-keys-resource
Aug 14, 2025
Merged

Adding RotatedKey resource and service#57576
eriktate merged 1 commit intomasterfrom
eriktate/rotated-keys-resource

Conversation

@eriktate
Copy link
Copy Markdown
Contributor

@eriktate eriktate commented Aug 5, 2025

This PR adds some new proto definitions and RPCs in support of rotating session recording encryption keys. UpdateRotatedKey was omitted from the API because the concept of updating a rotated key doesn't really make sense. The stored Fingerprint (which is also the lookup key) is generated by the public key which itself is generated by the private key, so any sort of update would create an invalid resource.

@github-actions github-actions Bot requested review from Joerger and rosstimothy August 5, 2025 21:09
@eriktate eriktate force-pushed the eriktate/add-tags-to-encryption-keys branch from 664199b to 0e89496 Compare August 5, 2025 21:23
@eriktate eriktate force-pushed the eriktate/rotated-keys-resource branch from 63d66c5 to 508e290 Compare August 5, 2025 21:23
Comment thread api/proto/teleport/recordingencryption/v1/recording_encryption.proto Outdated
@@ -105,18 +157,42 @@ func newRecordingEncryptionParser() *recordingEncryptionParser {
}

func (p *recordingEncryptionParser) parse(event backend.Event) (types.Resource, error) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure how to feel about using the same parser for the separate kinds, especially since we decided not to go with rotated_keys as a subkind. What do you think about just adding a separate parser for rotated keys?

Copy link
Copy Markdown
Contributor Author

@eriktate eriktate Aug 6, 2025

Choose a reason for hiding this comment

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

Yeah I'm not too sure about it either to be honest. I only combined them because they share a service, but that doesn't mean they have to share a parser as well. I can split these up 👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you might have also combined them because they share a key prefix - rotated key events will actually be caught by the recordingEncryptionParser. Maybe you just need to filter out rotated keys in parse? It looks like that's what the userParser does since a lot of resources have the /web/users prefix.

But if there isn't any real reason to re-use the recording_encryption prefix (e.g. a delete on /web/users/<user> deletes all owned resources with /web/users/<user>/ prefix), I would just change the rotated key prefix to recording_encryption_rotated or something instead.

@eriktate eriktate force-pushed the eriktate/add-tags-to-encryption-keys branch from 0e89496 to f1414fa Compare August 6, 2025 14:27
@eriktate eriktate force-pushed the eriktate/rotated-keys-resource branch from 508e290 to 54a4224 Compare August 6, 2025 14:27
@eriktate eriktate force-pushed the eriktate/add-tags-to-encryption-keys branch from f1414fa to e28461b Compare August 6, 2025 20:27
@eriktate eriktate force-pushed the eriktate/rotated-keys-resource branch from 54a4224 to 4d2c853 Compare August 6, 2025 20:42
Comment thread api/proto/teleport/recordingencryption/v1/recording_encryption.proto Outdated
v1.KeyState state = 2;
}

// The empty body of a GetRotationState response.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The comment says empty, but the message has one field. Let's rework the comments on these messages that reference an empty message.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It looks like this comment was update but all other empty messages still reference being empty. Let's change them all to be something meaningful-ish without referencing being empty so that if someone adds a field later without updating the comment there isn't a weird disconnect.

Comment thread lib/services/local/recording_encryption.go Outdated
@eriktate eriktate force-pushed the eriktate/add-tags-to-encryption-keys branch 2 times, most recently from adc5214 to 53cf180 Compare August 7, 2025 23:24
@eriktate eriktate force-pushed the eriktate/rotated-keys-resource branch from d36f4ea to aab1fbd Compare August 7, 2025 23:24
@eriktate eriktate force-pushed the eriktate/add-tags-to-encryption-keys branch 2 times, most recently from 6954ed8 to 9756e5d Compare August 11, 2025 19:16
@eriktate eriktate force-pushed the eriktate/rotated-keys-resource branch 3 times, most recently from 6b4df30 to f9dc21c Compare August 12, 2025 19:47
@eriktate eriktate force-pushed the eriktate/add-tags-to-encryption-keys branch from 82748f6 to b9fbaad Compare August 12, 2025 20:45
Base automatically changed from eriktate/add-tags-to-encryption-keys to master August 13, 2025 15:35
@eriktate eriktate force-pushed the eriktate/rotated-keys-resource branch from f9dc21c to 3efc234 Compare August 13, 2025 18:22
@eriktate eriktate added the no-changelog Indicates that a PR does not require a changelog entry label Aug 13, 2025
Comment thread lib/services/local/recording_encryption.go Outdated
@eriktate eriktate force-pushed the eriktate/rotated-keys-resource branch from 9dc4864 to 9f2fc98 Compare August 14, 2025 17:29
@eriktate eriktate force-pushed the eriktate/rotated-keys-resource branch from 9f2fc98 to b609982 Compare August 14, 2025 17:57
@eriktate eriktate added this pull request to the merge queue Aug 14, 2025
Merged via the queue into master with commit 4ab416e Aug 14, 2025
43 checks passed
@eriktate eriktate deleted the eriktate/rotated-keys-resource branch August 14, 2025 18:51
eriktate added a commit that referenced this pull request Aug 15, 2025
eriktate added a commit that referenced this pull request Aug 27, 2025
eriktate added a commit that referenced this pull request Sep 2, 2025
eriktate added a commit that referenced this pull request Sep 2, 2025
eriktate added a commit that referenced this pull request Sep 2, 2025
eriktate added a commit that referenced this pull request Sep 3, 2025
github-merge-queue Bot pushed a commit that referenced this pull request Sep 3, 2025
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Indicates that a PR does not require a changelog entry size/md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants