@google-cloud/containeranalysis 3.2.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +17 -17
  3. package/build/protos/google/devtools/containeranalysis/v1/containeranalysis.proto +12 -18
  4. package/build/protos/grafeas/v1/attestation.proto +17 -0
  5. package/build/protos/grafeas/v1/build.proto +13 -1
  6. package/build/protos/grafeas/v1/common.proto +20 -2
  7. package/build/protos/grafeas/v1/compliance.proto +79 -0
  8. package/build/protos/grafeas/v1/cvss.proto +76 -0
  9. package/build/protos/grafeas/v1/discovery.proto +5 -0
  10. package/build/protos/grafeas/v1/dsse_attestation.proto +52 -0
  11. package/build/protos/grafeas/v1/grafeas.proto +13 -0
  12. package/build/protos/grafeas/v1/intoto_provenance.proto +113 -0
  13. package/build/protos/grafeas/v1/intoto_statement.proto +50 -0
  14. package/build/protos/grafeas/v1/package.proto +9 -1
  15. package/build/protos/grafeas/v1/severity.proto +38 -0
  16. package/build/protos/grafeas/v1/slsa_provenance.proto +114 -0
  17. package/build/protos/grafeas/v1/vulnerability.proto +31 -19
  18. package/build/protos/protos.d.ts +6876 -3889
  19. package/build/protos/protos.js +19779 -11905
  20. package/build/protos/protos.json +1078 -410
  21. package/build/src/v1/container_analysis_client.d.ts +133 -4
  22. package/build/src/v1/container_analysis_client.js +2 -110
  23. package/build/src/v1/container_analysis_client.js.map +1 -1
  24. package/build/src/v1/index.js +1 -0
  25. package/build/src/v1/index.js.map +1 -1
  26. package/build/src/v1beta1/container_analysis_v1_beta1_client.d.ts +190 -11
  27. package/build/src/v1beta1/container_analysis_v1_beta1_client.js +8 -163
  28. package/build/src/v1beta1/container_analysis_v1_beta1_client.js.map +1 -1
  29. package/build/src/v1beta1/grafeas_v1_beta1_client.d.ts +403 -30
  30. package/build/src/v1beta1/grafeas_v1_beta1_client.js +20 -349
  31. package/build/src/v1beta1/grafeas_v1_beta1_client.js.map +1 -1
  32. package/build/src/v1beta1/index.js +1 -0
  33. package/build/src/v1beta1/index.js.map +1 -1
  34. package/package.json +9 -9
