server_tls_policy.proto 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. // Copyright 2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.networksecurity.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/cloud/networksecurity/v1/tls.proto";
  19. import "google/protobuf/field_mask.proto";
  20. import "google/protobuf/timestamp.proto";
  21. option csharp_namespace = "Google.Cloud.NetworkSecurity.V1";
  22. option go_package = "google.golang.org/genproto/googleapis/cloud/networksecurity/v1;networksecurity";
  23. option java_multiple_files = true;
  24. option java_outer_classname = "ServerTlsPolicyProto";
  25. option java_package = "com.google.cloud.networksecurity.v1";
  26. option php_namespace = "Google\\Cloud\\NetworkSecurity\\V1";
  27. option ruby_package = "Google::Cloud::NetworkSecurity::V1";
  28. // ServerTlsPolicy is a resource that specifies how a server should authenticate
  29. // incoming requests. This resource itself does not affect configuration unless
  30. // it is attached to a target https proxy or endpoint config selector resource.
  31. message ServerTlsPolicy {
  32. option (google.api.resource) = {
  33. type: "networksecurity.googleapis.com/ServerTlsPolicy"
  34. pattern: "projects/{project}/locations/{location}/serverTlsPolicies/{server_tls_policy}"
  35. };
  36. // Specification of the MTLSPolicy.
  37. message MTLSPolicy {
  38. //
  39. // Defines the mechanism to obtain the Certificate Authority certificate to
  40. // validate the client certificate.
  41. repeated ValidationCA client_validation_ca = 1;
  42. }
  43. // Required. Name of the ServerTlsPolicy resource. It matches the pattern
  44. // `projects/*/locations/{location}/serverTlsPolicies/{server_tls_policy}`
  45. string name = 1 [(google.api.field_behavior) = REQUIRED];
  46. // Free-text description of the resource.
  47. string description = 2;
  48. // Output only. The timestamp when the resource was created.
  49. google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  50. // Output only. The timestamp when the resource was updated.
  51. google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  52. // Set of label tags associated with the resource.
  53. map<string, string> labels = 5;
  54. //
  55. // Determines if server allows plaintext connections. If set to true, server
  56. // allows plain text connections. By default, it is set to false. This setting
  57. // is not exclusive of other encryption modes. For example, if `allow_open`
  58. // and `mtls_policy` are set, server allows both plain text and mTLS
  59. // connections. See documentation of other encryption modes to confirm
  60. // compatibility.
  61. //
  62. // Consider using it if you wish to upgrade in place your deployment to TLS
  63. // while having mixed TLS and non-TLS traffic reaching port :80.
  64. bool allow_open = 6;
  65. //
  66. // Defines a mechanism to provision server identity (public and private keys).
  67. // Cannot be combined with `allow_open` as a permissive mode that allows both
  68. // plain text and TLS is not supported.
  69. CertificateProvider server_certificate = 7;
  70. //
  71. // Defines a mechanism to provision peer validation certificates for peer to
  72. // peer authentication (Mutual TLS - mTLS). If not specified, client
  73. // certificate will not be requested. The connection is treated as TLS and not
  74. // mTLS. If `allow_open` and `mtls_policy` are set, server allows both plain
  75. // text and mTLS connections.
  76. MTLSPolicy mtls_policy = 8;
  77. }
  78. // Request used by the ListServerTlsPolicies method.
  79. message ListServerTlsPoliciesRequest {
  80. // Required. The project and location from which the ServerTlsPolicies should
  81. // be listed, specified in the format `projects/*/locations/{location}`.
  82. string parent = 1 [
  83. (google.api.field_behavior) = REQUIRED,
  84. (google.api.resource_reference) = {
  85. type: "locations.googleapis.com/Location"
  86. }
  87. ];
  88. // Maximum number of ServerTlsPolicies to return per call.
  89. int32 page_size = 2;
  90. // The value returned by the last `ListServerTlsPoliciesResponse`
  91. // Indicates that this is a continuation of a prior
  92. // `ListServerTlsPolicies` call, and that the system
  93. // should return the next page of data.
  94. string page_token = 3;
  95. }
  96. // Response returned by the ListServerTlsPolicies method.
  97. message ListServerTlsPoliciesResponse {
  98. // List of ServerTlsPolicy resources.
  99. repeated ServerTlsPolicy server_tls_policies = 1;
  100. // If there might be more results than those appearing in this response, then
  101. // `next_page_token` is included. To get the next set of results, call this
  102. // method again using the value of `next_page_token` as `page_token`.
  103. string next_page_token = 2;
  104. }
  105. // Request used by the GetServerTlsPolicy method.
  106. message GetServerTlsPolicyRequest {
  107. // Required. A name of the ServerTlsPolicy to get. Must be in the format
  108. // `projects/*/locations/{location}/serverTlsPolicies/*`.
  109. string name = 1 [
  110. (google.api.field_behavior) = REQUIRED,
  111. (google.api.resource_reference) = {
  112. type: "networksecurity.googleapis.com/ServerTlsPolicy"
  113. }
  114. ];
  115. }
  116. // Request used by the CreateServerTlsPolicy method.
  117. message CreateServerTlsPolicyRequest {
  118. // Required. The parent resource of the ServerTlsPolicy. Must be in
  119. // the format `projects/*/locations/{location}`.
  120. string parent = 1 [
  121. (google.api.field_behavior) = REQUIRED,
  122. (google.api.resource_reference) = {
  123. child_type: "networksecurity.googleapis.com/ServerTlsPolicy"
  124. }
  125. ];
  126. // Required. Short name of the ServerTlsPolicy resource to be created. This value should
  127. // be 1-63 characters long, containing only letters, numbers, hyphens, and
  128. // underscores, and should not start with a number. E.g. "server_mtls_policy".
  129. string server_tls_policy_id = 2 [(google.api.field_behavior) = REQUIRED];
  130. // Required. ServerTlsPolicy resource to be created.
  131. ServerTlsPolicy server_tls_policy = 3 [(google.api.field_behavior) = REQUIRED];
  132. }
  133. // Request used by UpdateServerTlsPolicy method.
  134. message UpdateServerTlsPolicyRequest {
  135. // Optional. Field mask is used to specify the fields to be overwritten in the
  136. // ServerTlsPolicy resource by the update. The fields
  137. // specified in the update_mask are relative to the resource, not
  138. // the full request. A field will be overwritten if it is in the
  139. // mask. If the user does not provide a mask then all fields will be
  140. // overwritten.
  141. google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL];
  142. // Required. Updated ServerTlsPolicy resource.
  143. ServerTlsPolicy server_tls_policy = 2 [(google.api.field_behavior) = REQUIRED];
  144. }
  145. // Request used by the DeleteServerTlsPolicy method.
  146. message DeleteServerTlsPolicyRequest {
  147. // Required. A name of the ServerTlsPolicy to delete. Must be in
  148. // the format `projects/*/locations/{location}/serverTlsPolicies/*`.
  149. string name = 1 [
  150. (google.api.field_behavior) = REQUIRED,
  151. (google.api.resource_reference) = {
  152. type: "networksecurity.googleapis.com/ServerTlsPolicy"
  153. }
  154. ];
  155. }