Skip to content

Commit 618e8f2

Browse files
committed
docs: tidy up json examples for slsa definitions
Signed-off-by: Justin Chadwell <[email protected]>
1 parent 065e6a5 commit 618e8f2

File tree

1 file changed

+71
-37
lines changed

1 file changed

+71
-37
lines changed

docs/slsa-definitions.md

Lines changed: 71 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Included with `mode=min` and `mode=max`.
3030
The `buildType` field is set to `https://mobyproject.org/buildkit@v1` can be
3131
used to determine the structure of the provenance content.
3232

33-
```
33+
```json
3434
"buildType": "https://mobyproject.org/buildkit@v1",
3535
```
3636

@@ -49,6 +49,8 @@ Describes the config that initialized the build.
4949
},
5050
"entryPoint": "Dockerfile"
5151
},
52+
...
53+
},
5254
```
5355

5456
For builds initialized from a remote context, like a Git or HTTP URL, this
@@ -64,7 +66,6 @@ Describes build inputs passed to the build.
6466

6567
```json
6668
"invocation": {
67-
...
6869
"parameters": {
6970
"frontend": "gateway.v0",
7071
"args": {
@@ -77,11 +78,14 @@ Describes build inputs passed to the build.
7778
{
7879
"id": "GIT_AUTH_HEADER",
7980
"optional": true
80-
}
81+
},
8182
...
8283
],
8384
"ssh": [],
84-
"locals": [],
85+
"locals": []
86+
},
87+
...
88+
},
8589
```
8690

8791
The following fields are included with both `mode=min` and `mode=max`:
@@ -109,9 +113,12 @@ The following fields are only included with `mode=max`:
109113
Included with `mode=min` and `mode=max`.
110114

111115
```json
116+
"invocation": {
112117
"environment": {
113118
"platform": "linux/amd64"
114-
}
119+
},
120+
...
121+
},
115122
```
116123

117124
The only value BuildKit currently sets is the `platform` of the current build
@@ -150,7 +157,7 @@ determine if the artifact has been updated compared to when the build ran.
150157
"digest": {
151158
"sha1": "4b220de5058abfd01ff619c9d2ff6b09a049bea0"
152159
}
153-
}
160+
},
154161
...
155162
],
156163
```
@@ -171,36 +178,38 @@ field for every step.
171178

172179
```json
173180
"buildConfig": {
174-
"llbDefinition": [
175-
{
176-
"id": "step0",
177-
"op": {
178-
"Op": {
179-
"exec": {
180-
"meta": {
181-
"args": [
182-
"/bin/sh",
183-
"-c",
184-
"go build ."
185-
],
186-
"env": [
187-
"PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
188-
"GOPATH=/go",
189-
"GOFLAGS=-mod=vendor",
190-
],
191-
"cwd": "/src",
192-
},
193-
"mounts": [...]
194-
}
195-
},
196-
"platform": {...},
181+
"llbDefinition": [
182+
{
183+
"id": "step0",
184+
"op": {
185+
"Op": {
186+
"exec": {
187+
"meta": {
188+
"args": [
189+
"/bin/sh",
190+
"-c",
191+
"go build ."
192+
],
193+
"env": [
194+
"PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
195+
"GOPATH=/go",
196+
"GOFLAGS=-mod=vendor",
197+
],
198+
"cwd": "/src",
199+
},
200+
"mounts": [...]
201+
}
197202
},
198-
"inputs": [
199-
"step8:0",
200-
"step2:0",
201-
]
203+
"platform": {...},
202204
},
203-
...
205+
"inputs": [
206+
"step8:0",
207+
"step2:0",
208+
]
209+
},
210+
...
211+
]
212+
},
204213
```
205214

206215
## `metadata.buildInvocationId` [(SLSA)](https://slsa.dev/provenance/v0.2#metadata.buildIncocationId)
@@ -214,6 +223,8 @@ versions of the image.
214223
```json
215224
"metadata": {
216225
"buildInvocationID": "rpv7a389uzil5lqmrgwhijwjz",
226+
...
227+
},
217228
```
218229

219230
## `metadata.buildStartedOn` [(SLSA)](https://slsa.dev/provenance/v0.2#metadata.buildStartedOn)
@@ -223,7 +234,10 @@ Included with `mode=min` and `mode=max`.
223234
Timestamp when the build started.
224235

225236
```json
237+
"metadata": {
226238
"buildStartedOn": "2021-11-17T15:00:00Z",
239+
...
240+
},
227241
```
228242

229243
## `metadata.buildFinishedOn` [(SLSA)](https://slsa.dev/provenance/v0.2#metadata.buildFinishedOn)
@@ -233,7 +247,10 @@ Included with `mode=min` and `mode=max`.
233247
Timestamp when the build finished.
234248

235249
```json
250+
"metadata": {
236251
"buildFinishedOn": "2021-11-17T15:01:00Z",
252+
...
253+
},
237254
```
238255

239256
## `metadata.completeness` [(SLSA)](https://slsa.dev/provenance/v0.2#metadata.completeness)
@@ -257,12 +274,14 @@ repository all materials can be tracked by BuildKit and `completeness.materials`
257274
is true.
258275

259276
```json
277+
"metadata": {
260278
"completeness": {
261279
"parameters": true,
262280
"environment": true,
263281
"materials": true
264-
}
265-
}
282+
},
283+
...
284+
},
266285
```
267286

268287
## `metadata.reproducible` [(SLSA)](https://slsa.dev/provenance/v0.2#metadata.reproducible)
@@ -271,7 +290,10 @@ Defines if the build result is supposed to be byte-by-byte reproducible. This
271290
value can be set by the user with the `reproducible=true` attestation parameter.
272291

273292
```json
274-
"reproducible": false
293+
"metadata": {
294+
"reproducible": false,
295+
...
296+
},
275297
```
276298

277299
## `metadata.https://mobyproject.org/buildkit@v1#hermetic`
@@ -286,6 +308,7 @@ commands or disables network with `--network=none` flag.
286308
"metadata": {
287309
"https://mobyproject.org/buildkit@v1#hermetic": true,
288310
...
311+
},
289312
```
290313

291314
## `metadata.https://mobyproject.org/buildkit@v1#metadata`
@@ -295,6 +318,17 @@ Partially included with `mode=min`.
295318
This extension field defines BuildKit-specific additional metadata that is not
296319
part of the SLSA provenance spec.
297320

321+
```json
322+
"metadata": {
323+
"https://mobyproject.org/buildkit@v1#metadata": {
324+
"source": {...},
325+
"layers": {...},
326+
"vcs": {...},
327+
},
328+
...
329+
},
330+
```
331+
298332
### `source`
299333

300334
Only included with `mode=max`.

0 commit comments

Comments
 (0)