Skip to content

Secureboot: Image signing verification enhancements #3989

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bhouse-nexthop
Copy link

@bhouse-nexthop bhouse-nexthop commented Jul 21, 2025

What I did

The current signature verification of sonic images assumes the DB Keys are all Root CAs. The secureboot standard says nothing about this, the DBKeys are explicitly trusted by signing them with the KEK, and that signing method does not follow the standard X.509 PKI architecture. Therefore the DB Key is not guaranteed to be a CA Root (aka not self-signed). It is possible the DB Key was created as an intermediate, but since it is explicitly trusted that is ok.

Fixes sonic-net/sonic-buildimage#23406

How I did it

This adds this explicit trust of the DB Key as a secondary signing verification if the original verification fails. It disables looking inside the pkcs7 container for any keys at all and assumes the key specified is the exact key for the signature.

How to verify it

Build secureboot image signed with a DB Key that is not self-signed, then run through the sonic-installer install with that image and see the verification succeeds.

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@bhouse-nexthop
Copy link
Author

@ycoheNvidia since you contributed the signing validation for sonic images, can you review this PR modification?

@ycoheNvidia
Copy link
Contributor

Adding @davidpil2002 @DavidZagury @Yarden-Z as well

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

bradh352 added 2 commits July 23, 2025 08:02
The DB Key is not guaranteed to be a CARoot.  It is possible to have
the DB Key be an intermediate as it is trusted via the EFI signing
methods which do not use the normal PKI methodology.

This adds a secondary signing verification, the original plus the
above described method.

Signed-off-by: Brad House <[email protected]>
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@tjchadaga tjchadaga requested a review from qiluo-msft July 30, 2025 15:46
@tjchadaga
Copy link
Contributor

@qiluo-msft - could you please help with the review?

@ycoheNvidia ycoheNvidia self-requested a review August 3, 2025 11:16
Copy link
Contributor

@ycoheNvidia ycoheNvidia left a comment

Choose a reason for hiding this comment

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

Looks fine to me

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.

Enhancement: Secureboot production signing of kernel modules using ephemeral keys + bug fixes
5 participants