Skip to content

Commit 591dd73

Browse files
Merge branch 'master' into ethan.lowman/sorted-signatures
2 parents 710115d + 1dc15a8 commit 591dd73

File tree

873 files changed

+43614
-803
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

873 files changed

+43614
-803
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gomod"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
open-pull-requests-limit: 10

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jobs:
44
test:
55
strategy:
66
matrix:
7-
go-version: [1.13.x, 1.14.x, 1.15.x]
7+
go-version: [1.15.x, 1.16.x, 1.17.x]
88
os: [ubuntu-latest, macos-latest]
99
runs-on: ${{ matrix.os }}
1010
steps:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
.DS_Store
2+
cmd/tuf/tuf
3+
cmd/tuf-client/tuf-client

README.md

Lines changed: 46 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ a framework for securing software update systems.
99

1010
A TUF repository has the following directory layout:
1111

12-
```
12+
```bash
1313
.
1414
├── keys
1515
├── repository
@@ -21,9 +21,9 @@ A TUF repository has the following directory layout:
2121
The directories contain the following files:
2222

2323
- `keys/` - signing keys (optionally encrypted) with filename pattern `ROLE.json`
24-
- `repository/` - signed manifests
24+
- `repository/` - signed metadata files
2525
- `repository/targets/` - hashed target files
26-
- `staged/` - either signed, unsigned or partially signed manifests
26+
- `staged/` - either signed, unsigned or partially signed metadata files
2727
- `staged/targets/` - unhashed target files
2828

2929
## CLI
@@ -32,7 +32,7 @@ The directories contain the following files:
3232

3333
### Install
3434

