Skip to content

Commit bceaea9

Browse files
Google APIscopybara-github
authored andcommitted
feat: Publish Binary Authorization ContinuousValidationEvent proto.
This is used in the new Continuous Validation feature: https://cloud.google.com/binary-authorization/docs/overview-cv Committer: @rbutoi PiperOrigin-RevId: 373173593
1 parent 6c96d19 commit bceaea9

2 files changed

Lines changed: 177 additions & 32 deletions

File tree

google/cloud/binaryauthorization/v1beta1/BUILD.bazel

Lines changed: 80 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,46 +9,19 @@
99
# * extra_protoc_file_parameters
1010
# The complete list of preserved parameters can be found in the source code.
1111

12+
# This is an API workspace, having public visibility by default makes perfect sense.
13+
package(default_visibility = ["//visibility:public"])
14+
1215
##############################################################################
1316
# Common
1417
##############################################################################
1518
load("@rules_proto//proto:defs.bzl", "proto_library")
16-
load(
17-
"@com_google_googleapis_imports//:imports.bzl",
18-
"csharp_gapic_assembly_pkg",
19-
"csharp_gapic_library",
20-
"csharp_grpc_library",
21-
"csharp_proto_library",
22-
"go_gapic_assembly_pkg",
23-
"go_gapic_library",
24-
"go_proto_library",
25-
"go_test",
26-
"java_gapic_assembly_gradle_pkg",
27-
"java_gapic_library",
28-
"java_gapic_test",
29-
"java_grpc_library",
30-
"java_proto_library",
31-
"nodejs_gapic_assembly_pkg",
32-
"nodejs_gapic_library",
33-
"proto_library_with_info",
34-
"py_gapic_assembly_pkg",
35-
"py_gapic_library",
36-
"ruby_cloud_gapic_library",
37-
"ruby_gapic_assembly_pkg",
38-
"ruby_grpc_library",
39-
"ruby_proto_library",
40-
php_gapic_assembly_pkg = "php_gapic_assembly_pkg2",
41-
php_gapic_library = "php_gapic_library2",
42-
php_grpc_library = "php_grpc_library2",
43-
php_proto_library = "php_proto_library2",
44-
)
45-
46-
# This is an API workspace, having public visibility by default makes perfect sense.
47-
package(default_visibility = ["//visibility:public"])
19+
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
4820

4921
proto_library(
5022
name = "binaryauthorization_proto",
5123
srcs = [
24+
"continuous_validation_logging.proto",
5225
"resources.proto",
5326
"service.proto",
5427
],
@@ -70,6 +43,18 @@ proto_library_with_info(
7043
],
7144
)
7245

46+
##############################################################################
47+
# Java
48+
##############################################################################
49+
load(
50+
"@com_google_googleapis_imports//:imports.bzl",
51+
"java_gapic_assembly_gradle_pkg",
52+
"java_gapic_library",
53+
"java_gapic_test",
54+
"java_grpc_library",
55+
"java_proto_library",
56+
)
57+
7358
java_proto_library(
7459
name = "binaryauthorization_java_proto",
7560
deps = [":binaryauthorization_proto"],
@@ -112,6 +97,17 @@ java_gapic_assembly_gradle_pkg(
11297
],
11398
)
11499

100+
##############################################################################
101+
# Go
102+
##############################################################################
103+
load(
104+
"@com_google_googleapis_imports//:imports.bzl",
105+
"go_gapic_assembly_pkg",
106+
"go_gapic_library",
107+
"go_proto_library",
108+
"go_test",
109+
)
110+
115111
go_proto_library(
116112
name = "binaryauthorization_go_proto",
117113
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
@@ -152,6 +148,15 @@ go_gapic_assembly_pkg(
152148
],
153149
)
154150

151+
##############################################################################
152+
# Python
153+
##############################################################################
154+
load(
155+
"@com_google_googleapis_imports//:imports.bzl",
156+
"py_gapic_assembly_pkg",
157+
"py_gapic_library",
158+
)
159+
155160
py_gapic_library(
156161
name = "binaryauthorization_py_gapic",
157162
srcs = [":binaryauthorization_proto"],
@@ -166,6 +171,17 @@ py_gapic_assembly_pkg(
166171
],
167172
)
168173

