Skip to content

Commit 57e38f0

Browse files
Google APIscopybara-github
authored andcommitted
feat: add new analysis status and cvss version fields
PiperOrigin-RevId: 477815955
1 parent 22d2bda commit 57e38f0

5 files changed

Lines changed: 91 additions & 6 deletions

File tree

grafeas/v1/BUILD.bazel

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ java_gapic_library(
151151
srcs = [":grafeas_proto_with_info"],
152152
gapic_yaml = None,
153153
grpc_service_config = "grafeas_grpc_service_config.json",
154+
rest_numeric_enums = False,
154155
service_yaml = "//grafeas:grafeas_v1.yaml",
155156
test_deps = [
156157
":grafeas_java_grpc",
@@ -177,7 +178,8 @@ java_gapic_test(
177178
# Open Source Packages
178179
java_gapic_assembly_gradle_pkg(
179180
name = "google-cloud-grafeas-v1-java",
180-
transport = "grpc",
181+
include_samples = True,
182+
transport = "grpc+rest",
181183
deps = [
182184
":grafeas_java_gapic",
183185
":grafeas_java_grpc",
@@ -206,9 +208,7 @@ go_proto_library(
206208
name = "grafeas_go_proto",
207209
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
208210
importpath = "google.golang.org/genproto/googleapis/grafeas/v1",
209-
protos = [
210-
":grafeas_proto",
211-
],
211+
protos = [":grafeas_proto"],
212212
deps = [
213213
"//google/api:annotations_go_proto",
214214
"//google/rpc:status_go_proto",
@@ -221,6 +221,7 @@ go_gapic_library(
221221
grpc_service_config = "grafeas_grpc_service_config.json",
222222
importpath = "cloud.google.com/go/grafeas/apiv1;grafeas",
223223
metadata = True,
224+
rest_numeric_enums = False,
224225
service_yaml = "//grafeas:grafeas_v1.yaml",
225226
transport = "grpc",
226227
deps = [
@@ -309,7 +310,11 @@ py_gapic_library(
309310
srcs = [":grafeas_proto"],
310311
grpc_service_config = "grafeas_grpc_service_config.json",
311312
opt_args = ["python-gapic-namespace=grafeas"],
313+
rest_numeric_enums = False,
314+
service_yaml = "//grafeas:grafeas_v1.yaml",
312315
transport = "grpc",
316+
deps = [
317+
],
313318
)
314319

315320
py_test(
@@ -356,6 +361,7 @@ php_gapic_library(
356361
name = "grafeas_php_gapic",
357362
srcs = [":grafeas_proto_with_info"],
358363
grpc_service_config = "grafeas_grpc_service_config.json",
364+
rest_numeric_enums = False,
359365
service_yaml = "//grafeas:grafeas_v1.yaml",
360366
deps = [
361367
":grafeas_php_grpc",
@@ -389,6 +395,7 @@ nodejs_gapic_library(
389395
extra_protoc_parameters = ["metadata"],
390396
grpc_service_config = "grafeas_grpc_service_config.json",
391397
package = "grafeas.v1",
398+
rest_numeric_enums = False,
392399
service_yaml = "//grafeas:grafeas_v1.yaml",
393400
deps = [],
394401
)
@@ -432,8 +439,10 @@ ruby_cloud_gapic_library(
432439
"ruby-cloud-generic-endpoint=true",
433440
],
434441
grpc_service_config = "grafeas_grpc_service_config.json",
442+
rest_numeric_enums = False,
435443
ruby_cloud_description = "The Grafeas API stores, and enables querying and retrieval of, critical metadata about all of your software artifacts.",
436444
ruby_cloud_title = "Grafeas V1",
445+
service_yaml = "//grafeas:grafeas_v1.yaml",
437446
deps = [
438447
":grafeas_ruby_grpc",
439448
":grafeas_ruby_proto",
@@ -477,6 +486,7 @@ csharp_gapic_library(
477486
srcs = [":grafeas_proto_with_info"],
478487
common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json",
479488
grpc_service_config = "grafeas_grpc_service_config.json",
489+
rest_numeric_enums = False,
480490
service_yaml = "//grafeas:grafeas_v1.yaml",
481491
deps = [
482492
":grafeas_csharp_grpc",

grafeas/v1/cvss.proto

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,10 @@ message CVSS {
157157
IMPACT_NONE = 3;
158158
}
159159
}
160+
161+
// CVSS Version.
162+
enum CVSSVersion {
163+
CVSS_VERSION_UNSPECIFIED = 0;
164+
CVSS_VERSION_2 = 1;
165+
CVSS_VERSION_3 = 2;
166+
}

grafeas/v1/discovery.proto

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ message DiscoveryOccurrence {
5353
// Analysis status for a resource. Currently for initial analysis only (not
5454
// updated in continuous analysis).
5555
enum AnalysisStatus {
56+
option allow_alias = true;
57+
5658
// Unknown.
5759
ANALYSIS_STATUS_UNSPECIFIED = 0;
5860
// Resource is known but no action has been taken yet.
@@ -61,16 +63,30 @@ message DiscoveryOccurrence {
6163
SCANNING = 2;
6264
// Analysis has finished successfully.
6365
FINISHED_SUCCESS = 3;
66+
// Analysis has completed.
67+
COMPLETE = 3;
6468
// Analysis has finished unsuccessfully, the analysis itself is in a bad
6569
// state.
6670
FINISHED_FAILED = 4;
67-
// The resource is known not to be supported
71+
// The resource is known not to be supported.
6872
FINISHED_UNSUPPORTED = 5;
6973
}
7074

7175
// The status of discovery for the resource.
7276
AnalysisStatus analysis_status = 2;
7377

78+
// Indicates which analysis completed successfully. Multiple types of
79+
// analysis can be performed on a single resource.
80+
message AnalysisCompleted {
81+
repeated string analysis_type = 1;
82+
}
83+
84+
AnalysisCompleted analysis_completed = 7;
85+
86+
// Indicates any errors encountered during analysis of a resource. There
87+
// could be 0 or more of these errors.
88+
repeated google.rpc.Status analysis_error = 8;
89+
7490
// When an error is encountered this will contain a LocalizedMessage under
7591
// details to show to the user. The LocalizedMessage is output only and
7692
// populated by the API.

grafeas/v1/swagger/grafeas.swagger.json

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,18 +850,31 @@
850850
"default": "PLATFORM_UNSPECIFIED",
851851
"description": "Types of platforms.\n\n - PLATFORM_UNSPECIFIED: Unknown.\n - GKE: Google Container Engine.\n - FLEX: Google App Engine: Flexible Environment.\n - CUSTOM: Custom user-defined platform."
852852
},
853+
"DiscoveryOccurrenceAnalysisCompleted": {
854+
"type": "object",
855+
"properties": {
856+
"analysisType": {
857+
"type": "array",
858+
"items": {
859+
"type": "string"
860+
}
861+
}
862+
},
863+
"description": "Indicates which analysis completed successfully. Multiple types of\nanalysis can be performed on a single resource."
864+
},
853865
"DiscoveryOccurrenceAnalysisStatus": {
854866
"type": "string",
855867
"enum": [
856868
"ANALYSIS_STATUS_UNSPECIFIED",
857869
"PENDING",
858870
"SCANNING",
859871
"FINISHED_SUCCESS",
872+
"COMPLETE",
860873
"FINISHED_FAILED",
861874
"FINISHED_UNSUPPORTED"
862875
],
863876
"default": "ANALYSIS_STATUS_UNSPECIFIED",
864-
"description": "Analysis status for a resource. Currently for initial analysis only (not\nupdated in continuous analysis).\n\n - ANALYSIS_STATUS_UNSPECIFIED: Unknown.\n - PENDING: Resource is known but no action has been taken yet.\n - SCANNING: Resource is being analyzed.\n - FINISHED_SUCCESS: Analysis has finished successfully.\n - FINISHED_FAILED: Analysis has finished unsuccessfully, the analysis itself is in a bad\nstate.\n - FINISHED_UNSUPPORTED: The resource is known not to be supported"
877+
"description": "Analysis status for a resource. Currently for initial analysis only (not\nupdated in continuous analysis).\n\n - ANALYSIS_STATUS_UNSPECIFIED: Unknown.\n - PENDING: Resource is known but no action has been taken yet.\n - SCANNING: Resource is being analyzed.\n - FINISHED_SUCCESS: Analysis has finished successfully.\n - COMPLETE: Analysis has completed.\n - FINISHED_FAILED: Analysis has finished unsuccessfully, the analysis itself is in a bad\nstate.\n - FINISHED_UNSUPPORTED: The resource is known not to be supported."
865878
},
866879
"DiscoveryOccurrenceContinuousAnalysis": {
867880
"type": "string",
@@ -1560,6 +1573,16 @@
15601573
],
15611574
"default": "USER_INTERACTION_UNSPECIFIED"
15621575
},
1576+
"v1CVSSVersion": {
1577+
"type": "string",
1578+
"enum": [
1579+
"CVSS_VERSION_UNSPECIFIED",
1580+
"CVSS_VERSION_2",
1581+
"CVSS_VERSION_3"
1582+
],
1583+
"default": "CVSS_VERSION_UNSPECIFIED",
1584+
"description": "CVSS Version."
1585+
},
15631586
"v1CVSSv3": {
15641587
"type": "object",
15651588
"properties": {
@@ -1917,6 +1940,16 @@
19171940
"$ref": "#/definitions/DiscoveryOccurrenceAnalysisStatus",
19181941
"description": "The status of discovery for the resource."
19191942
},
1943+
"analysisCompleted": {
1944+
"$ref": "#/definitions/DiscoveryOccurrenceAnalysisCompleted"
1945+
},
1946+
"analysisError": {
1947+
"type": "array",
1948+
"items": {
1949+
"$ref": "#/definitions/rpcStatus"
1950+
},
1951+
"description": "Indicates any errors encountered during analysis of a resource. There\ncould be 0 or more of these errors."
1952+
},
19201953
"analysisStatusError": {
19211954
"$ref": "#/definitions/rpcStatus",
19221955
"description": "When an error is encountered this will contain a LocalizedMessage under\ndetails to show to the user. The LocalizedMessage is output only and\npopulated by the API."
@@ -3091,6 +3124,10 @@
30913124
"type": "string",
30923125
"format": "date-time",
30933126
"description": "The time this information was last changed at the source. This is an\nupstream timestamp from the underlying information source - e.g. Ubuntu\nsecurity tracker."
3127+
},
3128+
"cvssVersion": {
3129+
"$ref": "#/definitions/v1CVSSVersion",
3130+
"description": "CVSS version used to populate cvss_score and severity."
30943131
}
30953132
},
30963133
"description": "A security vulnerability that can be found in resources."
@@ -3150,6 +3187,11 @@
31503187
"type": "boolean",
31513188
"description": "Output only. Whether at least one of the affected packages has a fix\navailable.",
31523189
"readOnly": true
3190+
},
3191+
"cvssVersion": {
3192+
"$ref": "#/definitions/v1CVSSVersion",
3193+
"description": "Output only. CVSS version used to populate cvss_score and severity.",
3194+
"readOnly": true
31533195
}
31543196
},
31553197
"description": "An occurrence of a severity vulnerability on a resource."

grafeas/v1/vulnerability.proto

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ message VulnerabilityNote {
148148
// upstream timestamp from the underlying information source - e.g. Ubuntu
149149
// security tracker.
150150
google.protobuf.Timestamp source_update_time = 6;
151+
152+
// CVSS version used to populate cvss_score and severity.
153+
grafeas.v1.CVSSVersion cvss_version = 7;
154+
155+
// Next free ID is 8.
151156
}
152157

153158
// An occurrence of a severity vulnerability on a resource.
@@ -238,4 +243,9 @@ message VulnerabilityOccurrence {
238243
// Output only. Whether at least one of the affected packages has a fix
239244
// available.
240245
bool fix_available = 9;
246+
247+
// Output only. CVSS version used to populate cvss_score and severity.
248+
grafeas.v1.CVSSVersion cvss_version = 11;
249+
250+
// Next free ID is 12.
241251
}

0 commit comments

Comments
 (0)