endpoint_policy.proto 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. // Copyright 2021 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.networkservices.v1beta1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/cloud/networkservices/v1beta1/common.proto";
  19. import "google/protobuf/field_mask.proto";
  20. import "google/protobuf/timestamp.proto";
  21. option csharp_namespace = "Google.Cloud.NetworkServices.V1Beta1";
  22. option go_package = "google.golang.org/genproto/googleapis/cloud/networkservices/v1beta1;networkservices";
  23. option java_multiple_files = true;
  24. option java_outer_classname = "EndpointPolicyProto";
  25. option java_package = "com.google.cloud.networkservices.v1beta1";
  26. option php_namespace = "Google\\Cloud\\NetworkServices\\V1beta1";
  27. option ruby_package = "Google::Cloud::NetworkServices::V1beta1";
  28. option (google.api.resource_definition) = {
  29. type: "networksecurity.googleapis.com/AuthorizationPolicy"
  30. pattern: "projects/{project}/locations/{location}/authorizationPolicies/{authorization_policy}"
  31. };
  32. option (google.api.resource_definition) = {
  33. type: "networksecurity.googleapis.com/ServerTlsPolicy"
  34. pattern: "projects/{project}/locations/{location}/serverTlsPolicies/{server_tls_policy}"
  35. };
  36. option (google.api.resource_definition) = {
  37. type: "networksecurity.googleapis.com/ClientTlsPolicy"
  38. pattern: "projects/{project}/locations/{location}/clientTlsPolicies/{client_tls_policy}"
  39. };
  40. // EndpointPolicy is a resource that helps apply desired configuration
  41. // on the endpoints that match specific criteria.
  42. // For example, this resource can be used to apply "authentication config"
  43. // an all endpoints that serve on port 8080.
  44. message EndpointPolicy {
  45. option (google.api.resource) = {
  46. type: "networkservices.googleapis.com/EndpointPolicy"
  47. pattern: "projects/{project}/locations/{location}/endpointPolicies/{endpoint_policy}"
  48. };
  49. // The type of endpoint policy.
  50. enum EndpointPolicyType {
  51. // Default value. Must not be used.
  52. ENDPOINT_POLICY_TYPE_UNSPECIFIED = 0;
  53. // Represents a proxy deployed as a sidecar.
  54. SIDECAR_PROXY = 1;
  55. // Represents a proxyless gRPC backend.
  56. GRPC_SERVER = 2;
  57. }
  58. // Required. Name of the EndpointPolicy resource. It matches pattern
  59. // `projects/{project}/locations/global/endpointPolicies/{endpoint_policy}`.
  60. string name = 1 [(google.api.field_behavior) = REQUIRED];
  61. // Output only. The timestamp when the resource was created.
  62. google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  63. // Output only. The timestamp when the resource was updated.
  64. google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  65. // Optional. Set of label tags associated with the EndpointPolicy resource.
  66. map<string, string> labels = 4 [(google.api.field_behavior) = OPTIONAL];
  67. // Required. The type of endpoint policy. This is primarily used to validate
  68. // the configuration.
  69. EndpointPolicyType type = 5 [(google.api.field_behavior) = REQUIRED];
  70. // Optional. This field specifies the URL of AuthorizationPolicy resource that
  71. // applies authorization policies to the inbound traffic at the
  72. // matched endpoints. Refer to Authorization. If this field is not
  73. // specified, authorization is disabled(no authz checks) for this
  74. // endpoint. Applicable only when EndpointPolicyType is
  75. // SIDECAR_PROXY.
  76. string authorization_policy = 7 [
  77. (google.api.field_behavior) = OPTIONAL,
  78. (google.api.resource_reference) = {
  79. type: "networksecurity.googleapis.com/AuthorizationPolicy"
  80. }
  81. ];
  82. // Required. A matcher that selects endpoints to which the policies should be applied.
  83. EndpointMatcher endpoint_matcher = 9 [(google.api.field_behavior) = REQUIRED];
  84. // Optional. Port selector for the (matched) endpoints. If no port selector is
  85. // provided, the matched config is applied to all ports.
  86. TrafficPortSelector traffic_port_selector = 10 [(google.api.field_behavior) = OPTIONAL];
  87. // Optional. A free-text description of the resource. Max length 1024 characters.
  88. string description = 11 [(google.api.field_behavior) = OPTIONAL];
  89. // Optional. A URL referring to ServerTlsPolicy resource. ServerTlsPolicy is used to
  90. // determine the authentication policy to be applied to terminate the inbound
  91. // traffic at the identified backends. If this field is not set,
  92. // authentication is disabled(open) for this endpoint.
  93. string server_tls_policy = 12 [
  94. (google.api.field_behavior) = OPTIONAL,
  95. (google.api.resource_reference) = {
  96. type: "networksecurity.googleapis.com/ServerTlsPolicy"
  97. }
  98. ];
  99. // Optional. A URL referring to a ClientTlsPolicy resource. ClientTlsPolicy can be set
  100. // to specify the authentication for traffic from the proxy to the actual
  101. // endpoints. More specifically, it is applied to the outgoing traffic from
  102. // the proxy to the endpoint. This is typically used for sidecar model where
  103. // the proxy identifies itself as endpoint to the control plane, with the
  104. // connection between sidecar and endpoint requiring authentication. If this
  105. // field is not set, authentication is disabled(open). Applicable only when
  106. // EndpointPolicyType is SIDECAR_PROXY.
  107. string client_tls_policy = 13 [
  108. (google.api.field_behavior) = OPTIONAL,
  109. (google.api.resource_reference) = {
  110. type: "networksecurity.googleapis.com/ClientTlsPolicy"
  111. }
  112. ];
  113. }
  114. // Request used with the ListEndpointPolicies method.
  115. message ListEndpointPoliciesRequest {
  116. // Required. The project and location from which the EndpointPolicies should be
  117. // listed, specified in the format `projects/*/locations/global`.
  118. string parent = 1 [
  119. (google.api.field_behavior) = REQUIRED,
  120. (google.api.resource_reference) = {
  121. child_type: "networkservices.googleapis.com/EndpointPolicy"
  122. }
  123. ];
  124. // Maximum number of EndpointPolicies to return per call.
  125. int32 page_size = 2;
  126. // The value returned by the last `ListEndpointPoliciesResponse`
  127. // Indicates that this is a continuation of a prior
  128. // `ListEndpointPolicies` call, and that the system should return the
  129. // next page of data.
  130. string page_token = 3;
  131. }
  132. // Response returned by the ListEndpointPolicies method.
  133. message ListEndpointPoliciesResponse {
  134. // List of EndpointPolicy resources.
  135. repeated EndpointPolicy endpoint_policies = 1;
  136. // If there might be more results than those appearing in this response, then
  137. // `next_page_token` is included. To get the next set of results, call this
  138. // method again using the value of `next_page_token` as `page_token`.
  139. string next_page_token = 2;
  140. }
  141. // Request used with the GetEndpointPolicy method.
  142. message GetEndpointPolicyRequest {
  143. // Required. A name of the EndpointPolicy to get. Must be in the format
  144. // `projects/*/locations/global/endpointPolicies/*`.
  145. string name = 1 [
  146. (google.api.field_behavior) = REQUIRED,
  147. (google.api.resource_reference) = {
  148. type: "networkservices.googleapis.com/EndpointPolicy"
  149. }
  150. ];
  151. }
  152. // Request used with the CreateEndpointPolicy method.
  153. message CreateEndpointPolicyRequest {
  154. // Required. The parent resource of the EndpointPolicy. Must be in the
  155. // format `projects/*/locations/global`.
  156. string parent = 1 [
  157. (google.api.field_behavior) = REQUIRED,
  158. (google.api.resource_reference) = {
  159. child_type: "networkservices.googleapis.com/EndpointPolicy"
  160. }
  161. ];
  162. // Required. Short name of the EndpointPolicy resource to be created.
  163. // E.g. "CustomECS".
  164. string endpoint_policy_id = 2 [(google.api.field_behavior) = REQUIRED];
  165. // Required. EndpointPolicy resource to be created.
  166. EndpointPolicy endpoint_policy = 3 [(google.api.field_behavior) = REQUIRED];
  167. }
  168. // Request used with the UpdateEndpointPolicy method.
  169. message UpdateEndpointPolicyRequest {
  170. // Optional. Field mask is used to specify the fields to be overwritten in the
  171. // EndpointPolicy resource by the update.
  172. // The fields specified in the update_mask are relative to the resource, not
  173. // the full request. A field will be overwritten if it is in the mask. If the
  174. // user does not provide a mask then all fields will be overwritten.
  175. google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL];
  176. // Required. Updated EndpointPolicy resource.
  177. EndpointPolicy endpoint_policy = 2 [(google.api.field_behavior) = REQUIRED];
  178. }
  179. // Request used with the DeleteEndpointPolicy method.
  180. message DeleteEndpointPolicyRequest {
  181. // Required. A name of the EndpointPolicy to delete. Must be in the format
  182. // `projects/*/locations/global/endpointPolicies/*`.
  183. string name = 1 [
  184. (google.api.field_behavior) = REQUIRED,
  185. (google.api.resource_reference) = {
  186. type: "networkservices.googleapis.com/EndpointPolicy"
  187. }
  188. ];
  189. }