Skip to content

Repository tools #170

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

Merged
merged 213 commits into from
Mar 6, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
213 commits
Select commit Hold shift + click to select a range
eecdca2
Merge branch 'develop' of https://github.com/theupdateframework/tuf i…
vladimir-v-diaz Sep 19, 2013
100e831
Merge and resolve conflicts
vladimir-v-diaz Oct 2, 2013
5622e0c
Commence configurable crypto changes
vladimir-v-diaz Oct 8, 2013
4c866bc
Continue configurable crypto design changes
vladimir-v-diaz Oct 8, 2013
a395607
Add updated schema description of new schema in formats.py
vladimir-v-diaz Oct 8, 2013
d0c5b71
Support adding any key type in keydb.py
vladimir-v-diaz Oct 8, 2013
28b3b52
Modify updater.py to support multiple key types
vladimir-v-diaz Oct 8, 2013
372908c
Modify signerlib.py to support multiple key types
vladimir-v-diaz Oct 8, 2013
46d07be
Continue configurable crypto changes: add keys.py doctest
vladimir-v-diaz Oct 9, 2013
115d844
Fix import, doctests, and function parameters in keys.py
vladimir-v-diaz Oct 9, 2013
cc87d4f
Add missing doctests to keys.py and pycrypto_keys.py
vladimir-v-diaz Oct 9, 2013
37b665b
Modify behavior of configurable crypto and update conf.py
vladimir-v-diaz Oct 9, 2013
3bbacd0
Fix docstring whitespace in formats.py
vladimir-v-diaz Oct 9, 2013
31d603c
Update all unit tests affected by configurable crypto
vladimir-v-diaz Oct 10, 2013
ae2e748
Add new keytype schema in formats.py
vladimir-v-diaz Oct 10, 2013
a091b1f
Add test_keys.py and update keys.py
vladimir-v-diaz Oct 10, 2013
ac6dade
Move test cases to test_pycrypto_keys.py
vladimir-v-diaz Oct 10, 2013
8d33d72
Update object schema names in formats.py
vladimir-v-diaz Oct 11, 2013
2f61272
Update test cases moved over to test_pycrypto_keys.py
vladimir-v-diaz Oct 11, 2013
81a1514
Add remaining test cases in test_pycrypto_keys.py
vladimir-v-diaz Oct 11, 2013
8372100
Add a LengthString schema type to schema.py
vladimir-v-diaz Oct 11, 2013
b831016
Add ed25519 schemas to formats.py
vladimir-v-diaz Oct 11, 2013
f76dfd4
Validate arguments and update doctests in ed2519_keys.py
vladimir-v-diaz Oct 11, 2013
7e948f3
Add initial test_ed25519_keys.py
vladimir-v-diaz Oct 11, 2013
7e59396
Complete test_verify_signature() in test_ed25519_keys.py
vladimir-v-diaz Oct 14, 2013
2244b6c
Merge changes following Monzur's review of ed25519_key.py
vladimir-v-diaz Oct 16, 2013
42ea506
Update time_ed25519.py following configurable crypto changes
vladimir-v-diaz Oct 16, 2013
7ae7f2d
Add new tuf.formats.py schema for pycrypto_keys.py
vladimir-v-diaz Oct 17, 2013
8a7d0d4
Update docstrings and comments in pycrypto_keys.py
vladimir-v-diaz Oct 17, 2013
05f7826
Update test_pycrypto_keys.py after pycrypto_keys.py changes
vladimir-v-diaz Oct 17, 2013
6057450
Update keys.py with modified pycrypto_keys.py function names
vladimir-v-diaz Oct 17, 2013
760cd62
Rename functions in keys.py and update test_keys.py
vladimir-v-diaz Oct 17, 2013
45af911
Update docstrings and comments in keys.py
vladimir-v-diaz Oct 18, 2013
5eb0858
Add import and export functions for passphrase-protected pem files in…
vladimir-v-diaz Oct 22, 2013
df8d84d
[WIP] Add libtuftools.py skeleton
vladimir-v-diaz Oct 22, 2013
b4db0f1
[WIP] Continue libtuf.py implementation
vladimir-v-diaz Oct 29, 2013
298dc46
Remove roleinfo+Metadata.keys side effect
vladimir-v-diaz Oct 30, 2013
4bd0b6d
Continue delegate() changes
vladimir-v-diaz Nov 5, 2013
01deddf
Initial implementation of the repository tools.
vladimir-v-diaz Nov 12, 2013
d6b9e18
Fix repository.targets.revoke()
vladimir-v-diaz Nov 12, 2013
973ed15
Added base markdown file
Nov 12, 2013
7049c73
Added the first code block for RSA key creation
Nov 12, 2013
ab09a28
Update README.md
SantiagoTorres Nov 12, 2013
45c7ac3
Added the import key codeblock
Nov 12, 2013
a20dd92
Merge branch 'repository-tools' of github.com:SantiagoTorres/tuf into…
Nov 12, 2013
8ab4f9c
Added the root metadata codeblock
Nov 12, 2013
0cc8841
Added the targets,root and timestamp metadata codeblock
Nov 12, 2013
7aeeeb8
added the "add target" codeblock/section
Nov 12, 2013
363d170
Added the "remove targets" section and codeblock
Nov 12, 2013
21d245b
added the "create a delegated role" codeblock
Nov 12, 2013
dedf18d
Added the "Revoke Delegated Role" codeblock/section
Nov 12, 2013
bab3e5c
Added the diagram in the beginning
Nov 12, 2013
306769d
Update README.md
SantiagoTorres Nov 12, 2013
788f2ed
Added the client-side codeblocks and section
Nov 13, 2013
00e9e3a
Merge branch 'repository-tools' of github.com:SantiagoTorres/tuf into…
Nov 13, 2013
4f990f3
Merge pull request #134 from SantiagoTorres/repository-tools
Dachshund Nov 13, 2013
f490e68
Add the bundled cryptographic library bindings.
trishankkarthik Nov 13, 2013
cbca428
Merge remote-tracking branch 'origin/repository-tools' into repositor…
trishankkarthik Nov 13, 2013
6c376a3
Update README.md with correct import statements
Dachshund Nov 13, 2013
52e879e
Merge branch 'repository-tools' of https://github.com/theupdateframew…
vladimir-v-diaz Nov 13, 2013
cff05ad
Update README.md
vladimir-v-diaz Nov 13, 2013
8b16b00
Update README.md
vladimir-v-diaz Nov 13, 2013
6bcaee3
Update README.md
vladimir-v-diaz Nov 13, 2013
fff486d
Update README.md
vladimir-v-diaz Nov 13, 2013
19c659f
Update README.md
vladimir-v-diaz Nov 13, 2013
8520c49
Update README.md
vladimir-v-diaz Nov 13, 2013
86e8f0b
Switch default ed25519 cryptography library to 'ed25519'
vladimir-v-diaz Nov 13, 2013
4a12474
Merge branch 'repository-tools' of https://github.com/theupdateframew…
vladimir-v-diaz Nov 13, 2013
b2e9fca
Remove evpy.
trishankkarthik Nov 13, 2013
c860d27
Add 'tuf/client/basic_client.py' to setup.py
vladimir-v-diaz Nov 13, 2013
691081c
Merge branch 'repository-tools' of https://github.com/theupdateframew…
vladimir-v-diaz Nov 13, 2013
6cc0b90
Remove invalid signatures from signables prior to final repository.wr…
vladimir-v-diaz Nov 13, 2013
9acebfa
Update README.md
vladimir-v-diaz Nov 13, 2013
85d2b7f
Add updates and features following review
vladimir-v-diaz Nov 14, 2013
ba69b23
Merge branch 'repository-tools' of https://github.com/theupdateframew…
vladimir-v-diaz Nov 14, 2013
d2d6794
Support compressed metadata for all role types and minor edits
vladimir-v-diaz Nov 15, 2013
f1d72f0
Update README.md
vladimir-v-diaz Nov 15, 2013
3ca6261
Merge and resolve conflicts
Nov 15, 2013
49e7db2
Update README.md
vladimir-v-diaz Nov 15, 2013
9f75253
Add libtuf-diagram.png
vladimir-v-diaz Nov 15, 2013
6073cb5
Merge branch 'repository-tools' of https://github.com/theupdateframew…
vladimir-v-diaz Nov 15, 2013
12982a2
Update README.md
vladimir-v-diaz Nov 15, 2013
ff821e2
Update README.md
vladimir-v-diaz Nov 16, 2013
eb7f8a5
Update old repository tools affected by renamed function
vladimir-v-diaz Nov 16, 2013
da767a4
Merge branch 'repository-tools' of https://github.com/theupdateframew…
vladimir-v-diaz Nov 16, 2013
b6804d2
Update README.md
vladimir-v-diaz Nov 17, 2013
d142cb8
Update README.md
vladimir-v-diaz Nov 19, 2013
e437dba
Update comments & docstrings, fix bug, and address issues #135 and #138
vladimir-v-diaz Nov 22, 2013
008315c
Merge branch 'repository-tools' of https://github.com/theupdateframew…
vladimir-v-diaz Nov 22, 2013
e8f8fe4
Update README.md
vladimir-v-diaz Nov 22, 2013
ce31e93
Remove test print statements and fix bugs reported by Lai
vladimir-v-diaz Nov 25, 2013
2b5c83b
Fix typo
vladimir-v-diaz Nov 25, 2013
3459b6b
Add clear_targets() method to Targets
vladimir-v-diaz Nov 25, 2013
a76a247
Refactor Repository.write(), and write_delegated_metadata()
vladimir-v-diaz Nov 25, 2013
46a3b9b
Resolve merge conflict
vladimir-v-diaz Nov 25, 2013
191f32a
Continue refactor of libtuf.py
vladimir-v-diaz Nov 25, 2013
21e9291
Implement enhancement outlined in issue #136
vladimir-v-diaz Nov 26, 2013
8d34b7a
Continue updating the comments and docstrings of libtuf.py
vladimir-v-diaz Nov 26, 2013
c58906f
Fix for issue #153
vladimir-v-diaz Nov 27, 2013
738fa4d
Remove test import statement changes from previous commit
vladimir-v-diaz Nov 27, 2013
6de2fdc
Initial re-implementation of compressed metadata verification in upda…
vladimir-v-diaz Dec 4, 2013
8fdf029
Fix for issue #148
vladimir-v-diaz Dec 5, 2013
68eedeb
Initial commit for Issue #143 and #144
vladimir-v-diaz Dec 9, 2013
56bdd48
Add comments and re-add ed25519 to conf.py
vladimir-v-diaz Dec 9, 2013
79c0c5d
Re-add generate_rsa_encrypted_pem
vladimir-v-diaz Dec 9, 2013
7a08bad
Continue documentation effort and fix outdated libtuf.py
vladimir-v-diaz Dec 11, 2013
8b7745c
Add final comment+docstring updates to keys.py
vladimir-v-diaz Dec 12, 2013
d275432
Update libtuf.py documentation and address issues #143 and #144
vladimir-v-diaz Dec 16, 2013
ae55f0a
Add initial tuf.client.updater.py README documentation
vladimir-v-diaz Dec 16, 2013
18ce211
Update README.md
vladimir-v-diaz Dec 16, 2013
bf1c319
Update README.md
vladimir-v-diaz Dec 16, 2013
026daac
Update README.md
vladimir-v-diaz Dec 16, 2013
ac2192f
Update README.md
vladimir-v-diaz Dec 16, 2013
d22c48f
Add missing docstring to updater.py
vladimir-v-diaz Dec 16, 2013
182368e
Update README.md
vladimir-v-diaz Dec 16, 2013
8199033
Merge branch 'repository-tools' of https://github.com/theupdateframew…
vladimir-v-diaz Dec 16, 2013
5c614f3
Add create_new_repository() docstring in libtuf.py
vladimir-v-diaz Dec 16, 2013
45c65c9
Merge branch 'develop' into repository-tools
vladimir-v-diaz Dec 16, 2013
d3abb07
Update formats.py readability
vladimir-v-diaz Dec 16, 2013
d07d0b2
Fix typo
vladimir-v-diaz Dec 16, 2013
4aee4bf
Continue documentation updates to libtuf.py
vladimir-v-diaz Dec 17, 2013
03dcb3f
Update the Targets methods in libtuf.py
vladimir-v-diaz Dec 18, 2013
89dbd38
Initial metadata and security documentation
vladimir-v-diaz Dec 18, 2013
ec550ff
Update README.md
vladimir-v-diaz Dec 18, 2013
52e9e08
Move documentation to root directory
vladimir-v-diaz Dec 18, 2013
b64a905
Merge branch 'repository-tools' of https://github.com/theupdateframew…
vladimir-v-diaz Dec 18, 2013
ee2ce4c
Update SECURITY.md
vladimir-v-diaz Dec 18, 2013
ba2a5db
Update SECURITY.md
vladimir-v-diaz Dec 18, 2013
4e8f5b1
Update SECURITY.md
vladimir-v-diaz Dec 18, 2013
47c4364
Update METADATA.md
vladimir-v-diaz Dec 18, 2013
6c7a758
Update README.md
vladimir-v-diaz Dec 18, 2013
4647d4a
Address Issue #120
vladimir-v-diaz Dec 18, 2013
246d2e7
Merge branch 'repository-tools' of https://github.com/theupdateframew…
vladimir-v-diaz Dec 18, 2013
1a1f9ce
Update README.md
vladimir-v-diaz Dec 18, 2013
6cb230a
Add whitespace to log messages and update the top-level role objects …
vladimir-v-diaz Dec 19, 2013
ba28237
Merge branch 'repository-tools' of https://github.com/theupdateframew…
vladimir-v-diaz Dec 19, 2013
8a805bd
Fix pycrypto_keys.py header block, libtuf.py doc update, and minor fo…
vladimir-v-diaz Dec 20, 2013
4833898
Vendor ed25519 and address Issue #122
vladimir-v-diaz Dec 20, 2013
2a61a80
Update modules affected by the vendored ed25519 and update libtuf.py
vladimir-v-diaz Dec 20, 2013
0548eda
Address Issue #147 in libtuf.py
vladimir-v-diaz Dec 20, 2013
f866da7
Address Issues #165, #158, and #147.
vladimir-v-diaz Jan 2, 2014
d5ca811
Update libtuf-diagram.
vladimir-v-diaz Jan 2, 2014
5a7c8f3
Update README.md
vladimir-v-diaz Jan 2, 2014
b5c640c
Minor edits to previous commit.
vladimir-v-diaz Jan 4, 2014
a9b27fc
Merge branch 'repository-tools' of https://github.com/theupdateframew…
vladimir-v-diaz Jan 4, 2014
a2db039
Update conf.py header and comments
vladimir-v-diaz Jan 4, 2014
c39abf9
Update, test, and complete Issue #100 target methods.
vladimir-v-diaz Jan 5, 2014
bdef375
Update README.md
vladimir-v-diaz Jan 5, 2014
0399e5a
Update tuf-spec.txt
vladimir-v-diaz Jan 6, 2014
4d92ea6
Update README.md
vladimir-v-diaz Jan 6, 2014
cbf85fb
Update README.md
vladimir-v-diaz Jan 6, 2014
b73393c
Resolve issues #149 and #155.
vladimir-v-diaz Jan 9, 2014
32d4ae0
Merge branch 'repository-tools' of https://github.com/theupdateframew…
vladimir-v-diaz Jan 9, 2014
1e69c95
Remove linked+outdated client and server specs
vladimir-v-diaz Jan 9, 2014
780480a
Update README.md
vladimir-v-diaz Jan 9, 2014
cd60d6d
Address issue #164.
vladimir-v-diaz Jan 9, 2014
08c8f04
Merge branch 'repository-tools' of https://github.com/theupdateframew…
vladimir-v-diaz Jan 9, 2014
08f894f
Update README.md
vladimir-v-diaz Jan 9, 2014
04221d3
Address issue #163.
vladimir-v-diaz Jan 13, 2014
85a120f
Initial implementation of Issue #151.
vladimir-v-diaz Jan 14, 2014
a9d90e7
Finish initial implementation of Issue #151 and reading consistent sn…
vladimir-v-diaz Jan 17, 2014
b2e220f
Fix Issue #167.
vladimir-v-diaz Jan 18, 2014
98cb212
Update README.md
vladimir-v-diaz Jan 18, 2014
fbd7b14
Address Issues #151 and #156.
vladimir-v-diaz Jan 18, 2014
52fdb2e
Adjust logger level for compressed and uncompressed metadata.
vladimir-v-diaz Jan 19, 2014
5d1906a
Update issues #151 and #137.
vladimir-v-diaz Jan 21, 2014
96f6152
Update issue #137.
vladimir-v-diaz Jan 22, 2014
973d3a2
Address Issue #137 and update repository_tool.py.
vladimir-v-diaz Jan 23, 2014
5706408
Update repository tool diagram and README.
vladimir-v-diaz Jan 23, 2014
ffa4bbe
Update README.md
vladimir-v-diaz Jan 23, 2014
761c83f
Remove outdated module name from repository_tool.py diagram.
vladimir-v-diaz Jan 24, 2014
7f8a7e7
Refactor and fix status() in repository_tool.py.
vladimir-v-diaz Jan 24, 2014
298f52d
Modify format of paths in metadata and minor fixes.
vladimir-v-diaz Jan 25, 2014
8712099
Verify delegated target paths in repository_tool.py.
vladimir-v-diaz Jan 27, 2014
2c55b94
Modify the extension of rolename files.
vladimir-v-diaz Jan 27, 2014
7b53581
Update README.md
vladimir-v-diaz Jan 27, 2014
3b5e0c0
Merge 'develop' and resolve conflicts.
vladimir-v-diaz Jan 27, 2014
aacf741
Merge branch 'repository-tools' of https://github.com/theupdateframew…
vladimir-v-diaz Jan 27, 2014
009ddd9
Rename top-level role and functions of repository_tool.py. Update do…
vladimir-v-diaz Jan 29, 2014
36b59f9
Continue updating unit tests and modify ROOT_SCHEMA.
vladimir-v-diaz Jan 30, 2014
7b27fce
Continue unit test updates.
vladimir-v-diaz Jan 30, 2014
a220996
Resolve remaining unit test failures.
vladimir-v-diaz Jan 31, 2014
e92cf75
Update METADATA.md.
vladimir-v-diaz Feb 3, 2014
75c7ea5
Update test_extraneous_dependencies_attack.py.
vladimir-v-diaz Feb 3, 2014
0e100a9
Update README.md.
vladimir-v-diaz Feb 4, 2014
b84225f
Add disclaimer for deprecated latex documents.
vladimir-v-diaz Feb 4, 2014
57e42f0
Fix updater.py typo.
vladimir-v-diaz Feb 5, 2014
cdaacb9
Update tuf-spec.txt.
vladimir-v-diaz Feb 8, 2014
9078814
Update repository_tool.py.
vladimir-v-diaz Feb 13, 2014
a357859
Update repository_tool.py.
vladimir-v-diaz Feb 13, 2014
a6c3b44
Update tuf-spec.txt
vladimir-v-diaz Feb 13, 2014
00c6911
Implement key format requested in issue #171.
vladimir-v-diaz Feb 13, 2014
637d7af
Merge branch 'repository-tools' of https://github.com/theupdateframew…
vladimir-v-diaz Feb 13, 2014
636dfef
Update repository_tool.py.
vladimir-v-diaz Feb 13, 2014
3e9ac96
Update README.md
vladimir-v-diaz Feb 13, 2014
73adff9
Update format_rsakey_from_pem() in keys.py.
vladimir-v-diaz Feb 19, 2014
b22b769
Merge branch 'repository-tools' of https://github.com/theupdateframew…
vladimir-v-diaz Feb 19, 2014
77dfbc3
Raise exception if key not found in the key-removal methods.
vladimir-v-diaz Feb 21, 2014
643ab34
Update README.md
vladimir-v-diaz Feb 24, 2014
08c41bd
Update README.md
vladimir-v-diaz Feb 24, 2014
512d24d
Modify load_signing_key() exception message.
vladimir-v-diaz Feb 24, 2014
a73dbaa
Merge branch 'repository-tools' of https://github.com/theupdateframew…
vladimir-v-diaz Feb 24, 2014
511382b
Update README.md
vladimir-v-diaz Feb 24, 2014
6207d62
Update repository_tool.py.
vladimir-v-diaz Feb 25, 2014
595b6ae
Merge branch 'repository-tools' of https://github.com/theupdateframew…
vladimir-v-diaz Feb 25, 2014
784b3bc
Update modules reviewed by Monzur.
vladimir-v-diaz Feb 26, 2014
22aeff2
Update README.md
vladimir-v-diaz Feb 26, 2014
416d39b
Update tuf-spec.txt
vladimir-v-diaz Feb 26, 2014
1a17ac9
Update repository_tool.py and util.py.
vladimir-v-diaz Mar 3, 2014
b30e43c
Merge branch 'repository-tools' of https://github.com/theupdateframew…
vladimir-v-diaz Mar 3, 2014
c1f9c86
Log warning messages when sharing keys.
vladimir-v-diaz Mar 5, 2014
d92b78b
Update tuf-spec.txt
vladimir-v-diaz Mar 5, 2014
e9da583
Update repository_tool-diagram.png and comments.
vladimir-v-diaz Mar 6, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions METADATA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Metadata

