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

resin-init-flasher: with secure boot, authenticate the inner image #3578

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

mtoman
Copy link
Contributor

@mtoman mtoman commented Dec 10, 2024

At this moment resin-init-flasher just takes whatever image lies in /opt and dd's it to the target drive. This is fine for general use, but with secure boot enabled, we want to perform at least basic authentication of the image being written.

This patch gets the image signed at build time and makes flasher verify the signature against a key built-in the kernel trust store. At this very moment it fails hard if the signature does not match, but this may change in the future. Technically we only want to know if we are about to flash a balena-provided image or not, we might want to support both but behave slightly differently in each scenario.


Contributor checklist

Reviewer Guidelines

  • When submitting a review, please pick:
    • 'Approve' if this change would be acceptable in the codebase (even if there are minor or cosmetic tweaks that could be improved).
    • 'Request Changes' if this change would not be acceptable in our codebase (e.g. bugs, changes that will make development harder in future, security/performance issues, etc).
    • 'Comment' if you don't feel you have enough information to decide either way (e.g. if you have major questions, or you don't understand the context of the change sufficiently to fully review yourself, but want to make a comment)

@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman had a problem deploying to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Failure
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 10, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 16, 2024 08:56 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 16, 2024 08:56 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 16, 2024 08:56 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 16, 2024 08:56 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 16, 2024 08:56 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 16, 2024 08:56 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 16, 2024 08:56 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 16, 2024 08:56 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 16, 2024 08:56 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 16, 2024 08:56 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 16, 2024 08:56 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 16, 2024 08:56 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 16, 2024 08:56 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 16, 2024 08:56 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 16, 2024 08:56 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-cloud.com December 16, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-cloud.com December 16, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-cloud.com December 16, 2024 09:32 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-cloud.com December 16, 2024 09:35 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-cloud.com December 16, 2024 09:35 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-cloud.com December 16, 2024 09:35 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-cloud.com December 16, 2024 10:05 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-cloud.com December 16, 2024 10:05 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-cloud.com December 16, 2024 13:26 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 16, 2024 13:27 — with GitHub Actions Inactive
@mtoman mtoman temporarily deployed to balena-staging.com December 16, 2024 13:27 — with GitHub Actions Inactive
@flowzone-app flowzone-app bot merged commit bbb6f85 into master Dec 16, 2024
163 of 165 checks passed
@flowzone-app flowzone-app bot deleted the mtoman/flasher-verify-image branch December 16, 2024 14:05
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