From d461de86c3abc5db180ae32ea4e6063f3c00df25 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 6 Oct 2022 11:24:20 -0700 Subject: [PATCH] feat: add new analysis status and cvss version fields (#187) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add new analysis status and cvss version fields PiperOrigin-RevId: 477815955 Source-Link: https://github.com/googleapis/googleapis/commit/57e38f0271093ee5731a728e154b337dbe67108c Source-Link: https://github.com/googleapis/googleapis-gen/commit/3a587e147521ff94c68a79163aa16855db9a7a8c Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiM2E1ODdlMTQ3NTIxZmY5NGM2OGE3OTE2M2FhMTY4NTVkYjlhN2E4YyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- protos/grafeas/v1/cvss.proto | 7 +++++++ protos/grafeas/v1/discovery.proto | 18 +++++++++++++++++- protos/grafeas/v1/vulnerability.proto | 10 ++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/protos/grafeas/v1/cvss.proto b/protos/grafeas/v1/cvss.proto index ab7e2b8..181ec05 100644 --- a/protos/grafeas/v1/cvss.proto +++ b/protos/grafeas/v1/cvss.proto @@ -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; +} diff --git a/protos/grafeas/v1/discovery.proto b/protos/grafeas/v1/discovery.proto index 13939b2..bfb94e4 100644 --- a/protos/grafeas/v1/discovery.proto +++ b/protos/grafeas/v1/discovery.proto @@ -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. diff --git a/protos/grafeas/v1/vulnerability.proto b/protos/grafeas/v1/vulnerability.proto index 70ab550..cea4558 100644 --- a/protos/grafeas/v1/vulnerability.proto +++ b/protos/grafeas/v1/vulnerability.proto @@ -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. }