tls.proto 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. syntax = "proto3";
  2. package envoy.api.v2.auth;
  3. import "envoy/api/v2/auth/common.proto";
  4. import "envoy/api/v2/auth/secret.proto";
  5. import "google/protobuf/duration.proto";
  6. import "google/protobuf/wrappers.proto";
  7. import "udpa/annotations/migrate.proto";
  8. import "udpa/annotations/status.proto";
  9. import "validate/validate.proto";
  10. option java_package = "io.envoyproxy.envoy.api.v2.auth";
  11. option java_outer_classname = "TlsProto";
  12. option java_multiple_files = true;
  13. option go_package = "github.com/envoyproxy/go-control-plane/envoy/api/v2/auth";
  14. option (udpa.annotations.file_migrate).move_to_package =
  15. "envoy.extensions.transport_sockets.tls.v3";
  16. option (udpa.annotations.file_status).package_version_status = FROZEN;
  17. // [#protodoc-title: TLS transport socket]
  18. // [#extension: envoy.transport_sockets.tls]
  19. // The TLS contexts below provide the transport socket configuration for upstream/downstream TLS.
  20. message UpstreamTlsContext {
  21. // Common TLS context settings.
  22. //
  23. // .. attention::
  24. //
  25. // Server certificate verification is not enabled by default. Configure
  26. // :ref:`trusted_ca<envoy_api_field_auth.CertificateValidationContext.trusted_ca>` to enable
  27. // verification.
  28. CommonTlsContext common_tls_context = 1;
  29. // SNI string to use when creating TLS backend connections.
  30. string sni = 2 [(validate.rules).string = {max_bytes: 255}];
  31. // If true, server-initiated TLS renegotiation will be allowed.
  32. //
  33. // .. attention::
  34. //
  35. // TLS renegotiation is considered insecure and shouldn't be used unless absolutely necessary.
  36. bool allow_renegotiation = 3;
  37. // Maximum number of session keys (Pre-Shared Keys for TLSv1.3+, Session IDs and Session Tickets
  38. // for TLSv1.2 and older) to store for the purpose of session resumption.
  39. //
  40. // Defaults to 1, setting this to 0 disables session resumption.
  41. google.protobuf.UInt32Value max_session_keys = 4;
  42. }
  43. // [#next-free-field: 8]
  44. message DownstreamTlsContext {
  45. // Common TLS context settings.
  46. CommonTlsContext common_tls_context = 1;
  47. // If specified, Envoy will reject connections without a valid client
  48. // certificate.
  49. google.protobuf.BoolValue require_client_certificate = 2;
  50. // If specified, Envoy will reject connections without a valid and matching SNI.
  51. // [#not-implemented-hide:]
  52. google.protobuf.BoolValue require_sni = 3;
  53. oneof session_ticket_keys_type {
  54. // TLS session ticket key settings.
  55. TlsSessionTicketKeys session_ticket_keys = 4;
  56. // Config for fetching TLS session ticket keys via SDS API.
  57. SdsSecretConfig session_ticket_keys_sds_secret_config = 5;
  58. // Config for controlling stateless TLS session resumption: setting this to true will cause the TLS
  59. // server to not issue TLS session tickets for the purposes of stateless TLS session resumption.
  60. // If set to false, the TLS server will issue TLS session tickets and encrypt/decrypt them using
  61. // the keys specified through either :ref:`session_ticket_keys <envoy_api_field_auth.DownstreamTlsContext.session_ticket_keys>`
  62. // or :ref:`session_ticket_keys_sds_secret_config <envoy_api_field_auth.DownstreamTlsContext.session_ticket_keys_sds_secret_config>`.
  63. // If this config is set to false and no keys are explicitly configured, the TLS server will issue
  64. // TLS session tickets and encrypt/decrypt them using an internally-generated and managed key, with the
  65. // implication that sessions cannot be resumed across hot restarts or on different hosts.
  66. bool disable_stateless_session_resumption = 7;
  67. }
  68. // If specified, ``session_timeout`` will change the maximum lifetime (in seconds) of the TLS session.
  69. // Currently this value is used as a hint for the `TLS session ticket lifetime (for TLSv1.2) <https://tools.ietf.org/html/rfc5077#section-5.6>`_.
  70. // Only seconds can be specified (fractional seconds are ignored).
  71. google.protobuf.Duration session_timeout = 6 [(validate.rules).duration = {
  72. lt {seconds: 4294967296}
  73. gte {}
  74. }];
  75. }
  76. // TLS context shared by both client and server TLS contexts.
  77. // [#next-free-field: 9]
  78. message CommonTlsContext {
  79. message CombinedCertificateValidationContext {
  80. // How to validate peer certificates.
  81. CertificateValidationContext default_validation_context = 1
  82. [(validate.rules).message = {required: true}];
  83. // Config for fetching validation context via SDS API.
  84. SdsSecretConfig validation_context_sds_secret_config = 2
  85. [(validate.rules).message = {required: true}];
  86. }
  87. reserved 5;
  88. // TLS protocol versions, cipher suites etc.
  89. TlsParameters tls_params = 1;
  90. // :ref:`Multiple TLS certificates <arch_overview_ssl_cert_select>` can be associated with the
  91. // same context to allow both RSA and ECDSA certificates.
  92. //
  93. // Only a single TLS certificate is supported in client contexts. In server contexts, the first
  94. // RSA certificate is used for clients that only support RSA and the first ECDSA certificate is
  95. // used for clients that support ECDSA.
  96. repeated TlsCertificate tls_certificates = 2;
  97. // Configs for fetching TLS certificates via SDS API.
  98. repeated SdsSecretConfig tls_certificate_sds_secret_configs = 6
  99. [(validate.rules).repeated = {max_items: 1}];
  100. oneof validation_context_type {
  101. // How to validate peer certificates.
  102. CertificateValidationContext validation_context = 3;
  103. // Config for fetching validation context via SDS API.
  104. SdsSecretConfig validation_context_sds_secret_config = 7;
  105. // Combined certificate validation context holds a default CertificateValidationContext
  106. // and SDS config. When SDS server returns dynamic CertificateValidationContext, both dynamic
  107. // and default CertificateValidationContext are merged into a new CertificateValidationContext
  108. // for validation. This merge is done by Message::MergeFrom(), so dynamic
  109. // CertificateValidationContext overwrites singular fields in default
  110. // CertificateValidationContext, and concatenates repeated fields to default
  111. // CertificateValidationContext, and logical OR is applied to boolean fields.
  112. CombinedCertificateValidationContext combined_validation_context = 8;
  113. }
  114. // Supplies the list of ALPN protocols that the listener should expose. In
  115. // practice this is likely to be set to one of two values (see the
  116. // :ref:`codec_type
  117. // <envoy_api_field_config.filter.network.http_connection_manager.v2.HttpConnectionManager.codec_type>`
  118. // parameter in the HTTP connection manager for more information):
  119. //
  120. // * "h2,http/1.1" If the listener is going to support both HTTP/2 and HTTP/1.1.
  121. // * "http/1.1" If the listener is only going to support HTTP/1.1.
  122. //
  123. // There is no default for this parameter. If empty, Envoy will not expose ALPN.
  124. repeated string alpn_protocols = 4;
  125. }