Skip to content

Commit 7a92b96

Browse files
Google APIscopybara-github
authored andcommitted
feat: add ExportSBOM API method for v1
docs: Minor formatting changes to proto headers PiperOrigin-RevId: 740056523
1 parent 2729663 commit 7a92b96

2 files changed

Lines changed: 89 additions & 15 deletions

File tree

google/devtools/containeranalysis/v1/containeranalysis.proto

Lines changed: 81 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ option go_package = "cloud.google.com/go/containeranalysis/apiv1/containeranalys
2929
option java_multiple_files = true;
3030
option java_package = "com.google.containeranalysis.v1";
3131
option objc_class_prefix = "GCA";
32-
option ruby_package = "Google::Cloud::ContainerAnalysis::V1";
3332
option php_namespace = "Google\\Cloud\\ContainerAnalysis\\V1";
33+
option ruby_package = "Google::Cloud::ContainerAnalysis::V1";
3434

3535
// Retrieves analysis results of Cloud components such as Docker container
3636
// images. The Container Analysis API is an implementation of the
@@ -47,7 +47,8 @@ option php_namespace = "Google\\Cloud\\ContainerAnalysis\\V1";
4747
// image with the vulnerability referring to that note.
4848
service ContainerAnalysis {
4949
option (google.api.default_host) = "containeranalysis.googleapis.com";
50-
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
50+
option (google.api.oauth_scopes) =
51+
"https://www.googleapis.com/auth/cloud-platform";
5152

5253
// Sets the access control policy on the specified note or occurrence.
5354
// Requires `containeranalysis.notes.setIamPolicy` or
@@ -57,14 +58,23 @@ service ContainerAnalysis {
5758
// The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for
5859
// notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for
5960
// occurrences.
60-
rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) {
61+
rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest)
62+
returns (google.iam.v1.Policy) {
6163
option (google.api.http) = {
6264
post: "/v1/{resource=projects/*/notes/*}:setIamPolicy"
6365
body: "*"
6466
additional_bindings {
6567
post: "/v1/{resource=projects/*/occurrences/*}:setIamPolicy"
6668
body: "*"
6769
}
70+
additional_bindings {
71+
post: "/v1/{resource=projects/*/locations/*/notes/*}:setIamPolicy"
72+
body: "*"
73+
}
74+
additional_bindings {
75+
post: "/v1/{resource=projects/*/locations/*/occurrences/*}:setIamPolicy"
76+
body: "*"
77+
}
6878
};
6979
option (google.api.method_signature) = "resource,policy";
7080
}
@@ -77,14 +87,23 @@ service ContainerAnalysis {
7787
// The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for
7888
// notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for
7989
// occurrences.
80-
rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) {
90+
rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest)
91+
returns (google.iam.v1.Policy) {
8192
option (google.api.http) = {
8293
post: "/v1/{resource=projects/*/notes/*}:getIamPolicy"
8394
body: "*"
8495
additional_bindings {
8596
post: "/v1/{resource=projects/*/occurrences/*}:getIamPolicy"
8697
body: "*"
8798
}
99+
additional_bindings {
100+
post: "/v1/{resource=projects/*/locations/*/notes/*}:getIamPolicy"
101+
body: "*"
102+
}
103+
additional_bindings {
104+
post: "/v1/{resource=projects/*/locations/*/occurrences/*}:getIamPolicy"
105+
body: "*"
106+
}
88107
};
89108
option (google.api.method_signature) = "resource";
90109
}
@@ -96,31 +115,85 @@ service ContainerAnalysis {
96115
// The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for
97116
// notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for
98117
// occurrences.
99-
rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) {
118+
rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest)
119+
returns (google.iam.v1.TestIamPermissionsResponse) {
100120
option (google.api.http) = {
101121
post: "/v1/{resource=projects/*/notes/*}:testIamPermissions"
102122
body: "*"
103123
additional_bindings {
104124
post: "/v1/{resource=projects/*/occurrences/*}:testIamPermissions"
105125
body: "*"
106126
}
127+
additional_bindings {
128+
post: "/v1/{resource=projects/*/locations/*/notes/*}:testIamPermissions"
129+
body: "*"
130+
}
131+
additional_bindings {
132+
post: "/v1/{resource=projects/*/locations/*/occurrences/*}:testIamPermissions"
133+
body: "*"
134+
}
107135
};
108136
option (google.api.method_signature) = "resource,permissions";
109137
}
110138

111139
// Gets a summary of the number and severity of occurrences.
112-
rpc GetVulnerabilityOccurrencesSummary(GetVulnerabilityOccurrencesSummaryRequest) returns (VulnerabilityOccurrencesSummary) {
140+
rpc GetVulnerabilityOccurrencesSummary(
141+
GetVulnerabilityOccurrencesSummaryRequest)
142+
returns (VulnerabilityOccurrencesSummary) {
113143
option (google.api.http) = {
114144
get: "/v1/{parent=projects/*}/occurrences:vulnerabilitySummary"
145+
additional_bindings {
146+
get: "/v1/{parent=projects/*/locations/*}/occurrences:vulnerabilitySummary"
147+
}
115148
};
116149
option (google.api.method_signature) = "parent,filter";
117150
}
151+
152+
// Generates an SBOM for the given resource.
153+
rpc ExportSBOM(ExportSBOMRequest) returns (ExportSBOMResponse) {
154+
option (google.api.http) = {
155+
post: "/v1/{name=projects/*/resources/**}:exportSBOM"
156+
body: "*"
157+
additional_bindings {
158+
post: "/v1/{name=projects/*/locations/*/resources/**}:exportSBOM"
159+
body: "*"
160+
}
161+
};
162+
}
163+
}
164+
165+
// The request to generate and export SBOM. Target must be specified for the
166+
// request.
167+
message ExportSBOMRequest {
168+
// Empty placeholder to denote that this is a Google Cloud Storage
169+
// export request.
170+
message CloudStorageLocation {}
171+
172+
// Required. The name of the resource in the form of
173+
// `projects/[PROJECT_ID]/resources/[RESOURCE_URL]`.
174+
string name = 1 [(google.api.field_behavior) = REQUIRED];
175+
176+
// The location of the SBOM export.
177+
oneof target {
178+
// Optional. Empty placeholder to denote that this is a Google Cloud Storage
179+
// export request.
180+
CloudStorageLocation cloud_storage_location = 2
181+
[(google.api.field_behavior) = OPTIONAL];
182+
}
183+
}
184+
185+
// The response from a call to ExportSBOM.
186+
message ExportSBOMResponse {
187+
// The name of the discovery occurrence in the form
188+
// "projects/{project_id}/occurrences/{OCCURRENCE_ID}
189+
// It can be used to track the progress of the SBOM export.
190+
string discovery_occurrence = 1;
118191
}
119192

120193
// Request to get a vulnerability summary for some set of occurrences.
121194
message GetVulnerabilityOccurrencesSummaryRequest {
122-
// Required. The name of the project to get a vulnerability summary for in the form of
123-
// `projects/[PROJECT_ID]`.
195+
// Required. The name of the project to get a vulnerability summary for in the
196+
// form of `projects/[PROJECT_ID]`.
124197
string parent = 1 [
125198
(google.api.field_behavior) = REQUIRED,
126199
(google.api.resource_reference) = {

google/devtools/containeranalysis/v1/containeranalysis_v1.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,18 @@ apis:
88

99
documentation:
1010
summary: |-
11-
An implementation of the Grafeas API, which stores, and enables querying
12-
and retrieval of critical metadata about all of your software artifacts.
11+
This API is a prerequisite for leveraging Artifact Analysis
12+
scanning capabilities in both Artifact Registry and with Advanced
13+
Vulnerability Insights (runtime scanning) in GKE.
14+
15+
In addition, the Container Analysis API is an implementation of the
16+
Grafeas API, which enables storing, querying, and retrieval of critical
17+
metadata
18+
about all of your software artifacts.
1319
overview: |-
1420
The Container Analysis API allows you to store and retrieve metadata for a
1521
container resource.
1622
17-
backend:
18-
rules:
19-
- selector: 'google.devtools.containeranalysis.v1.ContainerAnalysis.*'
20-
deadline: 30.0
21-
2223
authentication:
2324
rules:
2425
- selector: 'google.devtools.containeranalysis.v1.ContainerAnalysis.*'

0 commit comments

Comments
 (0)