Skip to content

Commit 5fd0b34

Browse files
feat: [grafeas] A new field in_toto_slsa_provenance_v1 is added to message BuildOccurrence (#12455)
BEGIN_COMMIT_OVERRIDE feat: A new field `in_toto_slsa_provenance_v1` is added to message `BuildOccurrence` feat: A new value `SBOM_REFERENCE` is added to enum `NoteKind` feat: A new field `impact` is added to message `ComplianceNote` feat: A new message `SBOMStatus` is added feat: A new field `sbom_status` is added to message `DiscoveryOccurrence` feat: A new field `sbom_reference` is added to message `Occurrence` feat: A new field `sbom_reference` is added to message `Note` feat: A new message `InTotoSlsaProvenanceV1` is added feat: A new message `SBOMReferenceNote` is added feat: A new message `SBOMReferenceOccurrence` is added feat: A new message `SbomReferenceIntotoPayload` is added feat: A new message `SbomReferenceIntotoPredicate` is added feat: A new field `vulnerability_id` is added to message `VulnerabilityAssessmentNote` feat: A new field `vulnerability_id` is added to message `VulnerabilityOccurrence` feat: A new field `extra_details` is added to message `VulnerabilityOccurrence` docs: A comment for field `cve` in message `VulnerabilityAssessmentNote` is changed docs: A comment for field `cve` in message `VulnerabilityOccurrence` is changed END_COMMIT_OVERRIDE - [ ] Regenerate this pull request now. feat: A new value `SBOM_REFERENCE` is added to enum `NoteKind` feat: A new field `impact` is added to message `ComplianceNote` feat: A new message `SBOMStatus` is added feat: A new field `sbom_status` is added to message `DiscoveryOccurrence` feat: A new field `sbom_reference` is added to message `Occurrence` feat: A new field `sbom_reference` is added to message `Note` feat: A new message `InTotoSlsaProvenanceV1` is added feat: A new message `SBOMReferenceNote` is added feat: A new message `SBOMReferenceOccurrence` is added feat: A new message `SbomReferenceIntotoPayload` is added feat: A new message `SbomReferenceIntotoPredicate` is added feat: A new field `vulnerability_id` is added to message `VulnerabilityAssessmentNote` feat: A new field `vulnerability_id` is added to message `VulnerabilityOccurrence` feat: A new field `extra_details` is added to message `VulnerabilityOccurrence` docs: A comment for field `cve` in message `VulnerabilityAssessmentNote` is changed docs: A comment for field `cve` in message `VulnerabilityOccurrence` is changed PiperOrigin-RevId: 615482848 Source-Link: googleapis/googleapis@3627f6c Source-Link: googleapis/googleapis-gen@58f5bcc Copy-Tag: eyJwIjoicGFja2FnZXMvZ3JhZmVhcy8uT3dsQm90LnlhbWwiLCJoIjoiNThmNWJjYzVjYmIzZDYxZjUxNTk5MWRmY2M1MGEzN2UyODkzNDhhYiJ9 --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 3700b53 commit 5fd0b34

16 files changed

Lines changed: 701 additions & 9 deletions

File tree

packages/grafeas/grafeas/grafeas/__init__.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@
8585
Metadata,
8686
Recipe,
8787
)
88-
from grafeas.grafeas_v1.types.intoto_statement import InTotoStatement, Subject
88+
from grafeas.grafeas_v1.types.intoto_statement import (
89+
InTotoSlsaProvenanceV1,
90+
InTotoStatement,
91+
Subject,
92+
)
8993
from grafeas.grafeas_v1.types.package import (
9094
Architecture,
9195
Distribution,
@@ -109,6 +113,12 @@
109113
Source,
110114
SourceContext,
111115
)
116+
from grafeas.grafeas_v1.types.sbom import (
117+
SbomReferenceIntotoPayload,
118+
SbomReferenceIntotoPredicate,
119+
SBOMReferenceNote,
120+
SBOMReferenceOccurrence,
121+
)
112122
from grafeas.grafeas_v1.types.severity import Severity
113123
from grafeas.grafeas_v1.types.slsa_provenance import SlsaProvenance
114124
from grafeas.grafeas_v1.types.slsa_provenance_zero_two import SlsaProvenanceZeroTwo
@@ -183,6 +193,7 @@
183193
"InTotoProvenance",
184194
"Metadata",
185195
"Recipe",
196+
"InTotoSlsaProvenanceV1",
186197
"InTotoStatement",
187198
"Subject",
188199
"Distribution",
@@ -204,6 +215,10 @@
204215
"RepoId",
205216
"Source",
206217
"SourceContext",
218+
"SbomReferenceIntotoPayload",
219+
"SbomReferenceIntotoPredicate",
220+
"SBOMReferenceNote",
221+
"SBOMReferenceOccurrence",
207222
"Severity",
208223
"SlsaProvenance",
209224
"SlsaProvenanceZeroTwo",

