Adding session recording encryption key rotation to tctl#57780
Adding session recording encryption key rotation to tctl#57780
tctl#57780Conversation
9975ad2 to
dfcb23e
Compare
896e8b5 to
21eba68
Compare
dfcb23e to
08205b8
Compare
10f19bc to
61774dc
Compare
08205b8 to
0bbff95
Compare
61774dc to
03399fb
Compare
0bbff95 to
cfd8a0d
Compare
03399fb to
9851d3e
Compare
07e70f4 to
feb25d0
Compare
9851d3e to
793694f
Compare
616902e to
c061345
Compare
793694f to
6c9d34c
Compare
c66edd3 to
2590df4
Compare
facc111 to
a3a55f4
Compare
fd07f4f to
9c37f95
Compare
031a470 to
9a4027f
Compare
9c37f95 to
0f3ecd9
Compare
5e29b99 to
51248d7
Compare
94498db to
775f225
Compare
b552e2d to
e10692f
Compare
| // SessionRecordingEncryptionConfig is the session_recording_config.encryption | ||
| // section of the Teleport config file. It maps directly to [types.SessionRecordingEncryptionConfig] | ||
| type SessionRecordingEncryptionConfig struct { | ||
| Enabled bool `yaml:"enabled,omitempty"` | ||
| ManualKeyManagement *struct { | ||
| Enabled bool `yaml:"enabled,omitempty"` | ||
| ActiveKeys []*types.KeyLabel `yaml:"active_keys,omitempty"` | ||
| RotatedKeys []*types.KeyLabel `yaml:"rotated_keys,omitempty"` | ||
| } `yaml:"manual_key_management,omitempty"` | ||
| } | ||
|
|
||
| // SessionRecordingConfig is the session_recording_config section of the Teleport config file. | ||
| // It maps directly to [types.SessionRecordingConfigSpecV2] | ||
| type SessionRecordingConfig struct { | ||
| Mode string `yaml:"mode"` | ||
| ProxyChecksHostKeys *types.BoolOption `yaml:"proxy_checks_host_keys,omitempty"` | ||
| Encryption *SessionRecordingEncryptionConfig `yaml:"encryption,omitempty"` | ||
| } |
There was a problem hiding this comment.
This seems like it could cause problems if we forget to update this in response to any changes made to the types.SessionRecordingEncryptionConfig resource. Why is this needed?
There was a problem hiding this comment.
Fields with underscores were broken before I added this, so manual_key_management and proxy_checks_host_keys. If there's a way to get the yaml parser to use the json tags during unmarshaling, that would definitely be better
There was a problem hiding this comment.
@atburke any thoughts here regarding the yaml parser and json tags with _?
There was a problem hiding this comment.
The yaml parser isn't seeing the json tags at all and is assuming camel case instead of snake case. I don't think any of our current yaml packages can handle mixed yaml and json tags within the same object; we'll have to either do what you're doing here or get goccy just for ReadConfig.
775f225 to
9c09e0e
Compare
d1d5594 to
8efaa74
Compare
c164220 to
e34ceba
Compare
8efaa74 to
837bb3a
Compare
e34ceba to
e125ded
Compare
e5ff62d to
d3ad732
Compare
broken session_recording_config when using fileconf
d3ad732 to
aa0a7c9
Compare
…#57780) broken session_recording_config when using fileconf
…#57780) broken session_recording_config when using fileconf
…#57780) broken session_recording_config when using fileconf
This PR adds subcommands for rotating session recording encryption keys under
tctl recordings encryption. They arerotate,status,complete-rotation, androllback-rotation.rotatewill start a rotation by provisioning a new key and adding it to the active set of encryption keys.statuswill print the state of each key along with its fingerprint.RotatedKeysresource which makes it usable for replaysrotateandrollbackshould ultimately result in no changes being applied.There's also a fix for using
manual_key_managementfrom the fileconfig included.