You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ curl -L https://XXX | preflight run sha256=1ce...2244a6e86
50
50
⌛️ Preflight starting
51
51
❌ Preflight failed:
52
-
Digest does not match.
53
-
Expected: <...>
54
-
Actual: <...>
52
+
Digest does not match.
53
+
54
+
Expected:
55
+
<...>
56
+
57
+
Actual:
58
+
<...>
55
59
56
60
Information:
57
61
It is recommended to inspect the modified file contents.
@@ -117,6 +121,35 @@ steps:
117
121
```
118
122
119
123
----
124
+
125
+
## :bulb: Dealing with changing runnables & auto updates
126
+
127
+
When updating an old binary or script to a new updated version, there will be at least two (2) valid digests "live" and just replacing the single digest used will fail for the older runnable which may still be running somewhere.
To support updates and rolling/auto updates of scripts and binaries we basically need to validate against `<old hash>` + `<new hash>` at all times, until everyone upgrades to the new script. Preflight validates against a `list of hashes` or better, give it a _live_ URL of `valid hashes` and it will validate against it.
134
+
135
+
136
+
```
137
+
curl .. | ./ci/preflight run sha256=d6aa3207c4908d123bd8af62ec0538e3f2b9f257c3de62fad4e29cd3b59b41d9,sha256=<new hash>,...
138
+
```
139
+
140
+
Or to a live URL:
141
+
```
142
+
curl .. | ./ci/preflight run https://dl.example.com/hashes.txt
143
+
```
144
+
145
+
146
+
Use this when:
147
+
148
+
* Use multiple digests verbatim, when your runnables change often, but not too often
149
+
* Use a URL when your runnables change often. Remember to follow the chain of trust. This will now mean that:
150
+
* Your hash list URL is now a source of trust
151
+
* Visually: we're swapping the chain of trust like so `curl <foreign trust> | ./ci/preflight <own trust>`
Copy file name to clipboardExpand all lines: main.go
+27-12Lines changed: 27 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -12,12 +12,12 @@ import (
12
12
13
13
varCLIstruct {
14
14
Runstruct {
15
-
Hashstring`arg name:"hash" help:"Hash to verify. Format: sha256=<hash>"`
15
+
Hashstring`arg name:"hash|url" help:"Hash to verify. You can provide a list seperated by a comma (,) and no space. Format: sha256=<hash>[,sha256=<hash2>,...], Or a URL to a flat file to fetch with a list of hashes, one per line. Format: https://example.com/file.txt"`
16
16
Cmd []string`arg optional name:"cmd" help:"Command to execute"`
17
17
} `cmd help:"Verify and run a command"`
18
18
19
19
Checkstruct {
20
-
Hashstring`arg name:"hash" help:"Hash to verify. Format: sha256=<hash>"`
20
+
Hashstring`arg name:"hash|url" help:"Hash to verify. You can provide a list seperated by a comma (,) and no space. Format: sha256=<hash>[,sha256=<hash2>,...], Or a URL to a flat file to fetch with a list of hashes, one per line. Format: https://example.com/file.txt"`
21
21
Cmd []string`arg optional name:"cmd" help:"Command to execute"`
0 commit comments