packages/grafeas/grafeas/grafeas_v1/__init__.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
Metadata,
7373
Recipe,
7474
)
75-
from .types.intoto_statement import InTotoStatement, Subject
75+
from .types.intoto_statement import InTotoSlsaProvenanceV1, InTotoStatement, Subject
7676
from .types.package import (
7777
Architecture,
7878
Distribution,
@@ -96,6 +96,12 @@
9696
Source,
9797
SourceContext,
9898
)
99+
from .types.sbom import (
100+
SbomReferenceIntotoPayload,
101+
SbomReferenceIntotoPredicate,
102+
SBOMReferenceNote,
103+
SBOMReferenceOccurrence,
104+
)
99105
from .types.severity import Severity
100106
from .types.slsa_provenance import SlsaProvenance
101107
from .types.slsa_provenance_zero_two import SlsaProvenanceZeroTwo
@@ -159,6 +165,7 @@
159165
"ImageNote",
160166
"ImageOccurrence",
161167
"InTotoProvenance",
168+
"InTotoSlsaProvenanceV1",
162169
"InTotoStatement",
163170
"Jwt",
164171
"Layer",
@@ -181,6 +188,10 @@
181188
"Recipe",
182189
"RelatedUrl",
183190
"RepoId",
191+
"SBOMReferenceNote",
192+
"SBOMReferenceOccurrence",
193+
"SbomReferenceIntotoPayload",
194+
"SbomReferenceIntotoPredicate",
184195
"Severity",
185196
"Signature",
186197
"SlsaProvenance",

packages/grafeas/grafeas/grafeas_v1/services/grafeas/async_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
grafeas,
5858
image,
5959
package,
60+
sbom,
6061
upgrade,
6162
vex,
6263
vulnerability,

packages/grafeas/grafeas/grafeas_v1/services/grafeas/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
grafeas,
6363
image,
6464
package,
65+
sbom,
6566
upgrade,
6667
vex,
6768
vulnerability,

