Skip to content

Threat model appendix: use case description#81

Open
jrvanwhy wants to merge 2 commits intotock:masterfrom
jrvanwhy:threat-model-use-cases
Open

Threat model appendix: use case description#81
jrvanwhy wants to merge 2 commits intotock:masterfrom
jrvanwhy:threat-model-use-cases

Conversation

@jrvanwhy
Copy link
Contributor

@jrvanwhy jrvanwhy commented Jan 8, 2026

The threat model speaks very broadly, because it needs to cover all of Tock's use cases. This adds an appendix that is much more specific, listing out specific Tock use cases and describing how the Tock system should be set up for each security model.

The purpose is twofold:

  1. Give users an easy starting point for configuring Tock (and serving as an explanation for how app ID can be used in practice).
  2. Help guide the design of Tock's security mechanisms (e.g. why we support cryptographically-verified app IDs).

Pages as rendered by GitHub:

The threat model speaks very broadly, because it needs to cover all of Tock's use cases. This adds an appendix that is much more specific, listing out individual Tock use cases and describing how the Tock system should be set up for each security model.

The purpose is twofold:

1. Give users an easy starting point for configuring Tock (and serving as an explanation for how app ID can be used in practice).
2. Help guide the design of Tock's security mechanisms (e.g. why we support cryptographically-verified app IDs).
@jrvanwhy jrvanwhy force-pushed the threat-model-use-cases branch from 252891b to 3693493 Compare January 8, 2026 21:09
@jrvanwhy jrvanwhy marked this pull request as ready for review January 8, 2026 21:13
Comment on lines +116 to +118
The AppID checker verifies the signature is valid for the public key. The
application ID for the process is `format || public key` (a contiguous byte
range, `footer[4..40]`, so the appID slice can point into the footer).
Copy link
Contributor

Choose a reason for hiding this comment

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

This is unusual. I think this AppId scheme is to ensure all applets have the same appid and two applets will never run at the same time? I think explicitly calling out why using a scheme that uses the same AppId is actually desirable here would be instructive.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The way I wrote this scheme, for a single developer to have multiple applets they would need to generate multiple private-public keypairs in their PKI.

As an alternative, I can add an "applet ID" field, which would be part of the appID, allowing developers to create multiple applets using a single private-public keypair. I decided to omit that because I thought the simplicity would make this easier to understand, but maybe it's better to have that field?

Copy link
Contributor

Choose a reason for hiding this comment

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

"applet ID" would be in the TBF header? I think based on what it does it can't go in the footer because then it isn't signed and could be changed by anyone.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, applet ID would need to be in a TBF header.

The way I would implement it is I would put it into both a TBF header and the TBF footer. In the footer, I would place it adjacent to the public key so that it can easily be included in the appID slice as well. The credentials checker would need to verify that the copy in the TBF header matches the copy in the TBF footer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or we could remove the sentence "Computing an integrity value in a Credentials Footer MUST NOT include the contents of Footers." from the appID TRD. Then no new TBF header would be required.

Comment on lines +134 to +147
The first range, system apps, is for applications that are part of the operating
system itself. These applications may have special permissions that other
applets do not have (for example, if the system for installing applets uses a
userspace process, that userspace process would have extra permissions). These
applications have hardcoded short IDs, which allows hardcoded ACLs (such as the
syscall filtering table) to refer to them.

The remaining range is for dynamically-installed applets. There are allocated
using a table stored in nonvolatile storage, allowing each app to be assigned a
short ID.

When the kernel loads a process, it checks the tables to identify its short ID.
If the application is not present, it assigns it a new short ID and adds it to
the table in nonvolatile storage.
Copy link
Contributor

Choose a reason for hiding this comment

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

Using the same AppId but different ShortIds is confusing, or I'm missing something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah there's a miscommunication here. There should only be one applet with a particular appID running at any one time (as per the appID TRD), so every process should have a distinct ShortId. But once an applet has been assigned a ShortId, that ShortId should remain in the table (until it has been fully uninstalled), so every execution of that applet should carry the same ShortId.

Or are you saying it's confusing that uninstalling and reinstalling an applet results in different ShortIds? If that's the case, then I don't see the issue.

Comment on lines +174 to +177
The following documents give a sampling of possible use cases for Tock. Each
document describes how Tock can be configured to meet each user's needs and how
that configuration interacts with the threat model.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The following documents give a sampling of possible use cases for Tock. Each
document describes how Tock can be configured to meet each user's needs and how
that configuration interacts with the threat model.
The following documents give a sampling of possible use cases for Tock. Each
document describes how Tock can be configured to meet each user's needs and how
that configuration interacts with the threat model.
These use case guides are intended to be instructive, and not prescriptive. Users with these (or similar) use cases may choose to follow the design outlined in these documents. However, there likely exist other successful designs for these use cases as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

However: "Example Use Case: Manual Local Tock Deployment" matches the primary use cases for most of the boards in the tock/tock repository. Therefore, I think most boards in tock/tock should use that configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants