containeranalysis.proto 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. // Copyright 2019 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. syntax = "proto3";
  15. package google.devtools.containeranalysis.v1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/iam/v1/iam_policy.proto";
  21. import "google/iam/v1/policy.proto";
  22. import "google/protobuf/timestamp.proto";
  23. import "grafeas/v1/vulnerability.proto";
  24. option csharp_namespace = "Google.Cloud.DevTools.ContainerAnalysis.V1";
  25. option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1;containeranalysis";
  26. option java_multiple_files = true;
  27. option java_package = "com.google.containeranalysis.v1";
  28. option objc_class_prefix = "GCA";
  29. option ruby_package = "Google::Cloud::ContainerAnalysis::V1";
  30. option php_namespace = "Google\\Cloud\\ContainerAnalysis\\V1";
  31. // Retrieves analysis results of Cloud components such as Docker container
  32. // images. The Container Analysis API is an implementation of the
  33. // [Grafeas](https://grafeas.io) API.
  34. //
  35. // Analysis results are stored as a series of occurrences. An `Occurrence`
  36. // contains information about a specific analysis instance on a resource. An
  37. // occurrence refers to a `Note`. A note contains details describing the
  38. // analysis and is generally stored in a separate project, called a `Provider`.
  39. // Multiple occurrences can refer to the same note.
  40. //
  41. // For example, an SSL vulnerability could affect multiple images. In this case,
  42. // there would be one note for the vulnerability and an occurrence for each
  43. // image with the vulnerability referring to that note.
  44. service ContainerAnalysis {
  45. option (google.api.default_host) = "containeranalysis.googleapis.com";
  46. option (google.api.oauth_scopes) =
  47. "https://www.googleapis.com/auth/cloud-platform";
  48. // Sets the access control policy on the specified note or occurrence.
  49. // Requires `containeranalysis.notes.setIamPolicy` or
  50. // `containeranalysis.occurrences.setIamPolicy` permission if the resource is
  51. // a note or an occurrence, respectively.
  52. //
  53. // The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for
  54. // notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for
  55. // occurrences.
  56. rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest)
  57. returns (google.iam.v1.Policy) {
  58. option (google.api.http) = {
  59. post: "/v1/{resource=projects/*/notes/*}:setIamPolicy"
  60. body: "*"
  61. additional_bindings {
  62. post: "/v1/{resource=projects/*/occurrences/*}:setIamPolicy"
  63. body: "*"
  64. }
  65. };
  66. option (google.api.method_signature) = "resource,policy";
  67. }
  68. // Gets the access control policy for a note or an occurrence resource.
  69. // Requires `containeranalysis.notes.setIamPolicy` or
  70. // `containeranalysis.occurrences.setIamPolicy` permission if the resource is
  71. // a note or occurrence, respectively.
  72. //
  73. // The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for
  74. // notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for
  75. // occurrences.
  76. rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest)
  77. returns (google.iam.v1.Policy) {
  78. option (google.api.http) = {
  79. post: "/v1/{resource=projects/*/notes/*}:getIamPolicy"
  80. body: "*"
  81. additional_bindings {
  82. post: "/v1/{resource=projects/*/occurrences/*}:getIamPolicy"
  83. body: "*"
  84. }
  85. };
  86. option (google.api.method_signature) = "resource";
  87. }
  88. // Returns the permissions that a caller has on the specified note or
  89. // occurrence. Requires list permission on the project (for example,
  90. // `containeranalysis.notes.list`).
  91. //
  92. // The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for
  93. // notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for
  94. // occurrences.
  95. rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest)
  96. returns (google.iam.v1.TestIamPermissionsResponse) {
  97. option (google.api.http) = {
  98. post: "/v1/{resource=projects/*/notes/*}:testIamPermissions"
  99. body: "*"
  100. additional_bindings {
  101. post: "/v1/{resource=projects/*/occurrences/*}:testIamPermissions"
  102. body: "*"
  103. }
  104. };
  105. option (google.api.method_signature) = "resource,permissions";
  106. }
  107. // Gets a summary of the number and severity of occurrences.
  108. rpc GetVulnerabilityOccurrencesSummary(
  109. GetVulnerabilityOccurrencesSummaryRequest)
  110. returns (VulnerabilityOccurrencesSummary) {
  111. option (google.api.http) = {
  112. get: "/v1/{parent=projects/*}/occurrences:vulnerabilitySummary"
  113. };
  114. option (google.api.method_signature) = "parent,filter";
  115. }
  116. }
  117. // Request to get a vulnerability summary for some set of occurrences.
  118. message GetVulnerabilityOccurrencesSummaryRequest {
  119. // The name of the project to get a vulnerability summary for in the form of
  120. // `projects/[PROJECT_ID]`.
  121. string parent = 1 [
  122. (google.api.resource_reference).type =
  123. "cloudresourcemanager.googleapis.com/Project",
  124. (google.api.field_behavior) = REQUIRED
  125. ];
  126. // The filter expression.
  127. string filter = 2;
  128. }
  129. // A summary of how many vulnerability occurrences there are per resource and
  130. // severity type.
  131. message VulnerabilityOccurrencesSummary {
  132. // Per resource and severity counts of fixable and total vulnerabilities.
  133. message FixableTotalByDigest {
  134. // The affected resource.
  135. string resource_uri = 1;
  136. // The severity for this count. SEVERITY_UNSPECIFIED indicates total across
  137. // all severities.
  138. grafeas.v1.Severity severity = 2;
  139. // The number of fixable vulnerabilities associated with this resource.
  140. int64 fixable_count = 3;
  141. // The total number of vulnerabilities associated with this resource.
  142. int64 total_count = 4;
  143. }
  144. // A listing by resource of the number of fixable and total vulnerabilities.
  145. repeated FixableTotalByDigest counts = 1;
  146. }