-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support rotate root manifests #967
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ti-chi-bot
added
the
do-not-merge/work-in-progress
Indicates that a PR should not merge because it is a work in progress.
label
Dec 3, 2020
ti-chi-bot
added
the
size/XL
Denotes a PR that changes 500-999 lines, ignoring generated files.
label
Dec 3, 2020
Codecov Report
@@ Coverage Diff @@
## master #967 +/- ##
==========================================
- Coverage 55.95% 51.69% -4.26%
==========================================
Files 263 264 +1
Lines 19645 19856 +211
==========================================
- Hits 10992 10265 -727
- Misses 6925 7956 +1031
+ Partials 1728 1635 -93
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
ti-chi-bot
removed
the
do-not-merge/work-in-progress
Indicates that a PR should not merge because it is a work in progress.
label
Dec 8, 2020
AstroProfundis
added
category/security
Categorizes issue or PR as a security enhancement.
type/new-feature
Categorizes pr as related to a new feature.
labels
Dec 9, 2020
AstroProfundis
approved these changes
Dec 9, 2020
lucklove
added a commit
to lucklove/tiup
that referenced
this pull request
Dec 16, 2020
Introduced by pingcap#967 The tiup mirror sign doesn't handle --key flag correctly for local manifest file
Merged
ti-chi-bot
added a commit
that referenced
this pull request
Dec 17, 2020
Introduced by #967 The tiup mirror sign doesn't handle --key flag correctly for local manifest file Co-authored-by: Ti Prow Robot <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
category/security
Categorizes issue or PR as a security enhancement.
size/XL
Denotes a PR that changes 500-999 lines, ignoring generated files.
status/LGT1
Indicates that a PR has LGTM 1.
type/new-feature
Categorizes pr as related to a new feature.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
In TiUP's repository, there is a root.json(the root manifest) file, which records the keys we used for the whole repository. It's the foundation of the trust chain. Related document of the manifest mechanism: https://github.com/pingcap/tiup/blob/master/doc/design/manifest.md
The root.json is signed by 5 different people (with 5 different keys) and it has an
expires
field, so the 5 people must re-sign the root.json before it reallyexpires
. We should do the follow things:Do these things manually will be boring and it's easy to make mistake (what if some one is publishing component to the repository while you modify timestamp.json and snapshot.json manually?). So we'd better make it automated, at least semi-automated.
What is changed and how it works?
tiup mirror sign
command, make it possible to sign the manifest via network bytiup mirror sign http:/xxx/yyy.json
, in a similar way as signing a manifest file in local filesystem.Rotate
method onMirror
interface, which will update snapshot.json and timestamp.json automatically according to the updated root.jsonBy this way, we can update the root.json with these steps:
tiup mirror rotate
and edit the root.json (update expires field .etc.), after saving the file, a server will be started, and the address to sign the manifest will be printed on the console.tiup mirror sign http://rotate-address
to sign the modified root.jsonBy this way, we can do things easier and avoid transfering private key via the internet (we should never do this)
Check List
Tests
The manual test steps:
In terminal 1:
tiup mirror init /tmp/test-mirror
tiup mirror set /tmp/test-mirror
tiup mirror rotate
: in the eidtor, increase the manifest version by one and save, this should start a serverIn terminal 2:
tiup mirror sign http://<my-ip>:8080/rotate/root.json --key /tmp/test-mirror/keys/<hash1>-root.json
tiup mirror sign http://<my-ip>:8080/rotate/root.json --key /tmp/test-mirror/keys/<hash2>-root.json
tiup mirror sign http://<my-ip>:8080/rotate/root.json --key /tmp/test-mirror/keys/<hash3>-root.json
After these steps, the server of terminal 1 will closed automatically and the
/tmp/test-mirror/2.root.json
should be produced.Code changes
Side effects
Related changes
Release notes: