1- // Copyright 2021 Google LLC.
1+ // Copyright 2021 Google LLC
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
1111// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212// See the License for the specific language governing permissions and
1313// limitations under the License.
14- //
1514
1615syntax = "proto3" ;
1716
1817package google.cloud.binaryauthorization.v1beta1 ;
1918
20- import "google/api/annotations.proto" ;
2119import "google/api/field_behavior.proto" ;
2220import "google/api/resource.proto" ;
2321import "google/protobuf/timestamp.proto" ;
22+ import "google/api/annotations.proto" ;
2423
2524option cc_enable_arenas = true ;
2625option csharp_namespace = "Google.Cloud.BinaryAuthorization.V1Beta1" ;
@@ -31,12 +30,12 @@ option java_package = "com.google.cloud.binaryauthorization.v1beta1";
3130option php_namespace = "Google\\Cloud\\BinaryAuthorization\\V1beta1" ;
3231option ruby_package = "Google::Cloud::BinaryAuthorization::V1beta1" ;
3332
34- // A [policy][google.cloud.binaryauthorization.v1beta1.Policy] for container
35- // image binary authorization.
33+ // A [policy][google.cloud.binaryauthorization.v1beta1.Policy] for Binary Authorization.
3634message Policy {
3735 option (google.api.resource ) = {
3836 type : "binaryauthorization.googleapis.com/Policy"
3937 pattern : "projects/{project}/policy"
38+ pattern : "locations/{location}/policy"
4039 };
4140
4241 enum GlobalPolicyEvaluationMode {
@@ -61,14 +60,12 @@ message Policy {
6160 // policy for common system-level images. Images not covered by the global
6261 // policy will be subject to the project admission policy. This setting
6362 // has no effect when specified inside a global admission policy.
64- GlobalPolicyEvaluationMode global_policy_evaluation_mode = 7
65- [(google.api.field_behavior ) = OPTIONAL ];
63+ GlobalPolicyEvaluationMode global_policy_evaluation_mode = 7 [(google.api.field_behavior ) = OPTIONAL ];
6664
6765 // Optional. Admission policy allowlisting. A matching admission request will
6866 // always be permitted. This feature is typically used to exclude Google or
6967 // third-party infrastructure images from Binary Authorization policies.
70- repeated AdmissionWhitelistPattern admission_whitelist_patterns = 2
71- [(google.api.field_behavior ) = OPTIONAL ];
68+ repeated AdmissionWhitelistPattern admission_whitelist_patterns = 2 [(google.api.field_behavior ) = OPTIONAL ];
7269
7370 // Optional. Per-cluster admission rules. Cluster spec format:
7471 // `location.clusterId`. There can be at most one admission rule per cluster
@@ -77,38 +74,50 @@ message Policy {
7774 // (e.g. us-central1).
7875 // For `clusterId` syntax restrictions see
7976 // https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters.
80- map <string , AdmissionRule > cluster_admission_rules = 3
81- [(google.api.field_behavior ) = OPTIONAL ];
77+ map <string , AdmissionRule > cluster_admission_rules = 3 [(google.api.field_behavior ) = OPTIONAL ];
78+
79+ // Optional. Per-kubernetes-namespace admission rules. K8s namespace spec format:
80+ // `[a-z.-]+`, e.g. `some-namespace`
81+ map <string , AdmissionRule > kubernetes_namespace_admission_rules = 10 [(google.api.field_behavior ) = OPTIONAL ];
82+
83+ // Optional. Per-kubernetes-service-account admission rules. Service account
84+ // spec format: `namespace:serviceaccount`. e.g. `test-ns:default`
85+ map <string , AdmissionRule > kubernetes_service_account_admission_rules = 8 [(google.api.field_behavior ) = OPTIONAL ];
86+
87+ // Optional. Per-istio-service-identity admission rules. Istio service
88+ // identity spec format:
89+ // `spiffe://<domain>/ns/<namespace>/sa/<serviceaccount>` or
90+ // `<domain>/ns/<namespace>/sa/<serviceaccount>`
91+ // e.g. `spiffe://example.com/ns/test-ns/sa/default`
92+ map <string , AdmissionRule > istio_service_identity_admission_rules = 9 [(google.api.field_behavior ) = OPTIONAL ];
8293
8394 // Required. Default admission rule for a cluster without a per-cluster, per-
8495 // kubernetes-service-account, or per-istio-service-identity admission rule.
85- AdmissionRule default_admission_rule = 4
86- [(google.api.field_behavior ) = REQUIRED ];
96+ AdmissionRule default_admission_rule = 4 [(google.api.field_behavior ) = REQUIRED ];
8797
8898 // Output only. Time when the policy was last updated.
89- google.protobuf.Timestamp update_time = 5
90- [(google.api.field_behavior ) = OUTPUT_ONLY ];
99+ google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior ) = OUTPUT_ONLY ];
91100}
92101
93- // An [admission allowlist
94- // pattern][google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern]
95- // exempts images from checks by [admission
96- // rules][google.cloud.binaryauthorization.v1beta1.AdmissionRule].
102+ // An [admission allowlist pattern][google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern] exempts images
103+ // from checks by [admission rules][google.cloud.binaryauthorization.v1beta1.AdmissionRule].
97104message AdmissionWhitelistPattern {
98- // An image name pattern to allow , in the form `registry/path/to/image`.
105+ // An image name pattern to allowlist , in the form `registry/path/to/image`.
99106 // This supports a trailing `*` as a wildcard, but this is allowed only in
100- // text after the `registry/` part.
107+ // text after the `registry/` part. `*` wildcard does not match `/`, i.e.,
108+ // `gcr.io/nginx*` matches `gcr.io/nginx@latest`, but it does not match
109+ // `gcr.io/nginx/image`. This also supports a trailing `**` wildcard which
110+ // matches subdirectories, i.e., `gcr.io/nginx**` matches
111+ // `gcr.io/nginx/image`.
101112 string name_pattern = 1 ;
102113}
103114
104- // An [admission rule][google.cloud.binaryauthorization.v1beta1.AdmissionRule]
105- // specifies either that all container images used in a pod creation request
106- // must be attested to by one or more
107- // [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], that all pod
108- // creations will be allowed, or that all pod creations will be denied.
115+ // An [admission rule][google.cloud.binaryauthorization.v1beta1.AdmissionRule] specifies either that all container images
116+ // used in a pod creation request must be attested to by one or more
117+ // [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], that all pod creations will be allowed, or that all
118+ // pod creations will be denied.
109119//
110- // Images matching an [admission allowlist
111- // pattern][google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern]
120+ // Images matching an [admission allowlist pattern][google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern]
112121// are exempted from admission rules and will never block a pod creation.
113122message AdmissionRule {
114123 enum EvaluationMode {
@@ -119,7 +128,7 @@ message AdmissionRule {
119128 ALWAYS_ALLOW = 1 ;
120129
121130 // This rule allows a pod creation if all the attestors listed in
122- // ' require_attestations_by' have valid attestations for all of the
131+ // ` require_attestations_by` have valid attestations for all of the
123132 // images in the pod spec.
124133 REQUIRE_ATTESTATION = 2 ;
125134
@@ -152,16 +161,15 @@ message AdmissionRule {
152161 //
153162 // Note: this field must be non-empty when the evaluation_mode field specifies
154163 // REQUIRE_ATTESTATION, otherwise it must be empty.
155- repeated string require_attestations_by = 2
156- [(google.api.field_behavior ) = OPTIONAL ];
164+ repeated string require_attestations_by = 2 [(google.api.field_behavior ) = OPTIONAL ];
157165
158166 // Required. The action when a pod creation is denied by the admission rule.
159167 EnforcementMode enforcement_mode = 3 [(google.api.field_behavior ) = REQUIRED ];
160168}
161169
162- // An [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] that attests
163- // to container image artifacts. An existing attestor cannot be modified except
164- // where indicated.
170+ // An [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] that attests to container image
171+ // artifacts. An existing attestor cannot be modified except where
172+ // indicated.
165173message Attestor {
166174 option (google.api.resource ) = {
167175 type : "binaryauthorization.googleapis.com/Attestor"
@@ -176,24 +184,22 @@ message Attestor {
176184 // The field may be displayed in chooser dialogs.
177185 string description = 6 [(google.api.field_behavior ) = OPTIONAL ];
178186
179- // Required. Identifies an
180- // [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] that attests
181- // to a container image artifact. This determines how an attestation will be
182- // stored, and how it will be used during policy enforcement. Updates may not
183- // change the attestor type, but individual attestor fields may be updated
187+ // Required. Identifies an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] that attests to a
188+ // container image artifact. This determines how an attestation will
189+ // be stored, and how it will be used during policy
190+ // enforcement. Updates may not change the attestor type, but individual
191+ // attestor fields may be updated.
184192 oneof attestor_type {
185193 // A Drydock ATTESTATION_AUTHORITY Note, created by the user.
186194 UserOwnedDrydockNote user_owned_drydock_note = 3 ;
187195 }
188196
189197 // Output only. Time when the attestor was last updated.
190- google.protobuf.Timestamp update_time = 4
191- [(google.api.field_behavior ) = OUTPUT_ONLY ];
198+ google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior ) = OUTPUT_ONLY ];
192199}
193200
194- // An [user owned drydock
195- // note][google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote]
196- // references a Drydock ATTESTATION_AUTHORITY Note created by the user.
201+ // An [user owned drydock note][google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote] references a Drydock
202+ // ATTESTATION_AUTHORITY Note created by the user.
197203message UserOwnedDrydockNote {
198204 // Required. The Drydock resource name of a ATTESTATION_AUTHORITY Note,
199205 // created by the user, in the format: `projects/*/notes/*` (or the legacy
@@ -213,8 +219,7 @@ message UserOwnedDrydockNote {
213219 //
214220 // If this field is empty, this attestor always returns that no
215221 // valid attestations exist.
216- repeated AttestorPublicKey public_keys = 2
217- [(google.api.field_behavior ) = OPTIONAL ];
222+ repeated AttestorPublicKey public_keys = 2 [(google.api.field_behavior ) = OPTIONAL ];
218223
219224 // Output only. This field will contain the service account email address
220225 // that this Attestor will use as the principal when querying Container
@@ -225,8 +230,7 @@ message UserOwnedDrydockNote {
225230 // This email address is fixed for the lifetime of the Attestor, but callers
226231 // should not make any other assumptions about the service account email;
227232 // future versions may use an email based on a different naming pattern.
228- string delegation_service_account_email = 3
229- [(google.api.field_behavior ) = OUTPUT_ONLY ];
233+ string delegation_service_account_email = 3 [(google.api.field_behavior ) = OUTPUT_ONLY ];
230234}
231235
232236// A public key in the PkixPublicKey format (see
@@ -241,6 +245,8 @@ message PkixPublicKey {
241245 // See https://cloud.google.com/kms/docs/algorithms. In the future, BinAuthz
242246 // might support additional public key types independently of Tink and/or KMS.
243247 enum SignatureAlgorithm {
248+ option allow_alias = true ;
249+
244250 // Not specified.
245251 SIGNATURE_ALGORITHM_UNSPECIFIED = 0 ;
246252
@@ -271,11 +277,20 @@ message PkixPublicKey {
271277 // ECDSA on the NIST P-256 curve with a SHA256 digest.
272278 ECDSA_P256_SHA256 = 9 ;
273279
280+ // ECDSA on the NIST P-256 curve with a SHA256 digest.
281+ EC_SIGN_P256_SHA256 = 9 ;
282+
274283 // ECDSA on the NIST P-384 curve with a SHA384 digest.
275284 ECDSA_P384_SHA384 = 10 ;
276285
286+ // ECDSA on the NIST P-384 curve with a SHA384 digest.
287+ EC_SIGN_P384_SHA384 = 10 ;
288+
277289 // ECDSA on the NIST P-521 curve with a SHA512 digest.
278290 ECDSA_P521_SHA512 = 11 ;
291+
292+ // ECDSA on the NIST P-521 curve with a SHA512 digest.
293+ EC_SIGN_P521_SHA512 = 11 ;
279294 }
280295
281296 // A PEM-encoded public key, as described in
@@ -290,9 +305,8 @@ message PkixPublicKey {
290305 SignatureAlgorithm signature_algorithm = 2 ;
291306}
292307
293- // An [attestor public
294- // key][google.cloud.binaryauthorization.v1beta1.AttestorPublicKey] that will be
295- // used to verify attestations signed by this attestor.
308+ // An [attestor public key][google.cloud.binaryauthorization.v1beta1.AttestorPublicKey] that will be used to verify
309+ // attestations signed by this attestor.
296310message AttestorPublicKey {
297311 // Optional. A descriptive comment. This field may be updated.
298312 string comment = 1 [(google.api.field_behavior ) = OPTIONAL ];
0 commit comments