-
Notifications
You must be signed in to change notification settings - Fork 347
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
config: T4919: Add support for encrypted config with TPM #1740
Conversation
Can we somehow test this using a simulated TPM like smoketesting in QEmu? Can we also extend it like on Debian by simply using a passphrase to encrypt? |
Should be possible, will investigate and add smoketest if possible.
Do you mean allowing a passphrase to encrypt without using the TPM? If so, I'm not sure how we could implement the passphrase prompt on boot, using a TPM to store a key and have no boot interruption seems the best approach imo. |
virtual tpm available on VMware, not sure about quemu |
Exactly My requirement is like you get in Debian with an encrypted rootfs where you are prompted for a password on bootup from the serial/KVM console. I know this sounds stupid as it does not make the router reboot-safe but imagine a random cloud provider which only supports KVM access and no TPM - you still could encrypt your stuff. One might ask what happens if the router crashes as it would reboot automatically - the answer is simple - it should not crash at all ;) What you think? |
I think best solution for that is to allow the What do you think to that? |
a462c50
to
d90cc5c
Compare
@c-po @sarthurdev is there anything that we can do to move this further? The feature is interesting. |
@zdc Haven't tested it for a while, Bookworm upgrade took priority recently. I think we need to discuss some design choices for TPM support: how to handle image upgrades, default (and user-specified) criteria for verifying integrity, handling decryption failure (or is it up to the end user to ensure devices are reachable in event of failed config load). I am also curious if #1768 is close to merge as it would make the install/upgrade aspect of this PR much easier to deal with. |
I am in agreement with @c-po on being able to manually enter encryption key, especially in virtual environments. There have been some documented instances of virtual hard drives containing data from a previous tenant. A malicious cloud employee could also steal the virtual drive if they thought the data on it was valuable. While a memory capture could lead to encryption key exposure, it's a higher bar to attain than just pulling the virtual disk off the storage network. Would it maybe be prudent to have some kind of message about encryption passphrase use versus TPM use? Things like crypto keys could potentially be stolen if the config were not encrypted at rest. While keys can be rotated, any previous encrypted traffic that may have been captured could then be decrypted with the old key. It may be an annoying extra step for some to have to login to the console with the cloud provider, but it could be very beneficial for some threat models. This would also set VyOS apart from many other networking platforms that generally don't do any configuration encryption at rest. |
Let's merge when 1.4 is branched off. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
@sarthurdev Let us know if the task still in progress |
Will pick this back up after Kea implementation has most issues resolved. |
41bf6ce
to
159b7a9
Compare
@@ -0,0 +1,28 @@ | |||
<?xml version="1.0"?> | |||
<interfaceDefinition> | |||
<node name="encryption"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we put it under set
, together with set system image default-boot
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, do you agree with set system encryption ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only issue with using the set
node, is then encryption load
would need to move to a separate node. set system encryption load
wouldn't really make sense.
<interfaceDefinition> | ||
<node name="encryption"> | ||
<properties> | ||
<help>Manage config encryption</help> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe mention the TPM part explicitly? Manage configuration encryption using TPM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't going to mention TPM explicitly as @c-po has requested that perhaps we can also accept encryption without a TPM, requiring a password instead on boot.
Change Summary
PR to implement how a TPM could be used to provide hardware backed encryption of the /config data.
Types of changes
Related Task(s)
Component(s) name
config
Proposed changes
vyos.tpm
for interacting with TPM device.encryption enable
generates an LUKS encrypted volume and stores one key in the TPM and also provides a recovery key to the user. /config contents is migrated to the volume and is mounted over /config.encryption disable
takes either the TPM key, or prompts for a recovery key to load the volume (if volume not already mounted), migrates config data to /config on rootfs and clears the TPM and removes volume.encryption load
allows for loading the encrypted config volume if VyOS failed to decrypt the volume on-boot.Related PRs:
How to test
Success boot message:
Failed boot message:
(Note: configuration success because VyOS default config.boot is created and loaded)
Installing from ISO over an existing install with an encrypted config:
Op-mode commands:
Checklist: