feat: add new analysis status and cvss version fields

PiperOrigin-RevId: 477815955
initial-test-for-dns
Google APIs 2 years ago committed by Copybara-Service
parent 22d2bdaeef
commit 57e38f0271
  1. 18
      grafeas/v1/BUILD.bazel
  2. 7
      grafeas/v1/cvss.proto
  3. 18
      grafeas/v1/discovery.proto
  4. 44
      grafeas/v1/swagger/grafeas.swagger.json
  5. 10
      grafeas/v1/vulnerability.proto

@ -151,6 +151,7 @@ java_gapic_library(
srcs = [":grafeas_proto_with_info"],
gapic_yaml = None,
grpc_service_config = "grafeas_grpc_service_config.json",
rest_numeric_enums = False,
service_yaml = "//grafeas:grafeas_v1.yaml",
test_deps = [
":grafeas_java_grpc",
@ -177,7 +178,8 @@ java_gapic_test(
# Open Source Packages
java_gapic_assembly_gradle_pkg(
name = "google-cloud-grafeas-v1-java",
transport = "grpc",
include_samples = True,
transport = "grpc+rest",
deps = [
":grafeas_java_gapic",
":grafeas_java_grpc",
@ -206,9 +208,7 @@ go_proto_library(
name = "grafeas_go_proto",
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
importpath = "google.golang.org/genproto/googleapis/grafeas/v1",
protos = [
":grafeas_proto",
],
protos = [":grafeas_proto"],
deps = [
"//google/api:annotations_go_proto",
"//google/rpc:status_go_proto",
@ -221,6 +221,7 @@ go_gapic_library(
grpc_service_config = "grafeas_grpc_service_config.json",
importpath = "cloud.google.com/go/grafeas/apiv1;grafeas",
metadata = True,
rest_numeric_enums = False,
service_yaml = "//grafeas:grafeas_v1.yaml",
transport = "grpc",
deps = [
@ -309,7 +310,11 @@ py_gapic_library(
srcs = [":grafeas_proto"],
grpc_service_config = "grafeas_grpc_service_config.json",
opt_args = ["python-gapic-namespace=grafeas"],
rest_numeric_enums = False,
service_yaml = "//grafeas:grafeas_v1.yaml",
transport = "grpc",
deps = [
],
)
py_test(
@ -356,6 +361,7 @@ php_gapic_library(
name = "grafeas_php_gapic",
srcs = [":grafeas_proto_with_info"],
grpc_service_config = "grafeas_grpc_service_config.json",
rest_numeric_enums = False,
service_yaml = "//grafeas:grafeas_v1.yaml",
deps = [
":grafeas_php_grpc",
@ -389,6 +395,7 @@ nodejs_gapic_library(
extra_protoc_parameters = ["metadata"],
grpc_service_config = "grafeas_grpc_service_config.json",
package = "grafeas.v1",
rest_numeric_enums = False,
service_yaml = "//grafeas:grafeas_v1.yaml",
deps = [],
)
@ -432,8 +439,10 @@ ruby_cloud_gapic_library(
"ruby-cloud-generic-endpoint=true",
],
grpc_service_config = "grafeas_grpc_service_config.json",
rest_numeric_enums = False,
ruby_cloud_description = "The Grafeas API stores, and enables querying and retrieval of, critical metadata about all of your software artifacts.",
ruby_cloud_title = "Grafeas V1",
service_yaml = "//grafeas:grafeas_v1.yaml",
deps = [
":grafeas_ruby_grpc",
":grafeas_ruby_proto",
@ -477,6 +486,7 @@ csharp_gapic_library(
srcs = [":grafeas_proto_with_info"],
common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json",
grpc_service_config = "grafeas_grpc_service_config.json",
rest_numeric_enums = False,
service_yaml = "//grafeas:grafeas_v1.yaml",
deps = [
":grafeas_csharp_grpc",

@ -157,3 +157,10 @@ message CVSS {
IMPACT_NONE = 3;
}
}
// CVSS Version.
enum CVSSVersion {
CVSS_VERSION_UNSPECIFIED = 0;
CVSS_VERSION_2 = 1;
CVSS_VERSION_3 = 2;
}

@ -53,6 +53,8 @@ message DiscoveryOccurrence {
// Analysis status for a resource. Currently for initial analysis only (not
// updated in continuous analysis).
enum AnalysisStatus {
option allow_alias = true;
// Unknown.
ANALYSIS_STATUS_UNSPECIFIED = 0;
// Resource is known but no action has been taken yet.
@ -61,16 +63,30 @@ message DiscoveryOccurrence {
SCANNING = 2;
// Analysis has finished successfully.
FINISHED_SUCCESS = 3;
// Analysis has completed.
COMPLETE = 3;
// Analysis has finished unsuccessfully, the analysis itself is in a bad
// state.
FINISHED_FAILED = 4;
// The resource is known not to be supported
// The resource is known not to be supported.
FINISHED_UNSUPPORTED = 5;
}
// The status of discovery for the resource.
AnalysisStatus analysis_status = 2;
// Indicates which analysis completed successfully. Multiple types of
// analysis can be performed on a single resource.
message AnalysisCompleted {
repeated string analysis_type = 1;
}
AnalysisCompleted analysis_completed = 7;
// Indicates any errors encountered during analysis of a resource. There
// could be 0 or more of these errors.
repeated google.rpc.Status analysis_error = 8;
// When an error is encountered this will contain a LocalizedMessage under
// details to show to the user. The LocalizedMessage is output only and
// populated by the API.

@ -850,6 +850,18 @@
"default": "PLATFORM_UNSPECIFIED",
"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."
},
"DiscoveryOccurrenceAnalysisCompleted": {
"type": "object",
"properties": {
"analysisType": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Indicates which analysis completed successfully. Multiple types of\nanalysis can be performed on a single resource."
},
"DiscoveryOccurrenceAnalysisStatus": {
"type": "string",
"enum": [
@ -857,11 +869,12 @@
"PENDING",
"SCANNING",
"FINISHED_SUCCESS",
"COMPLETE",
"FINISHED_FAILED",
"FINISHED_UNSUPPORTED"
],
"default": "ANALYSIS_STATUS_UNSPECIFIED",
"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"
"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."
},
"DiscoveryOccurrenceContinuousAnalysis": {
"type": "string",
@ -1560,6 +1573,16 @@
],
"default": "USER_INTERACTION_UNSPECIFIED"
},
"v1CVSSVersion": {
"type": "string",
"enum": [
"CVSS_VERSION_UNSPECIFIED",
"CVSS_VERSION_2",
"CVSS_VERSION_3"
],
"default": "CVSS_VERSION_UNSPECIFIED",
"description": "CVSS Version."
},
"v1CVSSv3": {
"type": "object",
"properties": {
@ -1917,6 +1940,16 @@
"$ref": "#/definitions/DiscoveryOccurrenceAnalysisStatus",
"description": "The status of discovery for the resource."
},
"analysisCompleted": {
"$ref": "#/definitions/DiscoveryOccurrenceAnalysisCompleted"
},
"analysisError": {
"type": "array",
"items": {
"$ref": "#/definitions/rpcStatus"
},
"description": "Indicates any errors encountered during analysis of a resource. There\ncould be 0 or more of these errors."
},
"analysisStatusError": {
"$ref": "#/definitions/rpcStatus",
"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 @@
"type": "string",
"format": "date-time",
"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."
},
"cvssVersion": {
"$ref": "#/definitions/v1CVSSVersion",
"description": "CVSS version used to populate cvss_score and severity."
}
},
"description": "A security vulnerability that can be found in resources."
@ -3150,6 +3187,11 @@
"type": "boolean",
"description": "Output only. Whether at least one of the affected packages has a fix\navailable.",
"readOnly": true
},
"cvssVersion": {
"$ref": "#/definitions/v1CVSSVersion",
"description": "Output only. CVSS version used to populate cvss_score and severity.",
"readOnly": true
}
},
"description": "An occurrence of a severity vulnerability on a resource."

@ -148,6 +148,11 @@ message VulnerabilityNote {
// upstream timestamp from the underlying information source - e.g. Ubuntu
// security tracker.
google.protobuf.Timestamp source_update_time = 6;
// CVSS version used to populate cvss_score and severity.
grafeas.v1.CVSSVersion cvss_version = 7;
// Next free ID is 8.
}
// An occurrence of a severity vulnerability on a resource.
@ -238,4 +243,9 @@ message VulnerabilityOccurrence {
// Output only. Whether at least one of the affected packages has a fix
// available.
bool fix_available = 9;
// Output only. CVSS version used to populate cvss_score and severity.
grafeas.v1.CVSSVersion cvss_version = 11;
// Next free ID is 12.
}

Loading…
Cancel
Save