From 4add0b29e66adfce5df33754c922ac8cc496fb71 Mon Sep 17 00:00:00 2001 From: Greg Greenway Date: Mon, 14 Aug 2017 13:55:36 -0700 Subject: [PATCH 1/5] Add configuration for TLS session ticket encryption key, to allow session resumption across hot-restart or between multiple envoy instances. Signed-off-by: Greg Greenway --- api/tls_context.proto | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/tls_context.proto b/api/tls_context.proto index 6926f9781..303e205ff 100644 --- a/api/tls_context.proto +++ b/api/tls_context.proto @@ -110,4 +110,9 @@ message DownstreamTlsContext { // If specified, Envoy will reject connections without a valid and matching SNI. google.protobuf.BoolValue require_sni = 3; + + // Keys to encrypt/decrypt TLS session tickets for session resumption. The first + // key is used to encrypt new tickets that are created. All keys are candidates + // for decrypting received tickets. + repeated DataSource tls_session_ticket_key = 4; } From 139f85f83740a6280bf983dfd31d7aad6177ca2d Mon Sep 17 00:00:00 2001 From: Greg Greenway Date: Wed, 27 Sep 2017 12:52:58 -0700 Subject: [PATCH 2/5] Move keys to their own message so the message can be used by KDS. Signed-off-by: Greg Greenway --- api/tls_context.proto | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/api/tls_context.proto b/api/tls_context.proto index 303e205ff..fc7b6e1e1 100644 --- a/api/tls_context.proto +++ b/api/tls_context.proto @@ -41,6 +41,16 @@ message TlsCertificate { repeated DataSource signed_certificate_timestamp = 5; } +message TlsSessionTicketKeys { + // Optional identifier for this set of keys + string name = 1; + + // Keys to encrypt/decrypt TLS session tickets for session resumption. The first + // key is used to encrypt new tickets that are created. All keys are candidates + // for decrypting received tickets. + repeated DataSource keys = 2; +} + message CertificateValidationContext { // TLS certificate data containing certificate authority certificates to use // in verifying a presented certificate. If not specified and a certificate is @@ -111,8 +121,5 @@ message DownstreamTlsContext { // If specified, Envoy will reject connections without a valid and matching SNI. google.protobuf.BoolValue require_sni = 3; - // Keys to encrypt/decrypt TLS session tickets for session resumption. The first - // key is used to encrypt new tickets that are created. All keys are candidates - // for decrypting received tickets. - repeated DataSource tls_session_ticket_key = 4; + TlsSessionTicketKeys tls_session_ticket_keys = 4; } From 16a3adf0d7e508792dc0f52b7823a753cef449ae Mon Sep 17 00:00:00 2001 From: Greg Greenway Date: Thu, 28 Sep 2017 14:55:40 -0700 Subject: [PATCH 3/5] Add documentation of the requirements of each key. Signed-off-by: Greg Greenway --- api/tls_context.proto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/tls_context.proto b/api/tls_context.proto index fc7b6e1e1..cc42e38be 100644 --- a/api/tls_context.proto +++ b/api/tls_context.proto @@ -48,6 +48,9 @@ message TlsSessionTicketKeys { // Keys to encrypt/decrypt TLS session tickets for session resumption. The first // key is used to encrypt new tickets that are created. All keys are candidates // for decrypting received tickets. + // + // Each key must be exactly 80 bytes long, containing cryptographically-secure random + // data. For example, the output of "openssl rand 80". repeated DataSource keys = 2; } From 0dffb5e0b3b01809a6efb7058bd017bcb78da592 Mon Sep 17 00:00:00 2001 From: Greg Greenway Date: Tue, 3 Oct 2017 10:30:56 -0700 Subject: [PATCH 4/5] Merging with SDS changes Signed-off-by: Greg Greenway --- api/sds.proto | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/api/sds.proto b/api/sds.proto index e56a9f853..8fb26145e 100644 --- a/api/sds.proto +++ b/api/sds.proto @@ -60,16 +60,13 @@ message TlsCertificate { } message TlsSessionTicketKeys { - // Optional identifier for this set of keys - string name = 1; - // Keys to encrypt/decrypt TLS session tickets for session resumption. The first // key is used to encrypt new tickets that are created. All keys are candidates // for decrypting received tickets. // // Each key must be exactly 80 bytes long, containing cryptographically-secure random // data. For example, the output of "openssl rand 80". - repeated DataSource keys = 2; + repeated DataSource keys = 1; } message CertificateValidationContext { @@ -160,5 +157,6 @@ message Secret { string name = 1; oneof type { TlsCertificate tls_certificate = 2; + TlsSessionTicketKeys session_ticket_keys = 3; } } From 1e3afed53132a50434edb58ced8cbdb3a88093b3 Mon Sep 17 00:00:00 2001 From: Greg Greenway Date: Tue, 3 Oct 2017 12:37:58 -0700 Subject: [PATCH 5/5] Make session_ticket_keys be oneof inline keys or SdsSecretConfig Signed-off-by: Greg Greenway --- api/sds.proto | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/sds.proto b/api/sds.proto index 8fb26145e..687db60a0 100644 --- a/api/sds.proto +++ b/api/sds.proto @@ -141,7 +141,10 @@ message DownstreamTlsContext { // If specified, Envoy will reject connections without a valid and matching SNI. google.protobuf.BoolValue require_sni = 3; - TlsSessionTicketKeys tls_session_ticket_keys = 4; + oneof session_ticket_keys { + TlsSessionTicketKeys keys = 4; + SdsSecretConfig config = 5; + } } message SdsSecretConfig {