@@ -0,0 +1,113 @@
1
+ // Copyright 2021 The Grafeas Authors. All rights reserved.
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
+
15
+ syntax = "proto3";
16
+
17
+ package grafeas.v1;
18
+
19
+ import "google/protobuf/any.proto";
20
+ import "google/protobuf/timestamp.proto";
21
+
22
+ option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas";
23
+ option java_multiple_files = true;
24
+ option java_package = "io.grafeas.v1";
25
+ option objc_class_prefix = "GRA";
26
+ option java_outer_classname = "InTotoProvenanceProto";
27
+
28
+ // Spec defined at
29
+ // https://github.com/in-toto/attestation/blob/main/spec/predicates/provenance.md
30
+
31
+ // Steps taken to build the artifact.
32
+ // For a TaskRun, typically each container corresponds to one step in the
33
+ // recipe.
34
+ message Recipe {
35
+ // URI indicating what type of recipe was performed. It determines the meaning
36
+ // of recipe.entryPoint, recipe.arguments, recipe.environment, and materials.
37
+ string type = 1;
38
+ // Index in materials containing the recipe steps that are not implied by
39
+ // recipe.type. For example, if the recipe type were "make", then this would
40
+ // point to the source containing the Makefile, not the make program itself.
41
+ // Set to -1 if the recipe doesn't come from a material, as zero is default
42
+ // unset value for int64.
43
+ int64 defined_in_material = 2;
44
+ // String identifying the entry point into the build.
45
+ // This is often a path to a configuration file and/or a target label within
46
+ // that file. The syntax and meaning are defined by recipe.type. For example,
47
+ // if the recipe type were "make", then this would reference the directory in
48
+ // which to run make as well as which target to use.
49
+ string entry_point = 3;
50
+ // Collection of all external inputs that influenced the build on top of
51
+ // recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
52
+ // type were "make", then this might be the flags passed to make aside from
53
+ // the target, which is captured in recipe.entryPoint. Since the arguments
54
+ // field can greatly vary in structure, depending on the builder and recipe
55
+ // type, this is of form "Any".
56
+ repeated google.protobuf.Any arguments = 4;
57
+ // Any other builder-controlled inputs necessary for correctly evaluating the
58
+ // recipe. Usually only needed for reproducing the build but not evaluated as
59
+ // part of policy. Since the environment field can greatly vary in structure,
60
+ // depending on the builder and recipe type, this is of form "Any".
61
+ repeated google.protobuf.Any environment = 5;
62
+ }
63
+
64
+ // Indicates that the builder claims certain fields in this message to be
65
+ // complete.
66
+ message Completeness {
67
+ // If true, the builder claims that recipe.arguments is complete, meaning that
68
+ // all external inputs are properly captured in the recipe.
69
+ bool arguments = 1;
70
+ // If true, the builder claims that recipe.environment is claimed to be
71
+ // complete.
72
+ bool environment = 2;
73
+ // If true, the builder claims that materials are complete, usually through
74
+ // some controls to prevent network access. Sometimes called "hermetic".
75
+ bool materials = 3;
76
+ }
77
+
78
+ // Other properties of the build.
79
+ message Metadata {
80
+ // Identifies the particular build invocation, which can be useful for finding
81
+ // associated logs or other ad-hoc analysis. The value SHOULD be globally
82
+ // unique, per in-toto Provenance spec.
83
+ string build_invocation_id = 1;
84
+ // The timestamp of when the build started.
85
+ google.protobuf.Timestamp build_started_on = 2;
86
+ // The timestamp of when the build completed.
87
+ google.protobuf.Timestamp build_finished_on = 3;
88
+ // Indicates that the builder claims certain fields in this message to be
89
+ // complete.
90
+ Completeness completeness = 4;
91
+ // If true, the builder claims that running the recipe on materials will
92
+ // produce bit-for-bit identical output.
93
+ bool reproducible = 5;
94
+ }
95
+
96
+ message BuilderConfig {
97
+ string id = 1;
98
+ }
99
+
100
+ message InTotoProvenance {
101
+ BuilderConfig builder_config = 1; // required
102
+ // Identifies the configuration used for the build.
103
+ // When combined with materials, this SHOULD fully describe the build,
104
+ // such that re-running this recipe results in bit-for-bit identical output
105
+ // (if the build is reproducible).
106
+ Recipe recipe = 2; // required
107
+ Metadata metadata = 3;
108
+ // The collection of artifacts that influenced the build including sources,
109
+ // dependencies, build tools, base images, and so on. This is considered to be
110
+ // incomplete unless metadata.completeness.materials is true. Unset or null is
111
+ // equivalent to empty.
112
+ repeated string materials = 4;
113
+ }
@@ -0,0 +1,50 @@
1
+ // Copyright 2021 The Grafeas Authors. All rights reserved.
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
+
15
+ syntax = "proto3";
16
+
17
+ package grafeas.v1;
18
+
19
+ import "grafeas/v1/intoto_provenance.proto";
20
+ import "grafeas/v1/slsa_provenance.proto";
21
+
22
+ option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas";
23
+ option java_multiple_files = true;
24
+ option java_package = "io.grafeas.v1";
25
+ option objc_class_prefix = "GRA";
26
+ option java_outer_classname = "InTotoStatementProto";
27
+
28
+ // Spec defined at
29
+ // https://github.com/in-toto/attestation/tree/main/spec#statement The
30
+ // serialized InTotoStatement will be stored as Envelope.payload.
31
+ // Envelope.payloadType is always "application/vnd.in-toto+json".
32
+ message InTotoStatement {
33
+ // Always `https://in-toto.io/Statement/v0.1`.
34
+ string type = 1 [json_name = "_type"];
35
+ repeated Subject subject = 2;
36
+ // `https://slsa.dev/provenance/v0.1` for SlsaProvenance.
37
+ string predicate_type = 3;
38
+ oneof predicate {
39
+ InTotoProvenance provenance = 4;
40
+ SlsaProvenance slsa_provenance = 5;
41
+ }
42
+ }
43
+ message Subject {
44
+ string name = 1;
45
+ // `"<ALGORITHM>": "<HEX_VALUE>"`
46
+ // Algorithms can be e.g. sha256, sha512
47
+ // See
48
+ // https://github.com/in-toto/attestation/blob/main/spec/field_types.md#DigestSet
49
+ map<string, string> digest = 2;
50
+ }
@@ -102,6 +102,14 @@ message Version {
102
102
  // The iteration of the package build from the above version.
103
103
  string revision = 3;
104
104
 
105
+ // Whether this version is specifying part of an inclusive range. Grafeas
106
+ // does not have the capability to specify version ranges; instead we have
107
+ // fields that specify start version and end versions. At times this is
108
+ // insufficient - we also need to specify whether the version is included in
109
+ // the range or is excluded from the range. This boolean is expected to be set
110
+ // to true when the version is included in a range.
111
+ bool inclusive = 6;
112
+
105
113
  // Whether this is an ordinary package version or a sentinel MIN/MAX version.
106
114
  enum VersionKind {
107
115
  // Unknown.
@@ -112,7 +120,7 @@ message Version {
112
120
  MINIMUM = 2;
113
121
  // A special version representing positive infinity.
114
122
  MAXIMUM = 3;
115
- };
123
+ }
116
124
 
117
125
  // Required. Distinguishes between sentinel MIN/MAX versions and normal
118
126
  // versions.
@@ -0,0 +1,38 @@
1
+ // Copyright 2021 The Grafeas Authors. All rights reserved.
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
+
15
+ syntax = "proto3";
16
+
17
+ package grafeas.v1;
18
+
19
+ option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas";
20
+ option java_multiple_files = true;
21
+ option java_package = "io.grafeas.v1";
22
+ option objc_class_prefix = "GRA";
23
+
24
+ // Note provider assigned severity/impact ranking.
25
+ enum Severity {
26
+ // Unknown.
27
+ SEVERITY_UNSPECIFIED = 0;
28
+ // Minimal severity.
29
+ MINIMAL = 1;
30
+ // Low severity.
31
+ LOW = 2;
32
+ // Medium severity.
33
+ MEDIUM = 3;
34
+ // High severity.
35
+ HIGH = 4;
36
+ // Critical severity.
37
+ CRITICAL = 5;
38
+ }
@@ -0,0 +1,114 @@
1
+ // Copyright 2021 The Grafeas Authors. All rights reserved.
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
+
15
+ syntax = "proto3";
16
+
17
+ package grafeas.v1;
18
+
19
+ import "google/protobuf/any.proto";
20
+ import "google/protobuf/timestamp.proto";
21
+
22
+ option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas";
23
+ option java_multiple_files = true;
24
+ option java_package = "io.grafeas.v1";
25
+ option objc_class_prefix = "GRA";
26
+
27
+ message SlsaProvenance {
28
+ // Steps taken to build the artifact.
29
+ // For a TaskRun, typically each container corresponds to one step in the
30
+ // recipe.
31
+ message SlsaRecipe {
32
+ // URI indicating what type of recipe was performed. It determines the
33
+ // meaning of recipe.entryPoint, recipe.arguments, recipe.environment, and
34
+ // materials.
35
+ string type = 1;
36
+ // Index in materials containing the recipe steps that are not implied by
37
+ // recipe.type. For example, if the recipe type were "make", then this would
38
+ // point to the source containing the Makefile, not the make program itself.
39
+ // Set to -1 if the recipe doesn't come from a material, as zero is default
40
+ // unset value for int64.
41
+ int64 defined_in_material = 2;
42
+ // String identifying the entry point into the build.
43
+ // This is often a path to a configuration file and/or a target label within
44
+ // that file. The syntax and meaning are defined by recipe.type. For
45
+ // example, if the recipe type were "make", then this would reference the
46
+ // directory in which to run make as well as which target to use.
47
+ string entry_point = 3;
48
+ // Collection of all external inputs that influenced the build on top of
49
+ // recipe.definedInMaterial and recipe.entryPoint. For example, if the
50
+ // recipe type were "make", then this might be the flags passed to make
51
+ // aside from the target, which is captured in recipe.entryPoint. Depending
52
+ // on the recipe Type, the structure may be different.
53
+ google.protobuf.Any arguments = 4;
54
+ // Any other builder-controlled inputs necessary for correctly evaluating
55
+ // the recipe. Usually only needed for reproducing the build but not
56
+ // evaluated as part of policy. Depending on the recipe Type, the structure
57
+ // may be different.
58
+ google.protobuf.Any environment = 5;
59
+ }
60
+
61
+ // Indicates that the builder claims certain fields in this message to be
62
+ // complete.
63
+ message SlsaCompleteness {
64
+ // If true, the builder claims that recipe.arguments is complete, meaning
65
+ // that all external inputs are properly captured in the recipe.
66
+ bool arguments = 1;
67
+ // If true, the builder claims that recipe.environment is claimed to be
68
+ // complete.
69
+ bool environment = 2;
70
+ // If true, the builder claims that materials are complete, usually through
71
+ // some controls to prevent network access. Sometimes called "hermetic".
72
+ bool materials = 3;
73
+ }
74
+
75
+ // Other properties of the build.
76
+ message SlsaMetadata {
77
+ // Identifies the particular build invocation, which can be useful for
78
+ // finding associated logs or other ad-hoc analysis. The value SHOULD be
79
+ // globally unique, per in-toto Provenance spec.
80
+ string build_invocation_id = 1;
81
+ // The timestamp of when the build started.
82
+ google.protobuf.Timestamp build_started_on = 2;
83
+ // The timestamp of when the build completed.
84
+ google.protobuf.Timestamp build_finished_on = 3;
85
+ // Indicates that the builder claims certain fields in this message to be
86
+ // complete.
87
+ SlsaCompleteness completeness = 4;
88
+ // If true, the builder claims that running the recipe on materials will
89
+ // produce bit-for-bit identical output.
90
+ bool reproducible = 5;
91
+ }
92
+
93
+ message SlsaBuilder {
94
+ string id = 1;
95
+ }
96
+
97
+ message Material {
98
+ string uri = 1;
99
+ map<string, string> digest = 2;
100
+ }
101
+
102
+ SlsaBuilder builder = 1; // required
103
+ // Identifies the configuration used for the build.
104
+ // When combined with materials, this SHOULD fully describe the build,
105
+ // such that re-running this recipe results in bit-for-bit identical output
106
+ // (if the build is reproducible).
107
+ SlsaRecipe recipe = 2; // required
108
+ SlsaMetadata metadata = 3;
109
+ // The collection of artifacts that influenced the build including sources,
110
+ // dependencies, build tools, base images, and so on. This is considered to be
111
+ // incomplete unless metadata.completeness.materials is true. Unset or null is
112
+ // equivalent to empty.
113
+ repeated Material materials = 4;
114
+ }
@@ -16,32 +16,18 @@ syntax = "proto3";
16
16
 
17
17
  package grafeas.v1;
18
18
 
19
+ import "google/api/field_behavior.proto";
19
20
  import "google/protobuf/timestamp.proto";
20
21
  import "grafeas/v1/common.proto";
21
22
  import "grafeas/v1/cvss.proto";
22
23
  import "grafeas/v1/package.proto";
24
+ import "grafeas/v1/severity.proto";
23
25
 
24
26
  option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas";
25
27
  option java_multiple_files = true;
26
28
  option java_package = "io.grafeas.v1";
27
29
  option objc_class_prefix = "GRA";
28
30
 
29
- // Note provider assigned severity/impact ranking.
30
- enum Severity {
31
- // Unknown.
32
- SEVERITY_UNSPECIFIED = 0;
33
- // Minimal severity.
34
- MINIMAL = 1;
35
- // Low severity.
36
- LOW = 2;
37
- // Medium severity.
38
- MEDIUM = 3;
39
- // High severity.
40
- HIGH = 4;
41
- // Critical severity.
42
- CRITICAL = 5;
43
- }
44
-
45
31
  // A security vulnerability that can be found in resources.
46
32
  message VulnerabilityNote {
47
33
  // The CVSS score of this vulnerability. CVSS score is on a scale of 0 - 10
@@ -49,7 +35,7 @@ message VulnerabilityNote {
49
35
  float cvss_score = 1;
50
36
 
51
37
  // The note provider assigned severity of this vulnerability.
52
- Severity severity = 2;
38
+ grafeas.v1.Severity severity = 2;
53
39
 
54
40
  // Details of all known distros and packages affected by this vulnerability.
55
41
  repeated Detail details = 3;
@@ -115,6 +101,12 @@ message VulnerabilityNote {
115
101
  // upstream timestamp from the underlying information source - e.g. Ubuntu
116
102
  // security tracker.
117
103
  google.protobuf.Timestamp source_update_time = 12;
104
+
105
+ // The source from which the information in this Detail was obtained.
106
+ string source = 13;
107
+
108
+ // The name of the vendor of the product.
109
+ string vendor = 14;
118
110
  }
119
111
 
120
112
  // The full description of the CVSSv3 for this vulnerability.
@@ -165,13 +157,16 @@ message VulnerabilityOccurrence {
165
157
  string type = 1;
166
158
 
167
159
  // Output only. The note provider assigned severity of this vulnerability.
168
- Severity severity = 2;
160
+ grafeas.v1.Severity severity = 2;
169
161
 
170
162
  // Output only. The CVSS score of this vulnerability. CVSS score is on a
171
163
  // scale of 0 - 10 where 0 indicates low severity and 10 indicates high
172
164
  // severity.
173
165
  float cvss_score = 3;
174
166
 
167
+ // The cvss v3 score for the vulnerability.
168
+ CVSS cvssv3 = 10;
169
+
175
170
  // Required. The set of affected locations and their fixes (if available)
176
171
  // within the associated resource.
177
172
  repeated PackageIssue package_issue = 4;
@@ -205,6 +200,15 @@ message VulnerabilityOccurrence {
205
200
 
206
201
  // Output only. Whether a fix is available for this package.
207
202
  bool fix_available = 7;
203
+
204
+ // The type of package (e.g. OS, MAVEN, GO).
205
+ string package_type = 8;
206
+
207
+ // The distro or language system assigned severity for this vulnerability
208
+ // when that is available and note provider assigned severity when it is not
209
+ // available.
210
+ grafeas.v1.Severity effective_severity = 9
211
+ [(google.api.field_behavior) = OUTPUT_ONLY];
208
212
  }
209
213
 
210
214
  // Output only. A one sentence description of this vulnerability.
@@ -218,7 +222,15 @@ message VulnerabilityOccurrence {
218
222
 
219
223
  // The distro assigned severity for this vulnerability when it is available,
220
224
  // otherwise this is the note provider assigned severity.
221
- Severity effective_severity = 8;
225
+ //
226
+ // When there are multiple PackageIssues for this vulnerability, they can have
227
+ // different effective severities because some might be provided by the distro
228
+ // while others are provided by the language ecosystem for a language pack.
229
+ // For this reason, it is advised to use the effective severity on the
230
+ // PackageIssue level. In the case where multiple PackageIssues have differing
231
+ // effective severities, this field should be the highest severity for any of
232
+ // the PackageIssues.
233
+ grafeas.v1.Severity effective_severity = 8;
222
234
 
223
235
  // Output only. Whether at least one of the affected packages has a fix
224
236
  // available.