@google-cloud/containeranalysis 3.1.6 → 3.3.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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,36 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/@google-cloud/containeranalysis?activeTab=versions
6
6
 
7
+ ## [3.3.0](https://www.github.com/googleapis/nodejs-containeranalysis/compare/v3.2.0...v3.3.0) (2021-11-11)
8
+
9
+
10
+ ### Features
11
+
12
+ * Updating the grafeas protos to include compliance and intoto attestation protos ([#352](https://www.github.com/googleapis/nodejs-containeranalysis/issues/352)) ([ea334fb](https://www.github.com/googleapis/nodejs-containeranalysis/commit/ea334fb38ba769af3e7473db9414db0850d2bbdb))
13
+
14
+ ## [3.2.0](https://www.github.com/googleapis/nodejs-containeranalysis/compare/v3.1.8...v3.2.0) (2021-08-23)
15
+
16
+
17
+ ### Features
18
+
19
+ * turns on self-signed JWT feature flag ([#339](https://www.github.com/googleapis/nodejs-containeranalysis/issues/339)) ([98de66a](https://www.github.com/googleapis/nodejs-containeranalysis/commit/98de66a7ad503a0b1e5f4d3f8fd94f49ac156dfa))
20
+
21
+ ### [3.1.8](https://www.github.com/googleapis/nodejs-containeranalysis/compare/v3.1.7...v3.1.8) (2021-08-17)
22
+
23
+
24
+ ### Bug Fixes
25
+
26
+ * **build:** migrate to using main branch ([#336](https://www.github.com/googleapis/nodejs-containeranalysis/issues/336)) ([3fbaf02](https://www.github.com/googleapis/nodejs-containeranalysis/commit/3fbaf02e2dc83730d1222255ad2f6ab6d34f4be0))
27
+ * **deps:** google-gax v2.24.1 ([#338](https://www.github.com/googleapis/nodejs-containeranalysis/issues/338)) ([6f0b19a](https://www.github.com/googleapis/nodejs-containeranalysis/commit/6f0b19a20b73f542c6e88f954fc3e159b9e73f82))
28
+
29
+ ### [3.1.7](https://www.github.com/googleapis/nodejs-containeranalysis/compare/v3.1.6...v3.1.7) (2021-07-21)
30
+
31
+
32
+ ### Bug Fixes
33
+
34
+ * **deps:** google-gax v2.17.1 ([#326](https://www.github.com/googleapis/nodejs-containeranalysis/issues/326)) ([9e3f627](https://www.github.com/googleapis/nodejs-containeranalysis/commit/9e3f62734cecd16c7bae394665b50e7212f55158))
35
+ * Updating WORKSPACE files to use the newest version of the Typescript generator. ([#329](https://www.github.com/googleapis/nodejs-containeranalysis/issues/329)) ([5403fb4](https://www.github.com/googleapis/nodejs-containeranalysis/commit/5403fb42c84354d439ea8f6414b6b7e28c57f5c1))
36
+
7
37
  ### [3.1.6](https://www.github.com/googleapis/nodejs-containeranalysis/compare/v3.1.5...v3.1.6) (2021-07-01)
8
38
 
9
39
 
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  [![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages)
8
8
  [![npm version](https://img.shields.io/npm/v/@google-cloud/containeranalysis.svg)](https://www.npmjs.org/package/@google-cloud/containeranalysis)
9
- [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-containeranalysis/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-containeranalysis)
9
+ [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-containeranalysis/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-containeranalysis)
10
10
 
11
11
 
12
12
 
@@ -15,7 +15,7 @@ Container Analysis API client for Node.js
15
15
 
16
16
 
17
17
  A comprehensive list of changes in each version may be found in
18
- [the CHANGELOG](https://github.com/googleapis/nodejs-containeranalysis/blob/master/CHANGELOG.md).
18
+ [the CHANGELOG](https://github.com/googleapis/nodejs-containeranalysis/blob/main/CHANGELOG.md).
19
19
 
20
20
  * [Google Container Analysis Node.js Client API Reference][client-docs]
21
21
  * [Google Container Analysis Documentation][product-docs]
@@ -107,24 +107,24 @@ console.log(`Note ${note.name} created.`);
107
107
 
108
108
  ## Samples
109
109
 
110
- Samples are in the [`samples/`](https://github.com/googleapis/nodejs-containeranalysis/tree/master/samples) directory. Each sample's `README.md` has instructions for running its sample.
110
+ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-containeranalysis/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample.
111
111
 
112
112
  | Sample | Source Code | Try it |
113
113
  | --------------------------- | --------------------------------- | ------ |
114
- | Create Note | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/master/samples/createNote.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/createNote.js,samples/README.md) |
115
- | Create Occurrence | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/master/samples/createOccurrence.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/createOccurrence.js,samples/README.md) |
116
- | Delete Note | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/master/samples/deleteNote.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/deleteNote.js,samples/README.md) |
117
- | Delete Occurrence | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/master/samples/deleteOccurrence.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/deleteOccurrence.js,samples/README.md) |
118
- | Get Discovery Info | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/master/samples/getDiscoveryInfo.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/getDiscoveryInfo.js,samples/README.md) |
119
- | Get Note | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/master/samples/getNote.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/getNote.js,samples/README.md) |
120
- | Get Occurrence | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/master/samples/getOccurrence.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/getOccurrence.js,samples/README.md) |
121
- | Get High Vulnerabilities for Image | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/master/samples/highVulnerabilitiesForImage.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/highVulnerabilitiesForImage.js,samples/README.md) |
122
- | Occurrence PubSub | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/master/samples/occurrencePubSub.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/occurrencePubSub.js,samples/README.md) |
123
- | Occurrences for Image | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/master/samples/occurrencesForImage.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/occurrencesForImage.js,samples/README.md) |
124
- | Occurrences for Note | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/master/samples/occurrencesForNote.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/occurrencesForNote.js,samples/README.md) |
125
- | Poll Discovery Occurrence Finished | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/master/samples/pollDiscoveryOccurrenceFinished.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/pollDiscoveryOccurrenceFinished.js,samples/README.md) |
126
- | Quickstart | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) |
127
- | Vulnerability Occurrences for Image | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/master/samples/vulnerabilityOccurrencesForImage.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/vulnerabilityOccurrencesForImage.js,samples/README.md) |
114
+ | Create Note | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/main/samples/createNote.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/createNote.js,samples/README.md) |
115
+ | Create Occurrence | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/main/samples/createOccurrence.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/createOccurrence.js,samples/README.md) |
116
+ | Delete Note | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/main/samples/deleteNote.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/deleteNote.js,samples/README.md) |
117
+ | Delete Occurrence | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/main/samples/deleteOccurrence.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/deleteOccurrence.js,samples/README.md) |
118
+ | Get Discovery Info | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/main/samples/getDiscoveryInfo.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/getDiscoveryInfo.js,samples/README.md) |
119
+ | Get Note | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/main/samples/getNote.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/getNote.js,samples/README.md) |
120
+ | Get Occurrence | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/main/samples/getOccurrence.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/getOccurrence.js,samples/README.md) |
121
+ | Get High Vulnerabilities for Image | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/main/samples/highVulnerabilitiesForImage.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/highVulnerabilitiesForImage.js,samples/README.md) |
122
+ | Occurrence PubSub | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/main/samples/occurrencePubSub.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/occurrencePubSub.js,samples/README.md) |
123
+ | Occurrences for Image | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/main/samples/occurrencesForImage.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/occurrencesForImage.js,samples/README.md) |
124
+ | Occurrences for Note | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/main/samples/occurrencesForNote.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/occurrencesForNote.js,samples/README.md) |
125
+ | Poll Discovery Occurrence Finished | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/main/samples/pollDiscoveryOccurrenceFinished.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/pollDiscoveryOccurrenceFinished.js,samples/README.md) |
126
+ | Quickstart | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) |
127
+ | Vulnerability Occurrences for Image | [source code](https://github.com/googleapis/nodejs-containeranalysis/blob/main/samples/vulnerabilityOccurrencesForImage.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-containeranalysis&page=editor&open_in_editor=samples/vulnerabilityOccurrencesForImage.js,samples/README.md) |
128
128
 
129
129
 
130
130
 
@@ -173,21 +173,21 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages]
173
173
 
