Code Monkey home page Code Monkey logo

uptane.github.io's Introduction

*NOTE: This implementation is not currently maintained, and may represent an
outdated version of the [Uptane
Standard](https://uptane.github.io/uptane-standard/uptane-standard.html).*

---

# [Uptane](https://uptane.github.io): Securing Software Updates for Automobiles

Reference Implementation and demonstration code

[![Build Status](https://travis-ci.org/uptane/uptane.png?branch=develop)](https://travis-ci.org/uptane/uptane?branch=develop) [![Coverage Status](https://coveralls.io/repos/github/uptane/uptane/badge.svg)](https://coveralls.io/github/uptane/uptane?branch=develop)
--------------------------------

# Documentation
Extensive documentation on design can be found in the following documents:

* [Uptane Standard](https://uptane.github.io/uptane-standard/uptane-standard.html)
* [Deployment Considerations](https://docs.google.com/document/d/17wOs-T7mugwte5_Dt-KLGMsp-3_yAARejpFmrAMefSE/edit?usp=sharing)

The project's [maintainers, contribution policies, and how-tos for submitting
issues, security audits, etc. are visible in PROJECT.md](PROJECT.md)

Note that the [Uptane Standard](https://uptane.github.io/uptane-standard/uptane-standard.html) is the definitive guide for how to implement Uptane.  If the reference implementation and the standard disagree, the standard is authoritative.  Any mismatches should be filed as issues in the issue tracker.

The reference implementation will describe which version of the standard it implements, once official standards releases have occurred.  


# Instructions on use of the Uptane demonstration code

Below are the instructions on use of the Uptane demonstration and reference
implementation code, divided into these sections:

* [0: Installation](#0-installation)
* [1: Starting the Demo](#1-starting-the-demo)
* [2: Delivering an Update](#2-delivering-an-update)
* [3: Blocking Attacks](#3-blocking-attacks)
  * [3.1: Arbitrary Package Attack on Director Repository without Compromised Keys](#31-arbitrary-package-attack-on-director-repository-without-compromised-keys)
  * [3.2: Arbitrary Package Attack on Image Repository without Compromised Keys](#32-arbitrary-package-attack-on-image-repository-without-compromised-keys)
  * [3.3: Replay Attack without Compromised Keys](#33-replay-attack-without-compromised-keys)
  * [3.4: Arbitrary Package Attack with a Compromised Director Key](#34-arbitrary-package-attack-with-a-compromised-director-key)
  * [3.5: Compromise Both Repositories Simultaneously to Serve Arbitrary Package](#35-compromise-both-repositories-simultaneously-to-server-arbitrary-package)
  * [3.6: Recover from Major Key Compromise](#36-recover-from-major-key-compromise)
  * [3.7: Arbitrary Package Attack with Revoked Keys](#37-arbitrary-package-attack-with-revoked-keys)
* [Testing](#testing)


# 0: Installation
Uptane supports Python2 and Python3. As usual for Python, [virtual environments](https://python-docs.readthedocs.io/en/latest/dev/virtualenvs.html) are recommended for development and testing, but not necessary.

Some development libraries are necessary to install some of Uptane's dependencies. If your system uses apt, the command to install them will be:
```shell
$ sudo apt-get install build-essential libssl-dev libffi-dev python-dev python3-dev
```

Fedora-based distributions can instead install these libraries with dnf.
```shell
$ dnf install redhat-rpm-config openssl-devel libffi-devel python-devel python3-devel
```

OS X users can instead install these header libraries with the [Homebrew](http://brew.sh/) package manager.
```shell
$ brew install python
$ brew install libffi
```

To download and install the Uptane code and its dependencies, run the following:
```shell
$ git clone https://github.com/uptane/uptane
$ cd uptane
$ pip install -r dev-requirements.txt
```

#### Updates
When updating Uptane code, please reinstall its dependencies, as the
corresponding TUF fork may be updated:
`pip install --force-reinstall -r dev-requirements.txt`

#### Metadata format
Note that the demonstration now operates using ASN.1 / DER format and encoding
for metadata files by default. If desired, this can be switched to JSON (which
results in human-readable metadata files) by changing the
tuf.conf.METADATA_FORMAT option in `uptane/__init__.py`, from 'der' to 'json'
`tuf.conf.METADATA_FORMAT = 'json'`


#### Install command-line audio player (optional)
If you want the demo to play notification sounds you need one of the following audio player command line utilities on your path:
- mplayer (available for all major operating systems)
- omxplayer (built-in on Raspbian)
- afplay (built-in on OS X)

#### Troubleshooting
If you are running into errors or want to run unit and integration tests to
better understand the workings of the reference implementation, see the
[Testing](#testing) section at the bottom of this document.


# 1: Starting the Demo
The code below is intended to be run in three or more consoles:
- [WINDOW 1](#window-1-the-uptane-services): Python shell for the Uptane services
- [WINDOW 2](#window-2-the-primary-clients): Python shell for a Primary client in the vehicle. This fetches images and metadata from the repositories via HTTP, and communicates with the Director service, Timeserver, and any Secondaries via XMLRPC. (More of these can be run, simulating more vehicles with one Primary each.)
- [WINDOW 3](#window-3-the-secondary-clients): Python shell for a Secondary in the vehicle. This communicates directly only with the Primary via XMLRPC, and will perform full metadata verification. (More of these can be run, simulating more ECUs in one or more vehicles.)



### WINDOW 1: the Uptane services
These instructions start a demonstration version of the three services that
run OEM-side (or supplier-side, or fleet-side): the Image Repository,
the Director, and the Timeserver.


The Uptane documentation explains each of these services in greater detail,
but in brief:

**The Image Repository** is the main repository for images and general metadata
about them.

**The Director** generates metadata for specific
vehicles indicating which ECUs should install what firmware (validated against
and obtained from the Image Repository). It also receives and validates
Vehicle Manifests from Primaries, and the ECU Manifests from Secondaries
that have been bundled in the Vehicle Manifests, which capture trustworthy
information about what software is running on the ECUs, along with, optionally,
signed reports of any attacks observed by those ECUs.

**The Timeserver** is a simple service that receives requests for signed
times, each bundled by a vehicle Primary, and produces a signed attestation
that includes the request tokens each Secondary ECU sent to its Primary, so
that each ECU can better establish that it is not being tricked into accepting
a false or very old time.


From within the root `uptane/` directory of the downloaded code (which contains e.g. the `setup.py` file), run the following command. (Any version of Python > 2.7
should do. We test on 2.7, 3.5, and 3.6.)

```Bash
$ python -i demo/start_servers.py
```


After that, proceed to the following Windows to prepare clients.
Once those are ready, you can perform a variety of modifications and attacks.
Examples will be discussed below in the
[Delivering an Update](#2-delivering-an-update) and
[Blocking Attacks](#blocking-attacks) sections.



### WINDOW 2(+): the Primary client(s):
(Image Repo, Director, and Timeserver must already have finished starting up.)
The Primary client started below is likely to run on a more capable and
connected ECU in the vehicle - potentially the head unit / infotainment. It will
obtain metadata and images from the Image Repository as instructed by the Director
and distribute them appropriately to other, Secondary ECUs in the vehicle,
and it will receive ECU Manifests indicating the software on each Secondary ECU,
and bundle these into a Vehicle Manifest which it will send to the Director.

Open a Python shell in a new terminal window and then run the following:

```python
>>> import demo.demo_primary as dp
>>> dp.clean_slate() # sets up a fresh Primary that has never been updated
>>> dp.update_cycle()
```

The Primary's update_cycle() call:
- fetches and validates all signed metadata for the vehicle, from the Director and Image repositories
- fetches all images that the Director instructs this vehicle to install, excluding any that do not exactly match corresponding images on the Image repository. Any images fetched from the repositories that do not match validated metadata are discarded.
- queries the Timeserver for a signed attestation about the current time, including in it any nonces sent by Secondaries, so that Secondaries may trust that the time returned is at least as recent as their sent nonce
- generates a Vehicle Version Manifest with some vehicle metadata and all ECU Version Manifests received from Secondaries, describing currently installed images, most recent times available to each ECU, and reports of any attacks observed by Secondaries (can also be called directly: `dp.generate_signed_vehicle_manifest()`)
- sends that Vehicle Version Manifest to the Director (can also be called directly: `dp.submit_vehicle_manifest_to_director()`)

If you wish to run the demo with multiple vehicles (one Primary each), you can open a Python shell in a new terminal
window for each vehicle's Primary and provide a unique VIN and ECU Serial for each of them. Because each Secondary will need to communicate with the correct Primary in this demo, find port that is chosen in the Primary's initialization (when `dp.clean_slate()` is called) and make note of it so that it can be provided to any Secondaries you set up in a moment. The message will be e.g. "Primary will now listen on port 30702")
Example setting up a different Primary for a different vehicle:
```python
>>> import demo.demo_primary as dp
>>> dp.clean_slate(vin='112', ecu_serial='PRIMARY_ECU_2')
>>> dp.update_cycle()
```



### WINDOW 3(+): the Secondary client(s):
(The following assumes that the Image Repository, Director, Timeserver, and
Primary have finished starting up and are hosting/listening.)
Here, we start a single Secondary ECU and generate a signed ECU Manifest
with information about the "firmware" that it is running, which we send to the
Primary.

Open a Python shell in a new terminal window and then run the following:

```python
>>> import demo.demo_secondary as ds
>>> ds.clean_slate()
>>> ds.update_cycle()
```

Optionally, multiple windows with different Secondary clients can be run simultaneously. In each additional window, you can run the same calls as above to set up a new ECU in the same, default vehicle by modifying the clean_slate() call to include a distinct ECU Serial. e.g. `ds.clean_slate(ecu_serial='33333')`

If the Secondary is in a different vehicle from the default vehicle, this call should look like:
`ds.clean_slate(vin='vehicle_id_here', ecu_serial='ecu_serial_here', primary_port=30702)`, providing a VIN for the new vehicle, a unique ECU Serial, and indicating the port listed by this Secondary's Primary when that Primary initialized (e.g. "Primary will now listen on port 30702").

The Secondary's update_cycle() call:
- fetches and validates the signed metadata for the vehicle from the Primary
- fetches any image that the Primary assigns to this ECU, validating that against the instructions of the Director in the Director's metadata, and against file info available in the Image Repository's metadata. If the image from the Primary does not match validated metadata, it is discarded.
- fetches the latest Timeserver attestation from the Primary, checking for the nonce this Secondary last sent. If that nonce is included in the signed attestation from the Timeserver and the signature checks out, this time is saved as valid and reasonably recent.
- generates an ECU Version Manifest that indicates the secure hash of the image currently installed on this Secondary, the latest validated times, and a string describing attacks detected (can also be called directly: `ds.generate_signed_ecu_manifest()`)
- submits the ECU Version Manifest to the Primary (can also be called directly: `ds.submit_ecu_manifest_to_primary()`)



# 2: Delivering an Update
To deliver an Update via Uptane, you'll need to add the firmware image to the Image repository, then assign it to a vehicle
and ECU in the Director repository. Then, the Primary will obtain the new firmware, and the Secondary will update from the
Primary.

Execute the following code in the Uptane services window (WINDOW 1) to create a
new firmware file, generate metadata about it, sign that metadata with the
appropriate keys (assigned by delegations in the Image Repository), and host
the image and metadata on the Image Repository.

```python
>>> firmware_fname = filepath_in_repo = 'firmware.img'
>>> open(firmware_fname, 'w').write('Fresh firmware image')
>>> di.add_target_to_imagerepo(firmware_fname, filepath_in_repo)
>>> di.write_to_live()
```

To assign the new image to the ecu 'TCUdemocar' on vehicle 'democar', run
the following in the Uptane services window (WINDOW 1):
```python
>>> vin='democar'; ecu_serial='TCUdemocar'
>>> dd.add_target_to_director(firmware_fname, filepath_in_repo, vin, ecu_serial)
>>> dd.write_to_live(vin_to_update=vin)
```

Next, you can update the Primary. In WINDOW 2:
```python
>>> dp.update_cycle()
```

When the Primary has finished, you can update the Secondary. In WINDOW 3:
```python
>>> ds.update_cycle()
```

You should see an Updated banner on the Secondary, indicating a successful, validated update.



# 3: Blocking Attacks
Uptane is designed to secure the software updates delivered between repositories and vehicles.  [Section
7.3](https://docs.google.com/document/d/1pBK--40BCg_ofww4GES0weYFB6tZRedAjUy6PJ4Rgzk/edit#heading=h.jta2pcxo2frp) of the [Uptane Design Overview](https://docs.google.com/document/d/1pBK--40BCg_ofww4GES0weYFB6tZRedAjUy6PJ4Rgzk/edit?usp=sharing) covers all of the known attacks in more detail.  We begin this section with a demonstration
of the Arbitrary Package Attack.



### 3.1: Arbitrary Package Attack on Director Repository without Compromised Keys
This is a simple attack simulating a Man in the Middle that provides a malicious image file. In this attack, the
attacker does not have the keys to correctly sign new metadata (and so it is an exceptionally basic attack).

In the Uptane services window (1):
```python
>>> dd.mitm_arbitrary_package_attack(vin, firmware_fname)
```

As a result of the attack above, the Director will instruct the secondary client in the vehicle to install *firmware.img*.
Since this file is not on (and validated by) the Image Repository, the Primary will refuse to download it
(and a Full Verification Secondary would likewise refuse it even if a compromised Primary delivered it
to the Secondary).

In WINDOW 1, run:
```python
>>> dp.update_cycle()
```

Now, when the Primary runs dp.update_cycle(), it'll display the DEFENDED banner and play a sound clip, as it's
able to discard the manipulated file without even sending it to the Secondary.

To resume experimenting with the repositories, run this script to put the
repository back in a normal state (undoing what the attack did) by running the
following in the services window (1):
```python
>>> dd.undo_mitm_arbitrary_package_attack(vin, firmware_fname)
```

If the primary client runs an update_cycle() after the restoration of the Director repository, *firmware.img*
should updated successfully.



### 3.2: Arbitrary Package Attack on Image Repository without Compromised Keys
In the previous section, the firmware available on the director repository was replaced with a malicious one.
What if the image repository is corrupted with a malicious firmware?

Run the following in WINDOW 1:
```python
>>> di.mitm_arbitrary_package_attack(firmware_fname)
```

You can see the update once again proceeding normally by running this in the
Primary's window (2):
```python
>>> dp.update_cycle()
```


The result is the same: The primary client is expected to also discard the
malicious `firmware.img` downloaded from the Image repository
and print a DEFENDED banner.  If you inspect messages further up in
the console (above the banner) to get more detail, you should
find the following:

```
Downloading: u'http://localhost:30301/targets/firmware.img'
Downloaded 14 bytes out of the expected 14 bytes.
Not decompressing http://localhost:30301/targets/firmware.img
Update failed from http://localhost:30301/targets/firmware.img.
BadHashError
Failed to update /firmware.img from all mirrors: {u'http://localhost:30301/targets/firmware.img': BadHashError()}
Downloading: u'http://localhost:30401/democar/targets/firmware.img'
Could not download URL: u'http://localhost:30401/democar/targets/firmware.img'
```

Uptane detected that the image retrieved did not have a hash matching what the
signed, validated metadata indicated we should expect.

Undo the the arbitrary package attack so that subsequent demonstration sections
can proceed.

```python
>>> di.undo_mitm_arbitrary_package_attack(firmware_fname)
```

### 3.3: Replay Attack without Compromised Keys

We next demonstrate a replay attack, where the client is given an older (and previously trusted)
version of metadata.  A replay attack could result in a rollback of installed
software, causing secondary clients to use older firmware than they
currently trust. Rollback attacks in general are described in The
[Deny Functionality subsection of the Design Overview](https://docs.google.com/document/d/1pBK--40BCg_ofww4GES0weYFB6tZRedAjUy6PJ4Rgzk/edit#heading=h.4mo91b3dvcqd).

First, switch to the services window and copy the Timestamp role's
metadata, `timestamp.der` to a backup. This is what we'll roll back to in the
attack.
A function is available to perform this action:
```python
>>> dd.backup_timestamp(vin)
```

Now, we update the metadata in the Director repository. In this case, a fairly
empty update, writing a new `timestamp.der` and `snapshot.der` files. The backup
we saved earlier is now old by comparison.
```python
>>> dd.write_to_live(vin)
```

In the Primary's window (2), the Primary client now performs an update,
retrieving the new metadata we generated.

```python
>>> dp.update_cycle()
```

Next, in the services window, we simulate the replay attack, trying to
distribute the out-of-date metadata backed up earlier, effectively rolling back
the timestamp file to a previous version.
```python
>>> dd.replay_timestamp(vin)
```

If this old metadata is presented to the Primary, the Primary rejects it,
because it has already validated newer metadata. When you run the below, you
should see a REPLAY banner. The console also logs the cause of the download
failure (ReplayedMetadataError exception). In the **Primary's window**:
```python
>>> dp.update_cycle()
...
Update failed from http://localhost:30401/democar/metadata/timestamp.der.
ReplayedMetadataError
Failed to update timestamp.der from all mirrors:
{u'http://localhost:30401/democar/metadata/timestamp.der': ReplayedMetadataError()}
```

Finally, restore the valid, latest version of Timestamp metadata
(`timestamp.der`) into place in the services window.
```python
>>> dd.restore_timestamp(vin)
```



### 3.4: Arbitrary Package Attack with a Compromised Director Key

Thus far we have simulated a few attacks that have not depended on compromised keys.  In
the previous attacks, an attacker has presented unchanged, out-of-date data
(replay, 3.3) or simply modified the images or metadata requested by a primary
or secondary client, without having the right key to sign new metadata.
Consequently, these clients have blocked the attacks because the malicious
images do not match what is listed in signed, trusted metadata.

However, what happens if an attacker manages to obtain or make use of a
repository key and signs for a malicious image?  Is the client able to block a compromise
of just the image repository?  What about a compromise of both the image and director
repositories?

Both repositories currently have metadata about 'firmware.img', which we added
in the [2: Delivering an Update](#2-delivering-an-update) section.

For this attack, we'll modify `firmware.img` to include malicious content, and
will sign metadata certifying that malicious firmware file.

To simulate a compromised directory key, we simply sign for an updated
"firmware.img" that includes malicious content (the phrase "evil content" in
this case), in the services window:

```python
>>> dd.add_target_and_write_to_live(filename='firmware.img',
    file_content='evil content', vin=vin, ecu_serial=ecu_serial)
```

The primary client now attempts to download the malicious file.
```python
>>> dp.update_cycle()
```

The primary client should print a DEFENDED banner and provide the following error message: `The Director has instructed
us to download a file that does not exactly match the Image Repository metadata. File: '/firmware.img'`



### 3.5: Compromise Both Repositories Simultaneously to Serve Arbitrary Package
In 3.4, the Director repository has been compromised, but the malicious
metadata and firmware it distributes is rejected. Compromising the Director is
not enough to allow arbitrary package attacks against ECUs in the vehicle.
The Director can only instruct clients to install images validated by the Image
Repository.

But what happens if, at the same time, the attacker is able to sign with a
high-level image-signing key trusted by the Image Repository? (Note that these
should generally be offline keys and rarely need to be used.)
With the previous attack still in place, let's add:
```python
>>> di.add_target_and_write_to_live(filename='firmware.img', file_content='evil content')
```

Now, when the the Primary and Secondary update, the malicious package will
successfully be installed!

On the **primary** client:
```python
>>> dp.update_cycle()
```

On the **secondary** client:
```python
>>> ds.update_cycle()
```

Note, both the image and director repositories have been compromised. As a
result, unfortunately, in an attack of this kind Secondary would install this
malicious firmware.img, which neither the Primary nor the
Secondary have any way of knowing is malicious, since every necessary key has
signed metadata for that image.

For demonstration purposes, the secondary detects that a malicious file is installed.  The secondary
client in the demo code prints a banner indicating that the *firmware.img* image was malicously
installed: A malicious update has been installed! Arbitrary package attack successful:
this Secondary has been compromised! Image: 'new_firmware.img'

##### A note on the difficulty of this attack
To improve resilience against repository compromises, the
[Deployment Considerations document](https://docs.google.com/document/d/17wOs-T7mugwte5_Dt-KLGMsp-3_yAARejpFmrAMefSE)
provides many recommendations. In particular, the
[key placement recommendations](https://docs.google.com/document/d/17wOs-T7mugwte5_Dt-KLGMsp-3_yAARejpFmrAMefSE/view#heading=h.k5rokxr32wv6)
indicate that Targets keys for the Image Repository are best kept offline; it
should not be easy to compromise this top-level Image Repository Targets key
and use it to sign malicious images, as this key should be needed only when
altering delegations (to parties who may sign for particular subsets of images).
Depending on the way you deploy the system, this may be only when establishing a
relationship with a new firmware supplier or revoking trust in them, for
example.

A more limited attack of this sort is possible against a subset of available
firmware if rather than the top-level Image Repository targets keys, the
attacker acquires the signing keys held by a party who has been delegated trust
for a subset of images, such as a supplier the Image Repository has elected to
trust to do the image signing for its own firmware releases to the Image
Repository. While such delegated keys should also be held offline and need only
be used when the delegatee produces new firmware, it is easier to imagine such
a key being compromised than the Image Repository's top-level Targets role
key(s). The structure of Uptane is flexible enough to accommodate almost any
trust arrangement, allowing the impact of keys being lost to be limited to a
small subset of images. Note that as before, this attack still requires also
compromising the Director repository's Targets role keys or Root role keys.




### 3.6: Recover from Major Key Compromise

If a malicious attacker has laid hands on your online keys, or found a way to
force systems with such access to sign malicious metadata, trust in those keys
should be revoked, and new keys should be used in their place. These are likely
to be the Timestamp and Snapshot role keys, and the Targets role keys in some circumstances (generally the Director). (More information on these roles and
deployment considerations are available in documentation
[linked to above](#uptane).)

Once the servers have been recovered, it is easy to revoke any keys that may
have been compromised. We should also make sure that the targets and metadata
in the repositories are correct again, in case things have been changed by the
attacker while in control. In this demo, these two things are done like so:

In the services window:
```
>>> di.revoke_compromised_keys()
>>> di.add_target_and_write_to_live(filename='firmware.img',
        file_content='Fresh firmware image')
>>> dd.revoke_compromised_keys()
>>> dd.add_target_and_write_to_live(filename='firmware.img',
    file_content='Fresh firmware image', vin=vin, ecu_serial=ecu_serial)
```

We have just used the rarely-needed root keys of the two repositories to
revoke the potentially compromised Timestamp, Snapshot, and Targets keys from
both repositories. This is the first time they have needed to be used since the
repositories' creation at the beginning of this demo. Root keys should be
kept offline, as discussed in
the [Uptane Deployment Considerations document](https://docs.google.com/document/d/17wOs-T7mugwte5_Dt-KLGMsp-3_yAARejpFmrAMefSE/edit?usp=sharing).
If trust in a key needs to be revoked, the keys at a level above it (or any
level above that) can be used.
In the case of the top-level roles (like Timestamp, Snapshot, and Targets here),
that falls to Root to do. In the case of delegated Targets roles, the role
that delegates would do the revocation. So, for example, if you delegate
the ability to sign for firmware from a given vendor to the security team from
that vendor, and that team delegates in turn to a particular release manager,
and that release manager's YubiKey falls into the sewers, the security team
from the vendor can remove trust in it and trust a new key. Alternatively, the
top-level Targets role for the Image Repository could remove trust for the
security team from the vendor, etc.

Any client that receives the new metadata will be able to validate the root key
and will cease trusting the revoked keys.

On the **primary** client:
```python
>>> dp.update_cycle()
```

On the **secondary** client:
```python
>>> ds.update_cycle()
```

As ever, if a particular ECU has been compromised and arbitrary attacker code
has been executed on it, being certain that specific device is secure again
without wiping it manually is difficult. Devices that have not been compromised
in such an attack, however,
should thereafter be protected from the use of those compromised keys by an
attacker.



### 3.7: Arbitrary Package Attack with Revoked Keys

We should verify that the Primary does indeed reject metadata that's been
signed with revoked keys.  As noted in the previous section, the Primary and
secondaries automatically remove trust in revoked keys when they install the
new Root metadata.

Let's begin the demonstration by generating metadata that is maliciously
signed with the keys revoked in the last section.

```Python
>>> dd.sign_with_compromised_keys_attack(vin)
```


The Primary attempts to download the maliciously-signed metadata...

```Python
>>> dp.update_cycle()
```

... and detects a bad signature by displaying a DEFENDED banner.  The Primary
does not trust the keys and signature specified in the metadata, as expected.
If you were to inspect the cause of the download failure, you'd find the
following exception:

```
Downloading: u'http://localhost:30401/democar/metadata/timestamp.der'
Downloaded 202 bytes out of an upper limit of 16384 bytes.
Not decompressing http://localhost:30401/democar/metadata/timestamp.der
metadata_role: u'timestamp'
Update failed from http://localhost:30401/democar/metadata/timestamp.der.
BadSignatureError
Failed to update timestamp.der from all mirrors: {u'http://localhost:30401/democar/metadata/timestamp.der': BadSignatureError()}
Valid top-level metadata cannot be downloaded.  Unsafely update the Root metadata.
```

We next restore metadata to the previously trusted state, where the compromised
keys had been revoked and where new keys were added for the Targets, Snapshot,
and Timestamp roles.

```Python
>>> dd.undo_sign_with_compromised_keys_attack(vin)
```

If the Primary initiates an update cycle once again, it would appear to be
up-to-date.  The metadata that was signed by the revoked keys should not
have been saved by the Primary.


```Python
# This call should indicate that the client is up-to-date.
>>> dp.update_cycle()
```



# Testing

If you are concerned that there may be installation issues, or have run into
issues running the demo, or want to better understand the workings of
the reference implementation, or want a thorough test of whether or not the
Uptane reference implementation would work in a particular environment, you can
run Uptane's unit tests from the root uptane/ repository directory by invoking
[tox](https://testrun.org/tox/) like so:
```Bash
$ tox
```

Alternatively, you can execute any of the unit tests in the tests directory
directly, like so:
```Bash
$ python tests/test_secondary.py
```

Or you can run all tests with a particular encoding (default ASN.1/DER):
```Bash
$ python tests/runtests.py
// Or:
$ python tests/runtests.py json
$ python tests/runtests.py der
```

uptane.github.io's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

uptane.github.io's Issues

Handling failure to verify latest time

To my reading, sections 3.1.1.1 and 3.1.1.3 seem to offer diverging advice as to how a primary ECU should handle a failure to verify the latest time from an external time source. In 3.1.1.1, it says “If it [primary ECU] fails to meet this [verification] criteria, discard the response and continue the procedure without an updated time”. However, 3.1.1.3 says “If any check fails, the ECU SHOULD NOT overwrite its current attested time, but SHOULD jump to the last step …”.

To make things consistent, any of the following changes could be made:

  • Section 3.1.1.1 could instruct the Primary ECU should jump to the last step to report the error, to match with what 3.1.1.3 says already
  • Section 3.1.1.3 could instruct ECUs to continue without an updated time, to match with what 3.1.1.1 says already
  • Section 3.1.1.3 could instruct only secondary ECUs to jump to the last step, to avoid conflicting with section 3.1.1.1
  • Both sections (3.1.1.1 and 3.1.1.3) could allow both options
  • Anything else that is consistent between the two sections

Any thoughts?

Update/Revise The Readme File

The Uptane project has recently adopted Docusaurus as its primary platform for building its website. This transition marks an exciting step forward in our project's development. However, it has become evident that the existing readme file is no longer serving its intended purpose. It is crucial that we address this issue promptly.

The current readme file falls short in terms of clarity and effectiveness, which undermines our ability to effectively communicate and collaborate on our project. To rectify this, we are seeking your valuable input and suggestions to update and revamp our readme file. We believe that collective insights and ideas will help us create a more informative and user-friendly document.

We welcome any recommendations, be it for restructuring, content, or design elements that can improve the readability and usability of the readme file. Your contribution is essential in ensuring that our project is accessible and comprehensible to a wider audience.

PS: If you are interested in providing suggestions or assistance regarding the content and formatting of the readme file, please feel free to reach out to @jhdalek55.

Other: Refactor site to move static sections out of the versioned /docs/ tree

Issue Summary

Really we should only version the "Standard" and "Deployment Best Practices" sections. Currently we have seperate versions for the "Learn More/* sections. Users should always be pointed to the latest version of these documents. They should be static and not part of the versioned docs components.

My expectation is that the Learn more section should not be versioned, and be found at the following URL tree...
https://uptane.github.io/learn-more

Details

No response

Priority Level

No response

Proposed Solution (if any)

No response

Related Information

No response

Additional Comments

No response

[Bug Report] - Change Common JS Module Syntax into ES Module Syntax for "prism-react-renderer" in the "docusaurus.config.js" and resolve error when running "docusaurus start" command

Describe the bug.

Currently the import for prism-react-renderer is in the Common JS Module Style in the docusaurus.config.js file:

const { themes } = require('prism-react-renderer');

We should change this into into ES Module Syntax as mentioned in its documentation:

import { themes } from 'prism-react-renderer';

Currently following lines

const lightTheme = themes.github;
const darkTheme = themes.dracula;

are causing error when we run "yarn start" error:

$ yarn start
yarn run v1.22.19
$ docusaurus start
[INFO] Starting the development server...
[ERROR] TypeError: Cannot read properties of undefined (reading 'github')
    at Object.<anonymous> (/home/devilkillerag/Documents/OpenSource/uptane-website/docusaurus.config.js:5:27)
    at Module._compile (node:internal/modules/cjs/loader:1218:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
    at Module.load (node:internal/modules/cjs/loader:1081:32)
    at Module._load (node:internal/modules/cjs/loader:922:12)
    at Module.require (node:internal/modules/cjs/loader:1105:19)
    at module.exports (/home/devilkillerag/Documents/OpenSource/uptane-website/node_modules/import-fresh/index.js:32:59)
    at loadSiteConfig (/home/devilkillerag/Documents/OpenSource/uptane-website/node_modules/@docusaurus/core/lib/server/config.js:36:55)
    at async loadContext (/home/devilkillerag/Documents/OpenSource/uptane-website/node_modules/@docusaurus/core/lib/server/index.js:31:63)
    at async load (/home/devilkillerag/Documents/OpenSource/uptane-website/node_modules/@docusaurus/core/lib/server/index.js:74:21)
[INFO] Docusaurus version: 2.4.3
Node version: v18.13.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Describe the steps to reproduce the behavior.

No response

Expected behavior.

No response

Screenshots.

No response

Operating environment

No response

What browsers are you seeing the problem on?

No response

Additional context

No response

Durable Links

Create durable links to the latest standard version and best practices version.

Currently the latest version doesn't have it's own durable links. For example the current version is 2.1.0 but we don't have durable links for it.

Page Link
Standard Latest (2.1.0) https://uptane.github.io/docs/standard/uptane-standard
Standard 2.1.0 https://uptane.github.io/docs/2.1.0/standard/uptane-standard <-- To be added
Standard 2.0.0 https://uptane.github.io/docs/2.0.0/standard/uptane-standard
.. ..
Best Practices (2.1.0) https://uptane.github.io/docs/deployment/best-practices
Best Practices 2.1.0 https://uptane.github.io/docs/2.1.0/deployment/best-practices <-- To be added
Best Practices 2.0.0 https://uptane.github.io/docs/2.0.0/deployment/best-practices

We need a way to reference the durable link to the standard (and best practices) of the latest version, so that a user can pin the version of the standard they want to reference INCLUDING whatever version is the latest.

What I expect to work is...
https://uptane.github.io/docs/standard/uptane-standard - points to whatever version is the latest. This content will change in the future, when a new version is released.
https://uptane.github.io/docs/2.1.0/standard/uptane-standard - points to a pinned version of 2.1.0.

Updating Uptane's website: What modifications are needed?

The Uptane website at https://uptane.github.io/ went live in January of 2019. Built on essentially the same structure as the website for its parent project, The Update Framework, it’s a serviceable website with quite a bit of information. Three years later, though, it’s apparent that the manner in which that material is arranged could use some serious modifications. In particular, we are concerned that someone new to Uptane might not be able to find the basic information it needs to consider adoption or integration.

We are looking to “deconstruct” the website in terms of layout and design to create a better information flow for users. While a cleaner and more contemporary look is desirable, we are mostly seeking a more logical arrangement of information. We also want to make sure that our site contains the right type of information so we appreciate input on what should...or should not...be posted on this site.

We are inviting the community to either make comments on this thread, or to take a more active role by submitting pull requests to this repository.

Feature Request : Deployment preview Workflow/GHA

We are in need of a deployment preview workflow for our Uptane repository. This workflow is intended to operate specifically for pull requests, providing our reviewers with a live link to assess and review the proposed changes on our website before finalizing the merge process. The primary objective is to have a system where pull requests can initiate a build on a dedicated path, allowing reviewers to evaluate the results of these changes.

We have a preference for open-source alternatives for deployment and do not wish to rely on third-party services like Netlify for deployment or any paid alternatives. Instead, we are actively seeking open-source alternatives that offer similar functionality, We are open to all suggestions, and if there is a way to achieve this directly through GitHub Pages by creating a custom workflow, that would be highly advantageous.

[Bug Report] - Merge in changes to adoptions into the current Uptane page

Describe the bug.

There were newer changes to the adoptions page that didn't make it over into the new site.
https://github.com/uptane/uptane.github.io/blob/362e7e9b92031d18c1afe2985f83c57637770c36/adoptions.md?plain=1

Merge in changes from here.

Describe the steps to reproduce the behavior.

No response

Expected behavior.

No response

Screenshots.

No response

Operating environment

No response

What browsers are you seeing the problem on?

No response

Additional context

No response

[Bug Report] - Version keeps changing while navigating.

Describe the bug.

Version does not correctly persist through site navigation.

Describe the steps to reproduce the behavior.

  1. Go to https://uptane.github.io/

  2. 👇 Choose a version (we will use 1.2.0 for example)
    image

  3. 👇 Click on "Standard" - The version changes back to latest
    image

Expected behavior.

Selected version should follow navigation choices through site.

Screenshots.

No response

Operating environment

MacOS Sonoma

What browsers are you seeing the problem on?

Chrome

Additional context

No response

Improvements to the site README.md file

The Uptane project has recently adopted Docusaurus as its primary platform for building its website. This transition marks an exciting step forward in our project's development.

The current readme file falls short in terms of clarity and effectiveness, which undermines our ability to effectively communicate and collaborate on our project. To rectify this, we are seeking your valuable input and suggestions to update and revamp our readme file. We believe that collective insights and ideas will help us create a more informative and user-friendly document.

We welcome any recommendations, be it for restructuring, content, or design elements that can improve the readability and usability of the readme file. Your contribution is essential in ensuring that our project is accessible and comprehensible to a wider audience.

PS: If you are interested in providing suggestions or assistance regarding the content and formatting of the readme file, please feel free to reach out to @jhdalek55 @hexsecs and @Abhijay007.

Other: Clean up stale branches

Issue Summary

There are many old and unused branched in the code base. We should do some clean up of the branches to avoid confusion for contributors.

Details

No response

Priority Level

No response

Proposed Solution (if any)

No response

Related Information

No response

Additional Comments

No response

Consistency when Deployment pages are open

Something strange is happening with the Deployment section of the Uptane website. When you have one of the Deployment pages open, it changes the menu options on other sections of the website. For example, when I open the "Enhanced Security" page under the Deployment tab, and then go back to the "Design Documents" tab, the only version of the Standard listed is V.1.1.0 and the PDF and HTML version of the Deployment pages are not listed at all. I'm assuming this may have something to do with the fact that the Deployment pages are not updated on uptane.github.io but on https://github.com/uptane/deployment-considerations. But, we need to rectify this discrepancy so all users of the site are seeing the same items.

[Bug Report] - Governance page missing?

Describe the bug.

I'm not sure whether the governance has changed, but certainly the page seems to be missing now...

Describe the steps to reproduce the behavior.

  1. Go to https://uptane.github.io/governance.html
  2. Text says: "Page is not found"

Expected behavior.

Page should either be not generated at all with a link to it, or the content needs to be updated.

Screenshots.

No response

Operating environment

No response

What browsers are you seeing the problem on?

No response

Additional context

No response

Chore: Get repository working from 'main' branch.

  • Tag current master branch to archive state before merge.
  • Per generally accepted guidelines for git naming, rename 'master' --> 'main'.
  • Merge 'uptane_docusaurus' into 'main'
  • Fix CI workflows to point to 'main' instead of 'uptane_docusaurus'
  • Configure github to serve page from 'main' branch.
  • Set default branch to 'main'

[Bug Report] - Fix security vulnerabilities flagged by dependabot

Describe the bug.

Dependabot found two vulnerabilities that cannot automatically be fixed due to pinned versions.
image

They look to be fixed in v3.x of docusaurus. The patch to resolve is listed here...
facebook/docusaurus#8277

While these probably won't cause any issues. It's easy enough to fix.

Describe the steps to reproduce the behavior.

No response

Expected behavior.

No response

Screenshots.

No response

Operating environment

all

What browsers are you seeing the problem on?

Firefox, Chrome, Safari, Microsoft Edge, Other

Additional context

No response

Improvement: Improvements to site text

Issue Summary

@jhdalek55 I copied over the suggestions you had for the text improvements to create an issue. Perhaps a #hacktoberfest user will volunteer to make a PR for the changes.

Details

Home Page

Under “Resilient Protection”... Add

  • “…but follows a hierarchy in which different levels of access to vehicles or the automaker’s infrastructure must be gained before irreparable damage can be inflicted.

  • There should be a question mark after “Why Uptane?”

Under “Getting to Know Uptane,”

  • under the Publications header “whitepapers” is generally one-word.

Under the “Adoptions” header,

  • add “A list of Uptane adopters”

  • Capitalization of the main header categories is very inconsistent. With the exception of the proper noun Uptane, and the first word in each title, which must always be capitalized, all words in the titles should be lower case. Hence, change “Getting to know Uptane,” and “Join the Uptane community”

Under “Putting Uptane to work”

  • Three of tag lines under the categories still say “Short descriptions about” and the fourth is less than clear. Change these to:

Uptane Standard

The set of requirements necessary for the secure implementation of the framework

Deployment Best Practices

Examples of best practices for setting up, operating, integrating, and adapting Uptane to work in a variety of situations.

PUREs

A vehicle for proposing an addition to or modification of the Uptane Standard.

POUFs

A mechanism to describe the protocols, operations, usage, and formats of an Uptane implementation.

Under “Join the Uptane community”

  • The word “Uptane” in the sentence that follows must be capitalized

  • Also, why is the community call listed for Fridays at 5:30? This should be Every other Tuesday at 10:00 am eastern time

  • Joint Development Foundation must be capitalized. And we should use the full title here

  • Joint Development Foundation Projects, LLC, Uptane Series

On the About Us page,

  • The last sentence of the “Project Contributors” page should read “Here is an alphabetical list of the primary contributors who have asked to have their names, or the names of their organizations listed.

  • Also, add Renesas Electronics to the company list

  • Add Phillip Nguyen to the people list

  • Correct "Phillip Lapczynski" to "Philip Lapczynski"

On the Getting Started page

  • Under Item Number 2, Learn more in the Threat Model section. The section is not called “Uptane Threat Model.” Also, the title of the page this links to should also be called “Threat Model” and not “Why Uptane is Needed”

  • Under Item Number 4, the last sentence should read “Learn more in the Uptane Deployment Best Practices document.” It’s not a section.

  • Under Item Number 6, Question 1, last sentence, medical and health care equipment, smart city devices, and aviation.

On the Threat Model page

  • As noted above, change the title of the document (on the page) to Threat Model.

On the Audio Visual Page,

  • Last sentence of the first paragraph needs to be changed “These include virtual programs held in October 2022 and March 2023, an in-person program held in December 2022, and a hybrid program in June 2023.”

  • We also never added the slide presentation from the June 2023 meeting. I have these on my desktop, but I’m not sure how to add them to the new site.

  • The first three bullet points need to be changed from “for the Uptane conference to be held March 31, 2023” to “the Uptane conference held March 31, 2023”

On the Contributing Page

  • Under Code Contributions - I think this has already been reported, but the link under “these development instructions,” is going to the Secure Systems Lab guidelines, when it should be going to the new README.

  • Under Security Audits
    Please remove my Lois' name and email as maintainer.

  • Under History
    2016: The conference should be referred to as “escar Europe”

  • 2019: Revise the following: The Uptane project joins the Linux Foundation's Joint Development Foundation, providing a pathway for ISO standardization of future versions of the Standard.

Priority Level

No response

Proposed Solution (if any)

No response

Related Information

No response

Additional Comments

No response

Adding a "news box" to the home page

We currently have no way to spotlight news and events on the home page of the document. When we have a workshop scheduled or when we release a whitepaper, we should have a way to place these items right where the reader will see them when the site opens up. Is there some way to add a box to the home page that would make such items stand out?

[Bug Report] - Argos CI Screenshots failing at `run yarn playwrite test` step

Describe the bug.

Run yarn playwright test
yarn run v1.22.19
$ /home/runner/work/uptane.github.io/uptane.github.io/node_modules/.bin/playwright test

Error: ENOENT: no such file or directory, open './screenshot.css'

at argos/screenshot.spec.js:10

8 | const sitemapPath = './build/sitemap.xml';
9 | const stylesheetPath = './screenshot.css';

10 | const stylesheet = fs.readFileSync(stylesheetPath).toString();
| ^
11 |
12 | // Wait for hydration, requires Docusaurus v2.4.3+
13 | // Docusaurus adds a once hydrated

at Object.<anonymous> (/home/runner/work/uptane.github.io/uptane.github.io/argos/screenshot.spec.js:[10](https://github.com/uptane/uptane.github.io/actions/runs/6695724126/job/18191913819#step:7:11):23)

Error: No tests found

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Describe the steps to reproduce the behavior.

Happens every time Argos CI Screenshots CI workflow is run.

Expected behavior.

It should run without issue.

Screenshots.

No response

Operating environment

Ubuntu

What browsers are you seeing the problem on?

No response

Additional context

No response

Website Contains Broken Links

Website Contains Broken Links

Broken Link Checker found ⚰️ links on https://uptane.github.io

View Results

Here is list of broken links :

Suggestion for Reworking the History page for a nice interactive timeline

Discussed in #157

Originally posted by PhilPNguy November 30, 2023
I suggest we relocate and make a nicer animation based spot for the "History" page.
It could be an interactive square area on the front page where users go 1 by 1 through the history of Uptane.

We are looking for a suggestion for reworking the project history page into something a little better looking, perhaps an interactive timeline.

This is a pretty cool idea, but maybe too zazzy for Uptane.
https://delikely.eu.org/Automotive-Security-Timeline/

Open to suggestions.

Proposal for Adding "Uptane Contributors" Section to the Website and Workflow Integration

Discussed in #144

Originally posted by Abhijay007 November 17, 2023
Hello Uptane community,

We are considering the addition of a new section on our website dedicated to "Uptane Contributors." Here's a preview of how it would appear:

Uptane Contributors

image

To streamline the process, we are seeking a solution that automates triggers or workflows whenever a new contributor is added. Importantly, we aim to feature not only contributors to the "uptane website contributors" but also contributors from across the entire Uptane community projects on github.

If anyone is aware of an open-source solution that fits our requirements, please share your insights. As a reference, the Moja Global repository has implemented a similar feature on their community website. You can explore it here: Moja Global Community (scroll down to the "Contributors" section). you can find the corresponding repository on GitHub: Moja Global Community Website Repo.

We appreciate any feedback or suggestions you may have on implementing a comparable solution for our community repository.

Is Uptane still funded by DHS?

In the footer on the website and in several other places, we claim Uptane is funded by DHS (present tense). Is this still true? If not, we need to clean out those references so we are not making false claims.

Whether we get a GSoC volunteer or not, I think we need to compile content-based issues that should be addressed sooner rather than later.

Other: Improve UX for website footer

Issue Summary

The footer layout is a little clunky. Please provide suggestions for how can we improve the layout to better make use of the space?
image

Details

No response

Priority Level

No response

Proposed Solution (if any)

No response

Related Information

No response

Additional Comments

No response

Improvement: Fix short descriptions in "Putting Uptane to Work" section

Issue Summary

We need to add short descriptions for the items in the "Putting Uptane to Work" section on the homepage. Right now the text just says "short description of ..."

Details

No response

Priority Level

Medium

Proposed Solution (if any)

No response

Related Information

image

Additional Comments

No response

Website Contains Broken Links

Website Contains Broken Links

Broken Link Checker found ⚰️ links on https://uptane.github.io

View Results

Git Clone dropping error

Describe the error you are facing

For Windows, git clone is dropping an error, due to an invalid path or parameter in the papers/Agenda_3:31_Uptane_Workshop.pdf file

image

even if we download it directly from GitHub :

image

Although it is working fine for the UNIX-based systems, I tried using ( WSL 2)

Possible Solution

Rename the file or remove the : from the file name

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.