Foxboron / sbctl

:computer: :lock: :key: Secure Boot key manager
MIT License
1.46k stars 82 forks source link

Allow enrolling custom db and KEK certs #217

Closed Cornelicorn closed 1 year ago

Cornelicorn commented 1 year ago

Closes #190.

Cornelicorn commented 1 year ago

The hardcoded Owner UUID is just a placeholder. I'm not sure if the Owner UUID should be dynamically associated with every certificate, set once for all custom certificates (statically in sbctl or read from the filesystem as the certificates) or the existing UUID (/usr/share/secureboot/GUID) should be reused

Foxboron commented 1 year ago

I think utilizing a custom GUID for this is fine. It makes it easier to make assumptions on when looking at the signature database.

Cornelicorn commented 1 year ago

I think utilizing a custom GUID for this is fine. It makes it easier to make assumptions on when looking at the signature database.

Ok, I put in a newly generated UUID (instead of the tpm-eventlog one incremented by 1).

Foxboron commented 1 year ago

If you want an additional challenge, you could try to write a test for this using the virtual filesystem layer sbctl has :)

Example: https://github.com/Foxboron/sbctl/blob/master/cmd/sbctl/status_test.go

If you don't have time that is fine as well, but getting more test coverage would be cool.

Cornelicorn commented 1 year ago

You mean a test to check that enrolling custom certificates works?

Foxboron commented 1 year ago

Yep :)

Cornelicorn commented 1 year ago

After looking through the testing suite, I don't think that's quite doable for me right now (It's the first time for me to work with go), sorry.

Foxboron commented 1 year ago

That is fine :) No worries!

Cornelicorn commented 1 year ago

I think GitHub still wants a separate approval for the workflow runs, besides the PR review.

Foxboron commented 1 year ago

Thanks for implementing this :)