Skip to content
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

targets: Use online root meta if not found locally #394

Merged
merged 1 commit into from
Apr 16, 2024

Conversation

mike-sul
Copy link
Contributor

If a user has not taken either root or target keys offline, then there are only two root versions in a given factory.
In such a case, the bundle will have no root metadata.
Therefore, to make the 'show' command work properly, the command needs to fetch the latest (i.e., version 2) root metadata from the backend.

If a user has not taken neither root nor targets keys offline then there
are only two root versions in a given factory.
In such the case, the bundle will have no any root
metadata. Therefore, to make the `show` command work properly the
command needs to fetch the latest (i.e. version 2) root meta from the
backend.

Signed-off-by: Mike Sul <[email protected]>
@mike-sul mike-sul requested review from vkhoroz and detsch April 16, 2024 15:31
Copy link
Member

@detsch detsch left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@vkhoroz vkhoroz left a comment

Choose a reason for hiding this comment

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

LGTM

// then this is the valid case - a user has not taken their TUF targets key offline.
// Therefore, instead of failing the command fetches the root meta from the backend.
rootMeta, err = api.TufRootGet(viper.GetString("factory"))
}
Copy link
Member

Choose a reason for hiding this comment

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

Do you mean that TUF root versions 1 and 2 are never included into the update bundle?
This seems strange, but I might be out of context.

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. From the security standpoint of view this the right things to do, otherwise anyone can generate their own chain of TUF keys and put into a bundle. Then, a non-registered device will trust it.
However, we protect our devices from it by pre-provisioning them with the first N root versions...

@mike-sul mike-sul merged commit af8a264 into main Apr 16, 2024
8 checks passed
@mike-sul mike-sul deleted the msul/fix-root-meta-if-no-offline-keys branch April 16, 2024 18:32
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.

3 participants