-
Notifications
You must be signed in to change notification settings - Fork 275
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
TAP 8 Implementation #2257
TAP 8 Implementation #2257
Conversation
Signed-off-by: Marina Moore <[email protected]>
Pull Request Test Coverage Report for Build 4028042547
💛 - Coveralls |
Signed-off-by: Marina Moore <[email protected]>
Missing features: * correct naming of rotate files * test fixes * rotation to null Included: * downloading of rotate files * checking rotate file inclusion in snapshot * changes to verification flow Signed-off-by: Marina Moore <[email protected]>
Add the new required fields to calls and the new downloads of rotate files to expected calls Signed-off-by: Marina Moore <[email protected]>
Signed-off-by: Marina Moore <[email protected]>
Signed-off-by: Marina Moore <[email protected]>
Signed-off-by: Marina Moore <[email protected]>
Signed-off-by: Marina Moore <[email protected]>
Signed-off-by: Marina Moore <[email protected]>
Signed-off-by: Marina Moore <[email protected]>
Signed-off-by: Marina Moore <[email protected]>
Signed-off-by: Marina Moore <[email protected]>
Adds rotate files to the repository simulator, and tests their basic use Signed-off-by: Marina Moore <[email protected]>
Signed-off-by: Marina Moore <[email protected]>
Signed-off-by: Marina Moore <[email protected]>
Signed-off-by: Marina Moore <[email protected]>
I've not reviewed properly but I'll write down some early high level worries:
|
👀 |
Thanks for taking a look!
Agreed, we'll want to be intentional about adding this. It might be as easy as a major version change to the code, or we might need a new major specification version.
It was easier to download rotate files at the same time as other metadata, then compare that list to the rotate files listed in snapshot in the next step (similar to the root update mechanism of trying to download the next root). I'll work on a way to check snapshot first so that if no rotate files are listed, we can skip the extra requests.
I'll want to think about this one. My current motivating example for this TAP mostly involves targets rotation (like for delegated targets in a PEP 480 style design), but there are other potential uses for rotating the snapshot/timestamp keys (so they can change more frequently). It'd be nice to have the same mechanism for both, but we'll want to make sure this doesn't mess up the security properties of snapshot.
I have a pr out to simplify the TAP. I based this pr on my revised design, but can update it based on any discussion in that thread. |
I get that but neither of those version numbers make sense within the snapshot metadata (which won't be valid at the time you are trying to use the rotate versions):
|
The version numbers of the rotate files don't relate to the version of the metadata, but are rather used to determine the order of the rotate files in the chain and use that to find the correct signing key(s) for a role. The snapshot validity is a bigger issue. If we skip the snapshot check for rotate files for the timestamp and snapshot roles, there's some chance that an attacker with mitm can block rotate files and convince a user to use the wrong key for these roles. I think this might be an acceptable tradeoff because (1) root retains the ability to revoke any key rotated with this mechanism, (2) all rotate files are signed, so the attacker would need mitm + a compromised key, and (3) these roles are less trusted that targets roles. I'll think about this some more and propose it over in the TAPs repo. |
[EDIT: I was confused, next paragraph does not make sense] I understand that. The point I'm trying to make is that pinning timestamp-rotate versions is not useful because an attacker with a timestamp signing key (the one defined in root metadata) can just create a new timestamp version. Because timestamp versions are not pinned, the new timestamp will always be used, and as a result the rotate file won't be used. I do not understand what timestamp-rotate files accomplish |
I'm not sure I understand the question. Here's how verification with this proposal would work (ignoring snapshot for now). The client verifies root metadata and gets the timestamp key. They then look for a 1.timestamp.rotate file, if present they verify it with the timestamp keys from root and switch to the keys listed in 1.timestamp.rotate (and so on for 2.timestamp.rotate, etc). Using the keys they end up with after checking rotations, they download the most recent timestamp and attempt to verify, following the existing procedure. So the rotation part happens before the latest timestamp is even downloaded. |
Uh you are right, my last comment doesn't make sense, sorry. The original point about the ordering still stands:
Snapshot can only be loaded with a valid timestamp... but verifying timestamp validity requires looking into the snapshot content. This feels a bit weird. |
I opened an issue to track this that lists a couple of potential solutions. I will update this pr and the TAP based on whatever is decided there. |
I'd like to close this, would that be ok? I understand that this is a POC for the TAP, but looking at it from python-tuf maintainer perspective this likely requires quite a bit of work still to be merged:
|
I'll close this since no comments: please reopen when you feel like it. |
This is some initial implementation work for the TAP per the most recent pr. My plan for this pr is to include:
cc @joshuagl who mentioned interest in collaborating on this