-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
storage: Tang keyserver and passphrase management for Stratis #18818
Conversation
A random thing I just learned: when adding a block device, all unlocking tokens must be available: passphrase and key server. If one of them is missing (wrong passphrase or key server not reachable), adding the block device will fail with this misleading error message: "Neither the key in the kernel keyring nor Clevis could be used to perform encryption |
a3432b6
to
a7d9504
Compare
About Stratis, Tang, and reboots:
Thus:
Alternatively, we might make fstab-setup more robust:
This would make things a bit simpler for Cockpit. (We still need to force netdev for tanged filesystems, but don't need to worry about which setup unit to use.) |
7311dcc
to
7b838e5
Compare
7b838e5
to
f4b0748
Compare
f4b0748
to
1b89e40
Compare
35c9daf
to
0121bca
Compare
ff025d1
to
c1b5523
Compare
Alright, I totally missed the "clevis_info" argument to CreatePool. Stratis allows the creation of a pool without a passphrase but clevis_info instead. We should support this here as well, and also make sure that pools without passphrases work as expected. Adding a passphrase to a pool without one should probably be part of #18842. |
Ah, heck, let's do it all here. It's all connected. |
c1b5523
to
eadabc0
Compare
5fa3f8f
to
8355d51
Compare
8355d51
to
c9f9048
Compare
c9f9048
to
2929c91
Compare
@garrett , please take another look. New demo: https://youtu.be/HFCzWqqRXHQ I have kept the "Add" / "Remove"` terminology for passphrases and keyservers. I couldn't think of anything better... can you? |
fcf8d4a
to
7ce862c
Compare
This seems to be the plan, see stratis-storage/stratisd#3348. With that solution, "nofail" is good enough, and since it is the default used by Cockpit, we probably don't need to do anything special. |
169c51f
to
4f3ab2f
Compare
The code that constructs the dialog does not know whether SHA-1 is needed, unfortunately. This was worked on in #18908 and has now been merged. |
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.
Is my comment correct about the translation? Otherwise LGTM.
4f3ab2f
to
8d39ae7
Compare
Hmm, now there is a failure on Arch:
|
Ah, this is because Arch now has stratisd 3.5. @jelly, looks like clevis needs to be udpated as well... |
8d39ae7
to
1e5d5bf
Compare
1e5d5bf
to
34c38fb
Compare
Seems fixed. |
return client.stratis_manager.CreatePool(name, [false, 0], | ||
devs, | ||
key_desc ? [true, key_desc] : [false, ""], | ||
[false, ["", ""]]); | ||
clevis_info ? [true, clevis_info] : [false, ["", ""]]); |
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.
This added line is not executed by any test. Details
Title: _("Add passphrase"), | ||
Fields: [ | ||
PassInput("passphrase", _("Passphrase"), | ||
{ validate: val => !val.length && _("Passphrase cannot be empty") }), |
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.
This added line is not executed by any test. Details
PassInput("passphrase", _("Passphrase"), | ||
{ validate: val => !val.length && _("Passphrase cannot be empty") }), | ||
PassInput("passphrase2", _("Confirm"), | ||
{ validate: (val, vals) => vals.passphrase.length && vals.passphrase != val && _("Passphrases do not match") }) |
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.
This added line is not executed by any test. Details
PassInput("old_passphrase", _("Old passphrase"), | ||
{ | ||
visible: vals => !keydesc_set, | ||
validate: val => !val.length && _("Passphrase cannot be empty") |
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.
This added line is not executed by any test. Details
validate: val => !val.length && _("Passphrase cannot be empty") | ||
}), | ||
PassInput("new_passphrase", _("New passphrase"), | ||
{ validate: val => !val.length && _("Passphrase cannot be empty") }), |
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.
This added line is not executed by any test. Details
return start("clevis").catch(unlock_with_keyring); | ||
} else if (!key_desc && clevis_info) { | ||
return start("clevis"); | ||
} else if (key_desc && !clevis_info) { |
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.
This added line is not executed by any test. Details
|
||
const encrypted = key_desc || clevis_info; | ||
const can_tang = encrypted && (!clevis_info || clevis_info[0] == "tang"); | ||
const tang_url = (can_tang && clevis_info) ? JSON.parse(clevis_info[1]).url : null; |
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.
This added line is not executed by any test. Details
empty_warning: _("No block devices are available."), | ||
validate: function (disks) { | ||
if (disks.length === 0) | ||
return _("At least one block device is needed."); |
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.
This added line is not executed by any test. Details
}, | ||
spaces: get_available_spaces(client) | ||
}), | ||
CheckBoxes("encrypt_pass", client.features.stratis_crypto_binding ? _("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.
This added line is not executed by any test. Details
tag: "on", | ||
title: (client.features.stratis_crypto_binding | ||
? _("Use a passphrase") | ||
: _("Encrypt data")) |
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.
This added line is not executed by any test. Details
Demo: https://youtu.be/HFCzWqqRXHQ
Storage: Stratis pools can now be bound to a Tang server
In addition to a passphrase (or instead of it), a Stratis pool can now use Tang server for encryption.