packages/grafeas/grafeas/grafeas_v1/services/grafeas/transports/rest.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,6 +1141,10 @@ def __call__(
11411141
"method": "get",
11421142
"uri": "/v1/{name=projects/*/notes/*}",
11431143
},
1144+
{
1145+
"method": "get",
1146+
"uri": "/v1/{name=projects/*/locations/*/notes/*}",
1147+
},
11441148
]
11451149
request, metadata = self._interceptor.pre_get_note(request, metadata)
11461150
pb_request = grafeas.GetNoteRequest.pb(request)
@@ -1228,6 +1232,10 @@ def __call__(
12281232
"method": "get",
12291233
"uri": "/v1/{name=projects/*/occurrences/*}",
12301234
},
1235+
{
1236+
"method": "get",
1237+
"uri": "/v1/{name=projects/*/locations/*/occurrences/*}",
1238+
},
12311239
]
12321240
request, metadata = self._interceptor.pre_get_occurrence(request, metadata)
12331241
pb_request = grafeas.GetOccurrenceRequest.pb(request)
@@ -1316,6 +1324,10 @@ def __call__(
13161324
"method": "get",
13171325
"uri": "/v1/{name=projects/*/occurrences/*}/notes",
13181326
},
1327+
{
1328+
"method": "get",
1329+
"uri": "/v1/{name=projects/*/locations/*/occurrences/*}/notes",
1330+
},
13191331
]
13201332
request, metadata = self._interceptor.pre_get_occurrence_note(
13211333
request, metadata
@@ -1406,6 +1418,10 @@ def __call__(
14061418
"method": "get",
14071419
"uri": "/v1/{name=projects/*/notes/*}/occurrences",
14081420
},
1421+
{
1422+
"method": "get",
1423+
"uri": "/v1/{name=projects/*/locations/*/notes/*}/occurrences",
1424+
},
14091425
]
14101426
request, metadata = self._interceptor.pre_list_note_occurrences(
14111427
request, metadata
@@ -1493,6 +1509,10 @@ def __call__(
14931509
"method": "get",
14941510
"uri": "/v1/{parent=projects/*}/notes",
14951511
},
1512+
{
1513+
"method": "get",
1514+
"uri": "/v1/{parent=projects/*/locations/*}/notes",
1515+
},
14961516
]
14971517
request, metadata = self._interceptor.pre_list_notes(request, metadata)
14981518
pb_request = grafeas.ListNotesRequest.pb(request)
@@ -1578,6 +1598,10 @@ def __call__(
15781598
"method": "get",
15791599
"uri": "/v1/{parent=projects/*}/occurrences",
15801600
},
1601+
{
1602+
"method": "get",
1603+
"uri": "/v1/{parent=projects/*/locations/*}/occurrences",
1604+
},
15811605
]
15821606
request, metadata = self._interceptor.pre_list_occurrences(
15831607
request, metadata

packages/grafeas/grafeas/grafeas_v1/types/__init__.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
Metadata,
6767
Recipe,
6868
)
69-
from .intoto_statement import InTotoStatement, Subject
69+
from .intoto_statement import InTotoSlsaProvenanceV1, InTotoStatement, Subject
7070
from .package import (
7171
Architecture,
7272
Distribution,
@@ -90,6 +90,12 @@
9090
Source,
9191
SourceContext,
9292
)
93+
from .sbom import (
94+
SbomReferenceIntotoPayload,
95+
SbomReferenceIntotoPredicate,
96+
SBOMReferenceNote,
97+
SBOMReferenceOccurrence,
98+
)
9399
from .severity import Severity
94100
from .slsa_provenance import SlsaProvenance
95101
from .slsa_provenance_zero_two import SlsaProvenanceZeroTwo
@@ -154,6 +160,7 @@
154160
"InTotoProvenance",
155161
"Metadata",
156162
"Recipe",
163+
"InTotoSlsaProvenanceV1",
157164
"InTotoStatement",
158165
"Subject",
159166
"Distribution",
@@ -175,6 +182,10 @@
175182
"RepoId",
176183
"Source",
177184
"SourceContext",
185+
"SbomReferenceIntotoPayload",
186+
"SbomReferenceIntotoPredicate",
187+
"SBOMReferenceNote",
188+
"SBOMReferenceOccurrence",
178189
"Severity",
179190
"SlsaProvenance",
180191
"SlsaProvenanceZeroTwo",

packages/grafeas/grafeas/grafeas_v1/types/build.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ class BuildOccurrence(proto.Message):
7777
intoto_statement can contain any type of provenance. The
7878
serialized payload of the statement can be stored and signed
7979
in the Occurrence's envelope.
80+
in_toto_slsa_provenance_v1 (grafeas.grafeas_v1.types.InTotoSlsaProvenanceV1):
81+
In-Toto Slsa Provenance V1 represents a slsa
82+
provenance meeting the slsa spec, wrapped in an
83+
in-toto statement. This allows for direct
84+
jsonification of a to-spec in-toto slsa
85+
statement with a to-spec slsa provenance.
8086
"""
8187

8288
provenance: g_provenance.BuildProvenance = proto.Field(
@@ -98,6 +104,11 @@ class BuildOccurrence(proto.Message):
98104
number=4,
99105
message=g_intoto_statement.InTotoStatement,
100106
)
107+
in_toto_slsa_provenance_v1: g_intoto_statement.InTotoSlsaProvenanceV1 = proto.Field(
108+
proto.MESSAGE,
109+
number=5,
110+
message=g_intoto_statement.InTotoSlsaProvenanceV1,
111+
)
101112

102113

103114
__all__ = tuple(sorted(__protobuf__.manifest))

packages/grafeas/grafeas/grafeas_v1/types/common.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ class NoteKind(proto.Enum):
6868
This represents a DSSE attestation Note
6969
VULNERABILITY_ASSESSMENT (11):
7070
This represents a Vulnerability Assessment.
71+
SBOM_REFERENCE (12):
72+
This represents an SBOM Reference.
7173
"""
7274
NOTE_KIND_UNSPECIFIED = 0
7375
VULNERABILITY = 1
@@ -81,6 +83,7 @@ class NoteKind(proto.Enum):
8183
COMPLIANCE = 9
8284
DSSE_ATTESTATION = 10
8385
VULNERABILITY_ASSESSMENT = 11
86+
SBOM_REFERENCE = 12
8487

