endpoint_policy.proto 9.1 KB

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