Skip to content

Commit 107be15

Browse files
joshuagllukpuehtrishankatdatadog
authored
Clean up "Writing consistent snapshots" section (#187)
* Match how metadata and target filenames are referred to in the detailed client workflow, i.e. filename.ext -> FILENAME.EXT * Remove suggestion to write a version of the root metadata without a version prefix. We only ever look for version-prefixed version of root metadata. * More use of RFC-2119 keywords to clarify repository handling of consistent snapshots * Link to CONSISTENT_SNAPSHOT attribute definition * Clarify that all versions of root metadata MUST be kept for outdated clients to be able to update Signed-off-by: Joshua Lock <[email protected]> Co-authored-by: lukpueh <[email protected]> Co-authored-by: Trishank Karthik Kuppusamy <[email protected]>
1 parent fe50914 commit 107be15

File tree

1 file changed

+31
-35
lines changed

1 file changed

+31
-35
lines changed

tuf-spec.md

Lines changed: 31 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Title: The Update Framework Specification
33
Shortname: TUF
44
Status: LS
55
Abstract: A framework for securing software update systems.
6-
Date: 2021-09-07
6+
Date: 2021-09-21
77
Editor: Justin Cappos, NYU
88
Editor: Trishank Karthik Kuppusamy, Datadog
99
Editor: Joshua Lock, VMware
@@ -16,7 +16,7 @@ Boilerplate: copyright no, conformance no
1616
Local Boilerplate: header yes
1717
Markup Shorthands: css no, markdown yes
1818
Metadata Include: This version off, Abstract off
19-
Text Macro: VERSION 1.0.25
19+
Text Macro: VERSION 1.0.26
2020
</pre>
2121

2222
Note: We strive to make the specification easy to implement, so if you come
@@ -1585,49 +1585,45 @@ without interrupting that client.
15851585
We now explain how a repository should write metadata and targets to
15861586
produce self-contained consistent snapshots.
15871587

1588-
Simply put, TUF should write every metadata file as such: if the
1589-
file had the original name of filename.ext, then it should be written to
1590-
non-volatile storage as version_number.filename.ext, where version_number
1591-
is an integer.
1588+
Simply put, every metadata file MUST be named as such: if the
1589+
file had the original name of FILENAME.EXT, then it MUST be written to
1590+
non-volatile storage as VERSION_NUMBER.FILENAME.EXT, where VERSION_NUMBER
1591+
is the integer version number listed in the metadata file.
15921592

1593-
On the other hand, consistent target files should be written to
1594-
non-volatile storage as digest.filename.ext. This means that if the
1593+
On the other hand, consistent target files MUST be written to
1594+
non-volatile storage as HASH.FILENAME.EXT. This means that if the
15951595
referrer metadata lists N cryptographic hashes of the referred file, then
1596-
there must be N identical copies of the referred file, where each file will
1596+
there MUST be N identical copies of the referred file, where each file will
15971597
be distinguished only by the value of the digest in its filename. The
15981598
modified filename need not include the name of the cryptographic hash
15991599
function used to produce the digest because, on a read, the choice of
16001600
function follows from the selection of a digest (which includes the name of
16011601
the cryptographic function) from all digests in the referred file.
16021602

1603-
Additionally, the timestamp metadata (timestamp.json) should also be
1604-
written to non-volatile storage whenever it is updated. It is OPTIONAL for
1605-
an implementation to write identical copies at
1606-
version_number.timestamp.json for record-keeping purposes, because a
1607-
cryptographic hash of the timestamp metadata is usually not known in
1608-
advance. The same step applies to the root metadata (root.json), although
1609-
an implementation must write both root.json and version_number.root.json
1610-
because it is possible to download root metadata both with and without
1611-
known version numbers. These steps are required because these are the only
1612-
metadata files that may be requested without known version numbers.
1613-
1614-
Most importantly, no metadata file format must be updated to refer to the
1615-
names of metadata or target files with their version numbers included. In
1616-
other words, if a metadata file A refers to another metadata file B as
1617-
filename.ext, then the filename must remain as filename.ext and not
1618-
version_number.filename.ext. This rule is in place so that metadata signed
1619-
by roles with offline keys will not be forced to sign for the metadata file
1620-
whenever it is updated. In the next subsection, we will see how clients
1621-
will reproduce the name of the intended file.
1622-
1623-
Finally, the root metadata should write the Boolean "consistent_snapshot"
1624-
attribute at the root level of its keys of attributes. If consistent
1625-
snapshots are not written by the repository, then the attribute may either
1626-
be left unspecified or be set to the False value. Otherwise, it must be
1627-
set to the True value.
1603+
Timestamp metadata (timestamp.EXT) MUST be written to non-volatile storage
1604+
without a version prefix whenever it is updated. This is required because
1605+
timestamp metadata is the only metadata file that may be requested without known
1606+
version numbers. It is OPTIONAL for an implementation to write an identical copy
1607+
of timestamp.EXT to the respective VERSION_NUMBER.timestamp.EXT for
1608+
record-keeping purposes.
1609+
1610+
Most importantly, metadata file formats SHALL NOT be updated to refer to the
1611+
names of metadata or target files with their consistent snapshot prefix
1612+
included. In other words, if a metadata file A refers to another metadata file B
1613+
as FILENAME.EXT, then the filename listed in the metadata MUST remain as
1614+
FILENAME.EXT and not VERSION_NUMBER.FILENAME.EXT. This rule is in place so that
1615+
metadata signed by roles with offline keys will not be forced to sign for the
1616+
metadata file whenever it is updated. In the next subsection, we will see how
1617+
clients will reproduce the name of the intended file.
1618+
1619+
Finally, when consistent snapshots are written by the repository the root
1620+
metadata MUST write the boolean <a>CONSISTENT_SNAPSHOT</a> attribute at the root
1621+
level of its keys of attributes set to the true value. If consistent snapshots
1622+
are not written by the repository, then the attribute MAY either be left
1623+
unspecified or be set to the false value.
16281624

16291625
Regardless of whether consistent snapshots are ever used or not, all
1630-
released versions of root metadata files should always be provided
1626+
released versions of root metadata files MUST always be provided
16311627
so that outdated clients can update to the latest available root.
16321628

16331629

0 commit comments

Comments
 (0)