Metadata files provide information that clients can use to make update decisions. Different metadata files provide different information. The various metadata files are signed by different roles. The concept of roles allows TUF to only trust information that a role is trusted to provide.

The signed metadata files always include the time they were created and their expiration dates. This ensures that outdated metadata will be detected and that clients can refuse to accept metadata older than that which they've already seen.

All TUF metadata uses a subset of the JSON object format. When calculating the digest of an object, we use the [Canonical JSON](http://wiki.laptop.org/go/Canonical_JSON) format. Implementation-level detail about the metadata can be found in the [spec](docs/tuf-spec.txt).

There are four required top-level roles and one optional top-level role, each with their own metadata file.

Required:

* Root
* Targets
* Snapshot
* Timestamp

Optional:

* Mirrors

There may also be any number of delegated target roles.

## Root Metadata (root.json)

Signed by: Root role.

Specifies the other top-level roles. When specifying these roles, the trusted keys for each role are listed along with the minimum number of those keys which are required to sign the role's metadata. We call this number the signature threshold.

Note: Metadata content and name out-of-date.
See [example](http://mirror1.poly.edu/test-pypi/metadata/root.txt).

## Targets Metadata (targets.json)

Signed by: Targets role.

The targets.json metadata file lists hashes and sizes of target files. Target files are the actual files that clients are intending to download (for example, the software updates they are trying to obtain).

This file can optionally define other roles to which it delegates trust. Delegating trust means that the delegated role is trusted for some or all of the target files available from the repository. When delegated roles are specified, they are specified in a similar way to how the Root role specifies the top-level roles: the trusted keys and signature threshold for each role is given. Additionally, one or more patterns are specified which indicate the target file paths for which clients should trust each delegated role.

Note: Metadata content and name out-of-date.
See [example](http://mirror1.poly.edu/test-pypi/metadata/targets.txt).

## Delegated Targets Metadata (targets/foo.json)

Signed by: A delegated targets role.

The metadata files provided by delegated targets roles follow exactly the same format as the metadata file provided by the top-level Targets role.

The location of the metadata file for each delegated target role is based on the delegation ancestry of the role. If the top-level Targets role defines a role named foo, then the delegated target role's full name would be targets/foo and its metadata file will be available on the repository at the path targets/foo.json (this is relative to the base directory from which all metadata is available). This path is just the full name of the role followed by a file extension.

If this delegated role foo further delegates to a role bar, then the result is a role whose full name is targets/foo/bar and whose signed metadata file is made available on the repository at targets/foo/bar.json.

Note: Metadata content and name out-of-date.
See [example](http://mirror1.poly.edu/test-pypi/metadata/targets/unclaimed.txt).

## snapshot Metadata (snapshot.json)

Signed by: Snapshot role.

The snapshot.json metadata file lists hashes and sizes of all metadata files other than timestamp.json. This file ensures that clients will see a consistent view of the files on the repository. That is, metadata files (and thus target file) that existed on the repository at different times cannot be combined and presented to clients by an attacker.

Note: Metadata content and name out-of-date.
​See [example](http://mirror1.poly.edu/test-pypi/metadata/release.txt).

## Timestamp Metadata (timestamp.json)

Signed by: Timestamp role.

The timestamp.json metadata file lists the hashes and size of the snapshot.json file. This is the first and potentially only file that needs to be downloaded when clients poll for the existence of updates. This file is frequently resigned and has a short expiration date, thus allowing clients to quickly detect if they are being prevented from obtaining the most recent metadata. An online key is generally used to automatically resign this file at regular intervals.

There are two primary reasons why the timestamp.json file doesn't contain all of the information that the snapshot.json file does.

* The timestamp.json file is downloaded very frequently and so should be kept as small as possible, especially considering that the snapshot.json file grows in size in proportion to the number of delegated target roles.
* As the Timestamp role's key is an online key and thus at high risk, separate keys should be used for signing the snapshot.json metadata file so that the Snapshot role's keys can be kept offline and thus more secure.

Note: Metadata content and name out-of-date.
See [example](http://mirror1.poly.edu/test-pypi/metadata/timestamp.txt).

## Mirrors Metadata (mirrors.json)

Optionally signed by: Mirrors role.

The mirrors.json file provides an optional way to provide mirror list updates to TUF clients. Mirror lists can alternatively be provided directly by the software update system and obtained in any way the system sees fit, including being hard coded if that is what an applications wants to do.

No example available. At the time of writing, this hasn't been implemented in TUF. Currently mirrors are specified by the client code.
62 changes: 58 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ completely new software.

Three major classes of software update systems are:

* **Application updaters** which are used by applications use to update
themselves. For example, Firefox updates itself through its own application
updater.
* **Application updaters** which are used by applications to update themselves.
For example, Firefox updates itself through its own application updater.

* **Library package managers** such as those offered by many programming
languages for installing additional libraries. These are systems such as
Expand All @@ -30,8 +29,63 @@ YaST are examples of these.
## Our Approach

There are literally thousands of different software update systems in common
use today. (In fact the average Windows user has about two dozen different
use today. (In fact the average Windows user has about [two dozen](http://secunia.com/gfx/pdf/Secunia_RSA_Software_Portfolio_Security_Exposure.pdf) different
software updaters on their machine!)

We are building a library that can be universally (and in most cases
transparently) used to secure software update systems.

## Overview

At the highest level, TUF simply provides applications with a secure method of obtaining files and knowing when new versions of files are available. We call these files, the ones that are supposed to be downloaded, "target files". The most common need for these abilities is in software update systems and that's what we had in mind when creating TUF.

On the surface, this all sounds simple. Securely obtaining updates just means:

* Knowing when an update exists.
* Downloading the updated file.

The problem is that this is only simple when there are no malicious parties involved. If an attacker is trying to interfere with these seemingly simple steps, there is plenty they can do.

## Background

Let's assume you take the approach that most systems do (at least, the ones that even try to be secure). You download both the file you want and a cryptographic signature of the file. You already know which key you trust to make the signature. You check that the signature is correct and was made by this trusted key. All seems well, right? Wrong. You are still at risk in many ways, including:

* An attacker keeps giving you the same file, so you never realize there is an update.
* An attacker gives you an older, insecure version of a file that you already have, so you download that one and blindly use it thinking it's newer.
* An attacker gives you a newer version of a file you have but it's not the newest one. It's newer to you, but it may be insecure and exploitable by the attacker.
* An attacker compromises the key used to sign these files and now you download a malicious file that is properly signed.

These are just some of the attacks software update systems are vulnerable to when only using signed files.
See [Security](SECURITY.md) for a full list of attacks and updater weaknesses TUF is designed to prevent.

The following papers provide detailed information on securing software updater systems, TUF's design and implementation details, attacks on package managers, and package management security:

* [Survivable Key Compromise in Software Update Systems](docs/papers/survivable-key-compromise-ccs2010.pdf?raw=true)

* [A Look In the Mirror: Attacks on Package Managers](docs/papers/package-management-security-tr08-02.pdf?raw=true)

* [Package Management Security](docs/papers/attacks-on-package-managers-ccs2008.pdf?raw=true)


##What TUF Does

In order to securely download and verify target files, TUF requires a few extra files to exist on a repository. These are called metadata files. TUF metadata files contain additional information, including information about which keys are trusted, the cryptographic hashes of files, signatures on the metadata, metadata version numbers, and the date after which the metadata should be considered expired.

When a software update system using TUF wants to check for updates, it asks TUF to do the work. That is, your software update system never has to deal with this additional metadata or understand what's going on underneath. If TUF reports back that there are updates available, your software update system can then ask TUF to download these files. TUF downloads them and checks them against the TUF metadata that it also downloads from the repository. If the downloaded target files are trustworthy, TUF hands them over to your software update system.
See [Metadata](METADATA.md) for more information and examples.

TUF specification document is also available:

* [The Update Framework Specification](docs/tuf-spec.txt?raw=true)



##Using TUF

TUF has four major classes of users: clients, for whom TUF is largely transparent; mirrors, who will (in most cases) have nothing at all to do with TUF; upstream servers, who will largely be responsible for care and feeding of repositories; and integrators, who do the work of putting TUF into existing projects.

* [Creating a Repository](tuf/README.md)

* [Low-level Integration](tuf/client/README.md)

* [High-level Integration](tuf/interposition/README.md)
69 changes: 69 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#Security

Generally, a software update system is secure if it can be sure that it knows about the latest available updates in a timely manner, any files it downloads are the correct files, and no harm results from checking or downloading files. The details of making this happen are complicated by various attacks that can be carried out against software update systems.

## Attacks and Weaknesses

The following are some of the known attacks on software update systems, including weaknesses that make attacks possible. In order to design a secure software update framework, these need to be understood and protected against. Some of these issues are or can be related depending on the design and implementation of a software update system.

* **Arbitrary software installation**. An attacker installs anything they want on the client system. That is, an attacker can provide arbitrary files in response to download requests and the files will not be detected as illegitimate.

* **Rollback attacks**. An attacker presents a software update system with older files than those the client has already seen, causing the client to use files older than those the client knows about.

* **Indefinite freeze attacks**. An attacker continues to present a software update system with the same files the client has already seen. The result is that the client does not know that new files are available.

* **Endless data attacks**. An attacker responds to a file download request with an endless stream of data, causing harm to clients (e.g. a disk partition filling up or memory exhaustion).

* **Slow retrieval attacks**. An attacker responds to clients with a very slow stream of data that essentially results in the client never continuing the update process.

* **Extraneous dependencies attacks**. An attacker indicates to clients that in order to install the software they wanted, they also need to install unrelated software. This unrelated software can be from a trusted source but may have known vulnerabilities that are exploitable by the attacker.

* **Mix-and-match attacks**. An attacker presents clients with a view of a repository that includes files that never existed together on the repository at the same time. This can result in, for example, outdated versions of dependencies being installed.

* **Wrong software installation**. An attacker provides a client with a trusted file that is not the one the client wanted.

* **Malicious mirrors preventing updates**. An attacker in control of one repository mirror is able to prevent users from obtaining updates from other, good mirrors.

* **Vulnerability to key compromises**. At attacker who is able to compromise a single key or less than a given threshold of keys can compromise clients. This includes relying on a single online key (such as only being protected by SSL) or a single offline key (such as most software update systems use to sign files).

##Design Concepts

The design and implementation of TUF aims to be secure against all of the above attacks. A few general ideas drive much of the security of TUF.

For the details of how TUF conveys the information discussed below, see the [Metadata documentation](METADATA.md).

## Trust

Trusting downloaded files really means trusting that the files were provided by some trusted party. Two frequently overlooked aspects of trust in a secure software update system are:

* Trust should not be granted forever. Trust should expire if it is not renewed.
* Compartmentalized trust. A trusted party should only be trusted for files that it is supposed to provide.

## Mitigated Key Risk

Cryptographic signatures are a necessary component in securing a software update system. The safety of the keys that are used to create these signatures affects the security of clients. Rather than incorrectly assume that private keys are always safe from compromise, a secure software update system must strive to keep clients as safe as possible even when compromises happen.

Keeping clients safe despite dangers to keys involves:

* Fast and secure key replacement and revocation.
* Minimally trusting keys that are at high risk. Keys that are kept online or used in an automated fashion shouldn't pose immediate risk to clients if compromised.
* Supporting the use of multiple keys with threshold/quorum signatures trust.

## Integrity

File integrity is important both with respect to single files as well as collections of files. It's fairly obvious that clients must verify that individual downloaded files are correct. Not as obvious but still very important is the need for clients to be certain that their entire view of a repository is correct. For example, if a trusted party is providing two files, a software update system should see the latest versions of both of those files, not just one of the files and not versions of the two files that were never provided together.

## Freshness

As software updates often fix security bugs, it is important that software update systems be able to obtain the latest versions of files that are available. An attacker may want to trick a client into installing outdated versions of software or even just convince a client that no updates are available.

Ensuring freshness means to:

* Never accept files older than those that have been seen previously.
* Recognize when there may be a problem obtaining updates.

Note that it won't always be possible for a client to successfully update if an attacker is responding to their requests. However, a client should be able to recognize that updates may exist that they haven't been able to obtain.

## Implementation Safety

In addition to a secure design, TUF also works to be secure against implementation vulnerabilities including those common to software update systems. In some cases this is assisted by the inclusion of additional information in metadata. For example, knowing the expected size of a target file that is to be downloaded allows TUF to limit the amount of data it will download when retrieving the file. As a result, TUF is secure against endless data attacks (discussed above).
Binary file added docs/images/repository_tool-diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/latex/tuf-client-spec.pdf.old
Binary file not shown.
62 changes: 57 additions & 5 deletions docs/latex/tuf-client-spec.tex
Original file line number Diff line number Diff line change
@@ -1,8 +1,37 @@
% tuf_client_spec.tex
\documentclass{letter}
\usepackage{listings}
% This document has been deprecated. We may later update and include it in
% the supported documentation.
\documentclass{article}
\setlength\parindent{0pt}
\lstset{frameshape={ynn}{nny}{nnn}{yyn}, showstringspaces=false, basicstyle=\ttfamily}
\usepackage{listings}
\usepackage{hyperref}
\usepackage{color}
\usepackage{textcomp}
\definecolor{listinggray}{gray}{0.9}
\definecolor{lbcolor}{rgb}{0.9,0.9,0.9}
\lstset{
backgroundcolor=\color{lbcolor},
tabsize=4,
rulecolor=,
language=matlab,
basicstyle=\scriptsize,
upquote=true,
aboveskip={1.5\baselineskip},
columns=fixed,
showstringspaces=false,
extendedchars=true,
breaklines=true,
prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},
frame=single,
showtabs=false,
showspaces=false,
showstringspaces=false,
identifierstyle=\ttfamily,
keywordstyle=\color[rgb]{0,0,1},
commentstyle=\color[rgb]{0.133,0.545,0.133},
stringstyle=\color[rgb]{0.627,0.126,0.941},
}

\begin{document}

%--------------------------------- Header --------------------------------------
Expand Down Expand Up @@ -44,7 +73,23 @@ \section{Example}

\subsection{Setting up the Repository}
You'll need to run the following steps to set the stage:
\lstinputlisting[language=csh]{tufsetup.sh}

\begin{lstlisting}
#! /bin/sh

# create the relevant directories
mkdir tufdemo
cd tufdemo
mkdir demorepo
mkdir demoproject

# add a file to the project
echo "#! /usr/bin/env python" > demoproject/helloworld.py
echo "print 'hello, world!'" >> demoproject/helloworld.py

# run the quickstart script
quickstart.py -t 1 -k keystore -l demorepo -r demoproject
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to keep using quickstart? I thought it was deprecated

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was deprecated. "tuf-client-spec.pdf" was moved to "tuf-client-spec.pdf.old".
I saved "tuf-client-spec.tex" just in case we decide to update it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be a good idea to add a disclaimer of that? just in case.

On 02/03/2014 05:59 PM, Vladimir Diaz wrote:

In docs/latex/tuf-client-spec.tex:

+\begin{lstlisting}
+#! /bin/sh
+
+# create the relevant directories
+mkdir tufdemo
+cd tufdemo
+mkdir demorepo
+mkdir demoproject
+
+# add a file to the project
+echo "#! /usr/bin/env python" > demoproject/helloworld.py
+echo "print 'hello, world!'" >> demoproject/helloworld.py
+
+# run the quickstart script
+quickstart.py -t 1 -k keystore -l demorepo -r demoproject

It was deprecated. "tuf-client-spec.pdf" was moved to
"tuf-client-spec.pdf.old".
I saved "tuf-client-spec.tex" just in case we decide to update it.


Reply to this email directly or view it on GitHub
https://github.com/theupdateframework/tuf/pull/170/files#r9403885.

\end{lstlisting}

This will prompt you for a password for your keystore and an expiration date.
Choosing your expiration date is something of a balancing act: on the one hand,
Expand Down Expand Up @@ -72,7 +117,14 @@ \subsection{Setting up the Client}
a mechanism with which to perform the initial installation of our demo project's
metadata. To do that, open up another terminal and run the following:

\lstinputlisting[language=csh]{tufclientsetup.sh}
\begin{lstlisting}
#! /bin/sh

mkdir democlient
cp -r demorepo/meta democlient/cur
cp -r democlient/cur democlient/prev
\end{lstlisting}


Once we've installed our metadata, getting the software is a simple matter of
running the demonstration client, found with TUF's source at
Expand Down
Binary file not shown.
Loading