Skip to content
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

kola/tests/ignition: add luks test #311

Merged
merged 2 commits into from
Apr 11, 2022
Merged

kola/tests/ignition: add luks test #311

merged 2 commits into from
Apr 11, 2022

Conversation

tormath1
Copy link
Contributor

@tormath1 tormath1 commented Mar 24, 2022

Ignition will set up a key-file based LUKS2 volume on a secondary disk
added to the instance.

Signed-off-by: Mathieu Tortuyaux [email protected]


To be tested with: flatcar-archive/coreos-overlay#1760 - tested here: http://jenkins.infra.kinvolk.io:8080/job/os/job/kola/job/qemu/4005/

  • Changelog entries added in the respective changelog/ directory (user-facing change, bug fix, security fix, update)

@tormath1 tormath1 self-assigned this Mar 24, 2022
"storage": {
"luks": [{
"name": "data",
"device": "/dev/vdb"
Copy link
Member

Choose a reason for hiding this comment

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

Just an idea if we want to avoid tying it to qemu, we could also use /dev/disk/by-partlabel/USR-B or /dev/disk/by-partlabel/OEM-CONFIG.
Later when clevis and tpm2 may be added we either have to add a software tpm to qemu or use another cloud platform.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

/dev/disk/by-partlabel/USR-B sounds good - let's try that. Thanks for the suggestion !

Ignition will set up a key-file based LUKS2 volume on a secondary disk
added to the instance.

Signed-off-by: Mathieu Tortuyaux <[email protected]>
Signed-off-by: Mathieu Tortuyaux <[email protected]>
@tormath1 tormath1 marked this pull request as ready for review March 24, 2022 13:29
@tormath1 tormath1 requested a review from a team March 24, 2022 13:40
"ignition": {"version": "3.2.0"},
"storage": {
"luks": [{
"name": "data",
Copy link
Member

Choose a reason for hiding this comment

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

What key is used now and would it unlock on reboot?

Copy link
Contributor Author

@tormath1 tormath1 Mar 24, 2022

Choose a reason for hiding this comment

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

According to the codebase, the key should be generated and persisted if not key has been provided but I don't know where:

sudo cat /var/run/ignition/state | jq .luksPersistKeyFiles
null

EDIT: this is the state file generated at the end of the ignition run, luksPersistKeyFiles is cleared right after the /etc/crypttab file has been generated.

Copy link
Contributor Author

@tormath1 tormath1 Mar 24, 2022

Choose a reason for hiding this comment

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

Key is persisted in /etc/luks/data:

sudo cat /etc/luks/data
e12a2700e32fb963787e922c12503f42ae5c05cb2...

and with the following entry it's being decrypted automatically:

sudo cat /etc/crypttab
data UUID=65df69d5-9a99-4f3b-a1ec-b38570bd170f /etc/luks/data luks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pothos what do you think of providing some documentation around this ⬆️

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, maybe the upstream spec explanation should be improved

@tormath1
Copy link
Contributor Author

moved this PR in "blocked" column as it requires a new release. :)

@tormath1 tormath1 merged commit ad4af2f into flatcar-master Apr 11, 2022
@tormath1 tormath1 deleted the tormath1/luks branch April 11, 2022 11:07
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.

2 participants