8588

8689
class RelatedUrl(proto.Message):

packages/grafeas/grafeas/grafeas_v1/types/compliance.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ class ComplianceNote(proto.Message):
5858
scan_instructions (bytes):
5959
Serialized scan instructions with a
6060
predefined format.
61+
impact (str):
62+
63+
This field is a member of `oneof`_ ``potential_impact``.
6164
"""
6265

6366
class CisBenchmark(proto.Message):
@@ -111,6 +114,11 @@ class CisBenchmark(proto.Message):
111114
proto.BYTES,
112115
number=7,
113116
)
117+
impact: str = proto.Field(
118+
proto.STRING,
119+
number=8,
120+
oneof="potential_impact",
121+
)
114122

115123

116124
class ComplianceVersion(proto.Message):

packages/grafeas/grafeas/grafeas_v1/types/discovery.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ class DiscoveryOccurrence(proto.Message):
7878
archive_time (google.protobuf.timestamp_pb2.Timestamp):
7979
The time occurrences related to this
8080
discovery occurrence were archived.
81+
sbom_status (grafeas.grafeas_v1.types.DiscoveryOccurrence.SBOMStatus):
82+
The status of an SBOM generation.
8183
"""
8284

8385
class ContinuousAnalysis(proto.Enum):
@@ -141,6 +143,42 @@ class AnalysisCompleted(proto.Message):
141143
number=1,
142144
)
143145

146+
class SBOMStatus(proto.Message):
147+
r"""The status of an SBOM generation.
148+
149+
Attributes:
150+
sbom_state (grafeas.grafeas_v1.types.DiscoveryOccurrence.SBOMStatus.SBOMState):
151+
The progress of the SBOM generation.
152+
error (str):
153+
If there was an error generating an SBOM,
154+
this will indicate what that error was.
155+
"""
156+
157+
class SBOMState(proto.Enum):
158+
r"""An enum indicating the progress of the SBOM generation.
159+
160+
Values:
161+
SBOM_STATE_UNSPECIFIED (0):
162+
Default unknown state.
163+
PENDING (1):
164+
SBOM scanning is pending.
165+
COMPLETE (2):
166+
SBOM scanning has completed.
167+
"""
168+
SBOM_STATE_UNSPECIFIED = 0
169+
PENDING = 1
170+
COMPLETE = 2
171+
172+
sbom_state: "DiscoveryOccurrence.SBOMStatus.SBOMState" = proto.Field(
173+
proto.ENUM,
174+
number=1,
175+
enum="DiscoveryOccurrence.SBOMStatus.SBOMState",
176+
)
177+
error: str = proto.Field(
178+
proto.STRING,
179+
number=2,
180+
)
181+
144182
continuous_analysis: ContinuousAnalysis = proto.Field(
145183
proto.ENUM,
146184
number=1,
@@ -180,6 +218,11 @@ class AnalysisCompleted(proto.Message):
180218
number=6,
181219
message=timestamp_pb2.Timestamp,
182220
)
221+
sbom_status: SBOMStatus = proto.Field(
222+
proto.MESSAGE,
223+
number=9,
224+
message=SBOMStatus,
225+
)
183226

184227

185228
__all__ = tuple(sorted(__protobuf__.manifest))

0 commit comments

Comments
 (0)