174+
##############################################################################
175+
# PHP
176+
##############################################################################
177+
load(
178+
"@com_google_googleapis_imports//:imports.bzl",
179+
php_gapic_assembly_pkg = "php_gapic_assembly_pkg2",
180+
php_gapic_library = "php_gapic_library2",
181+
php_grpc_library = "php_grpc_library2",
182+
php_proto_library = "php_proto_library2",
183+
)
184+
169185
php_proto_library(
170186
name = "binaryauthorization_php_proto",
171187
deps = [":binaryauthorization_proto"],
@@ -181,6 +197,7 @@ php_gapic_library(
181197
name = "binaryauthorization_php_gapic",
182198
srcs = [":binaryauthorization_proto_with_info"],
183199
grpc_service_config = "binaryauthorization_grpc_service_config.json",
200+
service_yaml = "binaryauthorization_v1beta1.yaml",
184201
deps = [
185202
":binaryauthorization_php_grpc",
186203
":binaryauthorization_php_proto",
@@ -197,6 +214,15 @@ php_gapic_assembly_pkg(
197214
],
198215
)
199216

217+
##############################################################################
218+
# Node.js
219+
##############################################################################
220+
load(
221+
"@com_google_googleapis_imports//:imports.bzl",
222+
"nodejs_gapic_assembly_pkg",
223+
"nodejs_gapic_library",
224+
)
225+
200226
nodejs_gapic_library(
201227
name = "binaryauthorization_nodejs_gapic",
202228
package_name = "@google-cloud/binary-authorization",
@@ -216,6 +242,17 @@ nodejs_gapic_assembly_pkg(
216242
],
217243
)
218244

245+
##############################################################################
246+
# Ruby
247+
##############################################################################
248+
load(
249+
"@com_google_googleapis_imports//:imports.bzl",
250+
"ruby_cloud_gapic_library",
251+
"ruby_gapic_assembly_pkg",
252+
"ruby_grpc_library",
253+
"ruby_proto_library",
254+
)
255+
219256
ruby_proto_library(
220257
name = "binaryauthorization_ruby_proto",
221258
deps = [":binaryauthorization_proto"],
@@ -257,6 +294,17 @@ ruby_gapic_assembly_pkg(
257294
],
258295
)
259296

297+
##############################################################################
298+
# C#
299+
##############################################################################
300+
load(
301+
"@com_google_googleapis_imports//:imports.bzl",
302+
"csharp_gapic_assembly_pkg",
303+
"csharp_gapic_library",
304+
"csharp_grpc_library",
305+
"csharp_proto_library",
306+
)
307+
260308
csharp_proto_library(
261309
name = "binaryauthorization_csharp_proto",
262310
deps = [":binaryauthorization_proto"],
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
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+
15+
syntax = "proto3";
16+
17+
package google.cloud.binaryauthorization.v1beta1;
18+
19+
import "google/protobuf/timestamp.proto";
20+
21+
option cc_enable_arenas = true;
22+
option csharp_namespace = "Google.Cloud.BinaryAuthorization.V1Beta1";
23+
option go_package = "google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1beta1;binaryauthorization";
24+
option java_multiple_files = true;
25+
option java_outer_classname = "ContinuousValidationLoggingProto";
26+
option java_package = "com.google.cloud.binaryauthorization.v1beta1";
27+
option php_namespace = "Google\\Cloud\\BinaryAuthorization\\V1beta1";
28+
option ruby_package = "Google::Cloud::BinaryAuthorization::V1beta1";
29+
30+
// Represents an auditing event from Continuous Validation.
31+
message ContinuousValidationEvent {
32+
// An auditing event for one Pod.
33+
message ContinuousValidationPodEvent {
34+
// Container image with auditing details.
35+
message ImageDetails {
36+
// Result of the audit.
37+
enum AuditResult {
38+
// Unspecified result. This is an error.
39+
AUDIT_RESULT_UNSPECIFIED = 0;
40+
41+
// Image is allowed.
42+
ALLOW = 1;
43+
44+
// Image is denied.
45+
DENY = 2;
46+
}
47+
48+
// The name of the image.
49+
string image = 1;
50+
51+
// The result of the audit for this image.
52+
AuditResult result = 2;
53+
54+
// Description of the above result.
55+
string description = 3;
56+
}
57+
58+
// Audit time policy conformance verdict.
59+
enum PolicyConformanceVerdict {
60+
// We should always have a verdict. This is an error.
61+
POLICY_CONFORMANCE_VERDICT_UNSPECIFIED = 0;
62+
63+
// The pod violates the policy.
64+
VIOLATES_POLICY = 1;
65+
}
66+
67+
// The name of the Pod.
68+
string pod = 1;
69+
70+
// Deploy time of the Pod from k8s.
71+
google.protobuf.Timestamp deploy_time = 2;
72+
73+
// Termination time of the Pod from k8s, or nothing if still running.
74+
google.protobuf.Timestamp end_time = 3;
75+
76+
// Auditing verdict for this Pod.
77+
PolicyConformanceVerdict verdict = 4;
78+
79+
// List of images with auditing details.
80+
repeated ImageDetails images = 5;
81+
}
82+
83+
// An event describing that the project policy is unsupported by CV.
84+
message UnsupportedPolicyEvent {
85+
// A description of the unsupported policy.
86+
string description = 1;
87+
}
88+
89+
// Type of CV event.
90+
oneof event_type {
91+
// Pod event.
92+
ContinuousValidationPodEvent pod_event = 1;
93+
94+
// Unsupported policy event.
95+
UnsupportedPolicyEvent unsupported_policy_event = 2;
96+
}
97+
}

0 commit comments

Comments
 (0)