35-
```
35+
```bash
3636
go get github.com/theupdateframework/go-tuf/cmd/tuf
3737
```
3838

@@ -52,61 +52,76 @@ initialized to do so when generating keys.
5252
Prompts the user for an encryption passphrase (unless the
5353
`--insecure-plaintext` flag is set), then generates a new signing key and
5454
writes it to the relevant key file in the `keys` directory. It also stages
55-
the addition of the new key to the `root` manifest.
55+
the addition of the new key to the `root` metadata file. Alternatively, passphrases
56+
can be set via environment variables in the form of `TUF_{{ROLE}}_PASSPHRASE`
5657

57-
#### `tuf set-threshold <role> <threshold>`
58+
#### `tuf revoke-key [--expires=<days>] <role> <id>`
5859

59-
Sets the `role` threshold, the required number of keys for signing, to
60-
`threshold`.
60+
Revoke a signing key
61+
62+
The key will be removed from the root metadata file, but the key will remain in the
63+
"keys" directory if present.
6164

6265
#### `tuf add [<path>...]`
6366

6467
Hashes files in the `staged/targets` directory at the given path(s), then
65-
updates and stages the `targets` manifest. Specifying no paths hashes all
68+
updates and stages the `targets` metadata file. Specifying no paths hashes all
6669
files in the `staged/targets` directory.
6770

6871
#### `tuf remove [<path>...]`
6972

70-
Stages the removal of files with the given path(s) from the `targets` manifest
73+
Stages the removal of files with the given path(s) from the `targets` metadata file
7174
(they get removed from the filesystem when the change is committed). Specifying
72-
no paths removes all files from the `targets` manifest.
75+
no paths removes all files from the `targets` metadata file.
7376

7477
#### `tuf snapshot [--expires=<days>]`
7578

76-
Expects a staged, fully signed `targets` manifest and stages an appropriate
77-
`snapshot` manifest. Optionally one can set number of days after which
78-
the snapshot manifest will expire.
79+
Expects a staged, fully signed `targets` metadata file and stages an appropriate
80+
`snapshot` metadata file. Optionally one can set number of days after which
81+
the `snapshot` metadata will expire.
7982

8083
#### `tuf timestamp`
8184

82-
Stages an appropriate `timestamp` manifest. If a `snapshot` manifest is staged,
85+
Stages an appropriate `timestamp` metadata file. If a `snapshot` metadata file is staged,
8386
it must be fully signed.
8487

85-
#### `tuf sign ROLE`
88+
#### `tuf sign <metadata>`
8689

87-
Signs the given role's staged manifest with all keys present in the `keys`
90+
Signs the given role's staged metadata file with all keys present in the `keys`
8891
directory for that role.
8992

9093
#### `tuf commit`
9194

9295
Verifies that all staged changes contain the correct information and are signed
9396
to the correct threshold, then moves the staged files into the `repository`
9497
directory. It also removes any target files which are not in the `targets`
95-
manifest.
98+
metadata file.
9699

97100
#### `tuf regenerate [--consistent-snapshot=false]`
98101

99-
Recreates the `targets` manifest based on the files in `repository/targets`.
102+
Note: Not supported yet
103+
104+
Recreates the `targets` metadata file based on the files in `repository/targets`.
100105

101106
#### `tuf clean`
102107

103-
Removes all staged manifests and targets.
108+
Removes all staged metadata files and targets.
104109

105110
#### `tuf root-keys`
106111

107112
Outputs a JSON serialized array of root keys to STDOUT. The resulting JSON
108113
should be distributed to clients for performing initial updates.
109114

115+
#### `tuf set-threshold <role> <threshold>`
116+
117+
Sets the `role` threshold, the required number of keys for signing, to
118+
`threshold`.
119+
120+
#### Usage of environment variables
121+
122+
The `tuf` CLI supports receiving passphrases via environment variables in
123+
the form of `TUF_{{ROLE}}_PASSPHRASE`
124+
110125
For a list of supported commands, run `tuf help` from the command line.
111126

112127
### Examples
@@ -122,11 +137,11 @@ staged changes and signing on each machine in turn before finally committing.
122137

123138
Some key IDs are truncated for illustrative purposes.
124139

125-
#### Create signed root manifest
140+
#### Create signed root metadata file
126141

127142
Generate a root key on the root box:
128143

129-
```
144+
```bash
130145
$ tuf gen-key root
131146
Enter root keys passphrase:
132147
Repeat root keys passphrase:
@@ -145,7 +160,7 @@ $ tree .
145160
Copy `staged/root.json` from the root box to the repo box and generate targets,
146161
snapshot and timestamp keys:
147162

148-
```
163+
```bash
149164
$ tree .
150165
.
151166
├── keys
@@ -183,7 +198,7 @@ $ tree .
183198

184199
Copy `staged/root.json` from the repo box back to the root box and sign it:
185200

186-
```
201+
```bash
187202
$ tree .
188203
.
189204
├── keys
@@ -198,14 +213,14 @@ Enter root keys passphrase:
198213
```
199214

200215
The staged `root.json` can now be copied back to the repo box ready to be
201-
committed alongside other manifests.
216+
committed alongside other metadata files.
202217

203218
#### Add a target file
204219

205-
Assuming a staged, signed `root` manifest and the file to add exists at
220+
Assuming a staged, signed `root` metadata file and the file to add exists at
206221
`staged/targets/foo/bar/baz.txt`:
207222

208-
```
223+
```bash
209224
$ tree .
210225
.
211226
├── keys
@@ -285,7 +300,7 @@ $ tree .
285300

286301
Assuming the file to remove is at `repository/targets/foo/bar/baz.txt`:
287302

288-
```
303+
```bash
289304
$ tree .
290305
.
291306
├── keys
@@ -366,9 +381,9 @@ $ tree .
366381
└── staged
367382
```
368383

369-
#### Regenerate manifests based on targets tree
384+
#### Regenerate metadata files based on targets tree (Note: Not supported yet)
370385

371-
```
386+
```bash
372387
$ tree .
373388
.
374389
├── keys
@@ -455,7 +470,7 @@ $ tree .
455470

456471
#### Update timestamp.json
457472

458-
```
473+
```bash
459474
$ tree .
460475
.
461476
├── keys

0 commit comments

Comments
 (0)