174
174
  ## Contributing
175
175
 
176
- Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-containeranalysis/blob/master/CONTRIBUTING.md).
176
+ Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-containeranalysis/blob/main/CONTRIBUTING.md).
177
177
 
178
178
  Please note that this `README.md`, the `samples/README.md`,
179
179
  and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`)
180
180
  are generated from a central template. To edit one of these files, make an edit
181
- to its template in this
182
- [directory](https://github.com/googleapis/synthtool/tree/master/synthtool/gcp/templates/node_library).
181
+ to its templates in
182
+ [directory](https://github.com/googleapis/synthtool).
183
183
 
184
184
  ## License
185
185
 
186
186
  Apache Version 2.0
187
187
 
188
- See [LICENSE](https://github.com/googleapis/nodejs-containeranalysis/blob/master/LICENSE)
188
+ See [LICENSE](https://github.com/googleapis/nodejs-containeranalysis/blob/main/LICENSE)
189
189
 
190
- [client-docs]: https://googleapis.dev/nodejs/containeranalysis/latest
190
+ [client-docs]: https://cloud.google.com/nodejs/docs/reference/containeranalysis/latest
191
191
  [product-docs]: https://cloud.google.com/container-registry/docs/container-analysis
192
192
  [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
193
193
  [projects]: https://console.cloud.google.com/project
@@ -53,6 +53,13 @@ message AttestationNote {
53
53
  Hint hint = 1;
54
54
  }
55
55
 
56
+ message Jwt {
57
+ // The compact encoding of a JWS, which is always three base64 encoded strings
58
+ // joined by periods. For details, see:
59
+ // https://tools.ietf.org/html/rfc7515.html#section-3.1
60
+ string compact_jwt = 1;
61
+ }
62
+
56
63
  // Occurrence that represents a single "attestation". The authenticity of an
57
64
  // attestation can be verified using the attached signature. If the verifier
58
65
  // trusts the public key of the signer, then verifying the signature is
@@ -70,4 +77,14 @@ message AttestationOccurrence {
70
77
  // `signature` verifies `serialized_payload`. See `Signature` in common.proto
71
78
  // for more details on signature structure and verification.
72
79
  repeated Signature signatures = 2;
80
+ // One or more JWTs encoding a self-contained attestation.
81
+ // Each JWT encodes the payload that it verifies within the JWT itself.
82
+ // Verifier implementation SHOULD ignore the `serialized_payload` field
83
+ // when verifying these JWTs.
84
+ // If only JWTs are present on this AttestationOccurrence, then the
85
+ // `serialized_payload` SHOULD be left empty.
86
+ // Each JWT SHOULD encode a claim specific to the `resource_uri` of this
87
+ // Occurrence, but this is not validated by Grafeas metadata API
88
+ // implementations. The JWT itself is opaque to Grafeas.
89
+ repeated Jwt jwts = 3;
73
90
  }
@@ -16,6 +16,8 @@ syntax = "proto3";
16
16
 
17
17
  package grafeas.v1;
18
18
 
19
+ import "grafeas/v1/intoto_provenance.proto";
20
+ import "grafeas/v1/intoto_statement.proto";
19
21
  import "grafeas/v1/provenance.proto";
20
22
 
21
23
  option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas";
@@ -32,7 +34,7 @@ message BuildNote {
32
34
 
33
35
  // Details of a build occurrence.
34
36
  message BuildOccurrence {
35
- // Required. The actual provenance for the build.
37
+ // The actual provenance for the build.
36
38
  grafeas.v1.BuildProvenance provenance = 1;
37
39
 
38
40
  // Serialized JSON representation of the provenance, used in generating the
@@ -47,4 +49,14 @@ message BuildOccurrence {
47
49
  // provenance is marshalled to json as well to prevent incompatibilities with
48
50
  // future changes.
49
51
  string provenance_bytes = 2;
52
+
53
+ // Deprecated. See InTotoStatement for the replacement.
54
+ // In-toto Provenance representation as defined in spec.
55
+ InTotoProvenance intoto_provenance = 3;
56
+
57
+ // In-toto Statement representation as defined in spec.
58
+ // The intoto_statement can contain any type of provenance. The serialized
59
+ // payload of the statement can be stored and signed in the Occurrence's
60
+ // envelope.
61
+ InTotoStatement intoto_statement = 4;
50
62
  }
@@ -23,7 +23,7 @@ option objc_class_prefix = "GRA";
23
23
 
24
24
  // Kind represents the kinds of notes supported.
25
25
  enum NoteKind {
26
- // Unknown.
26
+ // Default value. This value is unused.
27
27
  NOTE_KIND_UNSPECIFIED = 0;
28
28
  // The note and occurrence represent a package vulnerability.
29
29
  VULNERABILITY = 1;
@@ -41,6 +41,10 @@ enum NoteKind {
41
41
  ATTESTATION = 7;
42
42
  // This represents an available package upgrade.
43
43
  UPGRADE = 8;
44
+ // This represents a Compliance Note
45
+ COMPLIANCE = 9;
46
+ // This represents a DSSE attestation Note
47
+ DSSE_ATTESTATION = 10;
44
48
  }
45
49
 
46
50
  // Metadata for any related URL information.
@@ -84,7 +88,7 @@ message Signature {
84
88
 
85
89
  // The identifier for the public key that verifies this signature.
86
90
  // * The `public_key_id` is required.
87
- // * The `public_key_id` MUST be an RFC3986 conformant URI.
91
+ // * The `public_key_id` SHOULD be an RFC3986 conformant URI.
88
92
  // * When possible, the `public_key_id` SHOULD be an immutable reference,
89
93
  // such as a cryptographic digest.
90
94
  //
@@ -101,3 +105,17 @@ message Signature {
101
105
  // * "nih:///sha-256;703f68f42aba2c6de30f488a5ea122fef76324679c9bf89791ba95a1271589a5"
102
106
  string public_key_id = 2;
103
107
  }
108
+
109
+ // MUST match
110
+ // https://github.com/secure-systems-lab/dsse/blob/master/envelope.proto. An
111
+ // authenticated message of arbitrary type.
112
+ message Envelope {
113
+ bytes payload = 1;
114
+ string payload_type = 2;
115
+ repeated EnvelopeSignature signatures = 3;
116
+ }
117
+
118
+ message EnvelopeSignature {
119
+ bytes sig = 1;
120
+ string keyid = 2;
121
+ }
@@ -0,0 +1,79 @@
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/vulnerability.proto";
20
+
21
+ option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas";
22
+ option java_multiple_files = true;
23
+ option java_package = "io.grafeas.v1";
24
+ option objc_class_prefix = "GRA";
25
+
26
+ message ComplianceNote {
27
+ // The title that identifies this compliance check.
28
+ string title = 1;
29
+ // A description about this compliance check.
30
+ string description = 2;
31
+ // The OS and config versions the benchmark applies to.
32
+ repeated grafeas.v1.ComplianceVersion version = 3;
33
+ // A rationale for the existence of this compliance check.
34
+ string rationale = 4;
35
+ // A description of remediation steps if the compliance check fails.
36
+ string remediation = 5;
37
+ // A compliance check that is a CIS benchmark.
38
+ message CisBenchmark {
39
+ int32 profile_level = 1;
40
+ grafeas.v1.Severity severity = 2;
41
+ }
42
+ oneof compliance_type {
43
+ CisBenchmark cis_benchmark = 6;
44
+ }
45
+ // Serialized scan instructions with a predefined format.
46
+ bytes scan_instructions = 7;
47
+ }
48
+
49
+ // Describes the CIS benchmark version that is applicable to a given OS and
50
+ // os version.
51
+ message ComplianceVersion {
52
+ // The CPE URI (https://cpe.mitre.org/specification/) this benchmark is
53
+ // applicable to.
54
+ string cpe_uri = 1;
55
+ // The version of the benchmark. This is set to the version of the OS-specific
56
+ // CIS document the benchmark is defined in.
57
+ string version = 2;
58
+ }
59
+
60
+ // An indication that the compliance checks in the associated ComplianceNote
61
+ // were not satisfied for particular resources or a specified reason.
62
+ message ComplianceOccurrence {
63
+ repeated NonCompliantFile non_compliant_files = 2;
64
+ string non_compliance_reason = 3;
65
+ }
66
+
67
+ // Details about files that caused a compliance check to fail.
68
+ message NonCompliantFile {
69
+ // display_command is a single command that can be used to display a list of
70
+ // non compliant files. When there is no such command, we can also iterate a
71
+ // list of non compliant file using 'path'.
72
+
73
+ // Empty if `display_command` is set.
74
+ string path = 1;
75
+ // Command to display the non-compliant files.
76
+ string display_command = 2;
77
+ // Explains why a file is non compliant for a CIS check.
78
+ string reason = 3;
79
+ }
@@ -0,0 +1,52 @@
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
+ syntax = "proto3";
15
+
16
+ package grafeas.v1;
17
+
18
+ import "grafeas/v1/common.proto";
19
+ import "grafeas/v1/intoto_statement.proto";
20
+
21
+ option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas";
22
+ option java_multiple_files = true;
23
+ option java_package = "io.grafeas.v1";
24
+ option objc_class_prefix = "GRA";
25
+
26
+ message DSSEAttestationNote {
27
+ // This submessage provides human-readable hints about the purpose of the
28
+ // authority. Because the name of a note acts as its resource reference, it is
29
+ // important to disambiguate the canonical name of the Note (which might be a
30
+ // UUID for security purposes) from "readable" names more suitable for debug
31
+ // output. Note that these hints should not be used to look up authorities in
32
+ // security sensitive contexts, such as when looking up attestations to
33
+ // verify.
34
+ message DSSEHint {
35
+ // Required. The human readable name of this attestation authority, for
36
+ // example "cloudbuild-prod".
37
+ string human_readable_name = 1;
38
+ }
39
+ // DSSEHint hints at the purpose of the attestation authority.
40
+ DSSEHint hint = 1;
41
+ }
42
+
43
+ // Deprecated. Prefer to use a regular Occurrence, and populate the
44
+ // Envelope at the top level of the Occurrence.
45
+ message DSSEAttestationOccurrence {
46
+ // If doing something security critical, make sure to verify the signatures in
47
+ // this metadata.
48
+ Envelope envelope = 1;
49
+ oneof decoded_payload {
50
+ InTotoStatement statement = 2;
51
+ }
52
+ }
@@ -26,8 +26,10 @@ import "google/protobuf/timestamp.proto";
26
26
  import "grafeas/v1/attestation.proto";
27
27
  import "grafeas/v1/build.proto";
28
28
  import "grafeas/v1/common.proto";
29
+ import "grafeas/v1/compliance.proto";
29
30
  import "grafeas/v1/deployment.proto";
30
31
  import "grafeas/v1/discovery.proto";
32
+ import "grafeas/v1/dsse_attestation.proto";
31
33
  import "grafeas/v1/image.proto";
32
34
  import "grafeas/v1/package.proto";
33
35
  import "grafeas/v1/upgrade.proto";
@@ -242,7 +244,14 @@ message Occurrence {
242
244
  grafeas.v1.AttestationOccurrence attestation = 14;
243
245
  // Describes an available package upgrade on the linked resource.
244
246
  grafeas.v1.UpgradeOccurrence upgrade = 15;
247
+ // Describes a compliance violation on a linked resource.
248
+ grafeas.v1.ComplianceOccurrence compliance = 16;
249
+ // Describes an attestation of an artifact using dsse.
250
+ grafeas.v1.DSSEAttestationOccurrence dsse_attestation = 17;
245
251
  }
252
+
253
+ // https://github.com/secure-systems-lab/dsse
254
+ grafeas.v1.Envelope envelope = 18;
246
255
  }
247
256
 
248
257
  // A type of analysis that can be done for a resource.
@@ -301,6 +310,10 @@ message Note {
301
310
  grafeas.v1.AttestationNote attestation = 16;
302
311
  // A note describing available package upgrades.
303
312
  grafeas.v1.UpgradeNote upgrade = 17;
313
+ // A note describing a compliance check.
314
+ grafeas.v1.ComplianceNote compliance = 18;
315
+ // A note describing a dsse attestation note.
316
+ grafeas.v1.DSSEAttestationNote dsse_attestation = 19;
304
317
  }
305
318
  }
306
319
 
@@ -0,0 +1,112 @@
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
+ // Spec defined at
28
+ // https://github.com/in-toto/attestation/blob/main/spec/predicates/provenance.md
29
+
30
+ // Steps taken to build the artifact.
31
+ // For a TaskRun, typically each container corresponds to one step in the
32
+ // recipe.
33
+ message Recipe {
34
+ // URI indicating what type of recipe was performed. It determines the meaning
35
+ // of recipe.entryPoint, recipe.arguments, recipe.environment, and materials.
36
+ string type = 1;
37
+ // Index in materials containing the recipe steps that are not implied by
38
+ // recipe.type. For example, if the recipe type were "make", then this would
39
+ // point to the source containing the Makefile, not the make program itself.
40
+ // Set to -1 if the recipe doesn't come from a material, as zero is default
41
+ // unset value for int64.
42
+ int64 defined_in_material = 2;
43
+ // String identifying the entry point into the build.
44
+ // This is often a path to a configuration file and/or a target label within
45
+ // that file. The syntax and meaning are defined by recipe.type. For example,
46
+ // if the recipe type were "make", then this would reference the directory in
47
+ // which to run make as well as which target to use.
48
+ string entry_point = 3;
49
+ // Collection of all external inputs that influenced the build on top of
50
+ // recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
51
+ // type were "make", then this might be the flags passed to make aside from
52
+ // the target, which is captured in recipe.entryPoint. Since the arguments
53
+ // field can greatly vary in structure, depending on the builder and recipe
54
+ // type, this is of form "Any".
55
+ repeated google.protobuf.Any arguments = 4;
56
+ // Any other builder-controlled inputs necessary for correctly evaluating the
57
+ // recipe. Usually only needed for reproducing the build but not evaluated as
58
+ // part of policy. Since the environment field can greatly vary in structure,
59
+ // depending on the builder and recipe type, this is of form "Any".
60
+ repeated google.protobuf.Any environment = 5;
61
+ }
62
+
63
+ // Indicates that the builder claims certain fields in this message to be
64
+ // complete.
65
+ message Completeness {
66
+ // If true, the builder claims that recipe.arguments is complete, meaning that
67
+ // all external inputs are properly captured in the recipe.
68
+ bool arguments = 1;
69
+ // If true, the builder claims that recipe.environment is claimed to be
70
+ // complete.
71
+ bool environment = 2;
72
+ // If true, the builder claims that materials are complete, usually through
73
+ // some controls to prevent network access. Sometimes called "hermetic".
74
+ bool materials = 3;
75
+ }
76
+
77
+ // Other properties of the build.
78
+ message Metadata {
79
+ // Identifies the particular build invocation, which can be useful for finding
80
+ // associated logs or other ad-hoc analysis. The value SHOULD be globally
81
+ // unique, per in-toto Provenance spec.
82
+ string build_invocation_id = 1;
83
+ // The timestamp of when the build started.
84
+ google.protobuf.Timestamp build_started_on = 2;
85
+ // The timestamp of when the build completed.
86
+ google.protobuf.Timestamp build_finished_on = 3;
87
+ // Indicates that the builder claims certain fields in this message to be
88
+ // complete.
89
+ Completeness completeness = 4;
90
+ // If true, the builder claims that running the recipe on materials will
91
+ // produce bit-for-bit identical output.
92
+ bool reproducible = 5;
93
+ }
94
+
95
+ message BuilderConfig {
96
+ string id = 1;
97
+ }
98
+
99
+ message InTotoProvenance {
100
+ BuilderConfig builder_config = 1; // required
101
+ // Identifies the configuration used for the build.
102
+ // When combined with materials, this SHOULD fully describe the build,
103
+ // such that re-running this recipe results in bit-for-bit identical output
104
+ // (if the build is reproducible).
105
+ Recipe recipe = 2; // required
106
+ Metadata metadata = 3;
107
+ // The collection of artifacts that influenced the build including sources,
108
+ // dependencies, build tools, base images, and so on. This is considered to be
109
+ // incomplete unless metadata.completeness.materials is true. Unset or null is
110
+ // equivalent to empty.
111
+ repeated string materials = 4;
112
+ }
@@ -0,0 +1,49 @@
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
+
27
+ // Spec defined at
28
+ // https://github.com/in-toto/attestation/tree/main/spec#statement The
29
+ // serialized InTotoStatement will be stored as Envelope.payload.
30
+ // Envelope.payloadType is always "application/vnd.in-toto+json".
31
+ message InTotoStatement {
32
+ // Always `https://in-toto.io/Statement/v0.1`.
33
+ string type = 1 [json_name = "_type"];
34
+ repeated Subject subject = 2;
35
+ // `https://slsa.dev/provenance/v0.1` for SlsaProvenance.
36
+ string predicate_type = 3;
37
+ oneof predicate {
38
+ InTotoProvenance provenance = 4;
39
+ SlsaProvenance slsa_provenance = 5;
40
+ }
41
+ }
42
+ message Subject {
43
+ string name = 1;
44
+ // `"<ALGORITHM>": "<HEX_VALUE>"`
45
+ // Algorithms can be e.g. sha256, sha512
46
+ // See
47
+ // https://github.com/in-toto/attestation/blob/main/spec/field_types.md#DigestSet
48
+ map<string, string> digest = 2;
49
+ }
@@ -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.