I’m in the process of trying to understand and explore the key management side of secure boot on an IMX8MP in order to start considering a roadmap and technical plans for our implementation.
As it is I understand this is much like a standard PKI tree where there is a root certificate, four subordinate root keys (SRK) and an initial set of four image signing keys (SGKs), and that the iMX8 has a limit of four SRK hashes which can be stored in the OTP area, giving you up to three possible keys that can be revoked in case of compromise or other security reasons.
The documentation seems to suggest it is possible to generate additional SGKs and SRKs in your PKI tree, and I am trying to understand the exact use case here. It seems that generating additional SRKs (beyond 4) isn’t typically useful since those must have their hashes fused in the SoC to be valid. Is the intent here that if one key is compromised you might generate a 5th SRK and start fusing new devices with SRKs 2 thru 5 and omitting the compromised SRK1?
Additional SGKs are also intriguing in terms of PKI “best practices”, but really not elaborated on what or how they are intended to be used.
I’m looking for additional information on the following points that aren’t very clear to me right now:
- What’s the minimal set of items required to sign during the build? I would guess either only the desired SGK (or SRK?). The most secure approach would be to avoid storing all 4 SRKs and SGKs in the same location and only expose the single one currently in use, but the documentation seems to imply you maintain your entire key PKI tree alongside the build environment somewhere which means if one key is compromised, they probably all are.
- If only the SGK is required during signing, it is possible (and advisable) to generate one SGK for each build agent, such that should one SGK be compromised, that particular SGK can be invalidated via PKI and replaced without needing to discard the entire SRK?
- It looks like the layer configuration asks for the SRK index, but my current understanding here is that this is necessary to instruct the AHAB which key index to check against, not necessarily that this SRK must be present during signing
- The CST asks for certificate validity period. A response from NXP linked elsewhere here indicates this is not a concern as the CST will still sign and make bootable images even after certificate expiry and that AHAB does not verify the expiry either. But is there any real reason not to just specify an expiry significantly beyond the anticipated product lifespan (e.g. 30 years)?
Tangentially related to secure boot/signing:
- Closing the device enables a hardened u-boot which restricts access to certain commands. I am guessing that this means custom u-boot scripts that expect those commands would no longer function. Or is it possible to have a concept of a “signed” u-boot script which may retain access to those restricted commands while disallowing them from the console or other unauthenticated sources?
Thanks for the input!
~BW908
