feat: add support for ephemeral-encryption-keys - #999
Open
piyush-jena wants to merge 4 commits into
Open
Conversation
jpculp
reviewed
Aug 6, 2026
piyush-jena
commented
Aug 7, 2026
piyush-jena
marked this pull request as draft
August 7, 2026 21:13
piyush-jena
force-pushed
the
ukis/core-kit
branch
7 times, most recently
from
August 12, 2026 16:36
5a99cea to
465d33c
Compare
jmt-lab
requested changes
Aug 12, 2026
piyush-jena
force-pushed
the
ukis/core-kit
branch
5 times, most recently
from
August 14, 2026 07:43
99fd03a to
31bf6bb
Compare
arnaldo2792
marked this pull request as ready for review
August 14, 2026 21:30
arnaldo2792
approved these changes
Aug 14, 2026
ginglis13
reviewed
Aug 14, 2026
| Conflicts=umount.target | ||
| After=selinux-policy-files.service | ||
| Wants=selinux-policy-files.service | ||
| Before=encrypt-datastore.service encrypt-localfs.service encrypt-privatefs.service |
Contributor
There was a problem hiding this comment.
Suggested change
| Before=encrypt-datastore.service encrypt-localfs.service encrypt-privatefs.service | |
| Before=encrypt-datastore.service encrypt-local-fs.service encrypt-private-fs.service |
Contributor
There was a problem hiding this comment.
Similar error in the [Install] section below
ginglis13
reviewed
Aug 14, 2026
Comment on lines
+248
to
+254
| // We do not write the marker file in case ephemeral encryption keys feature is enabled. This | ||
| // makes sure that post a reboot we repopulate the user-data in the datastore. | ||
| if is_ephemeral_encryption_keys_enabled { | ||
| fs::write(MARKER_FILE, "").unwrap_or_else(|e| { | ||
| warn!("Failed to create marker file {MARKER_FILE}, may unexpectedly run again: {e}") | ||
| }); | ||
| } |
Contributor
There was a problem hiding this comment.
The comment doesn't match the logic here -
We do not write the marker file in case ephemeral encryption keys feature is enabled.
if is_ephemeral_encryption_keys_enabled -> write the file
ginglis13
reviewed
Aug 14, 2026
Contributor
There was a problem hiding this comment.
This file doesn't appear to be used
arnaldo2792
self-requested a review
August 14, 2026 22:48
jmt-lab
approved these changes
Aug 14, 2026
Signed-off-by: Piyush Jena <jepiyush@amazon.com>
Signed-off-by: Piyush Jena <jepiyush@amazon.com> Co-authored-by: Vighnesh Maheshwari <vighmah@amazon.com>
Signed-off-by: Piyush Jena <jepiyush@amazon.com> Co-authored-by: Vighnesh Maheshwari <vighmah@amazon.com>
Signed-off-by: Piyush Jena <jepiyush@amazon.com> Co-authored-by: Vighnesh Maheshwari <vighmah@amazon.com>
Contributor
|
⬆️ Updated following the comment and retested: [root@admin]# sheltie
bash-5.2# ls -lZ /run/rottweiler
total 0
bash-5.2# ls -lZ /run | grep rottweiler
drwx------. 2 root root system_u:object_r:private_t:s0 40 Aug 15 04:17 rottweiler
bash-5.2# ls -lia /run/rottweiler/
total 0
1 drwx------. 2 root root 40 Aug 15 04:17 .
1 drwxr-xr-x. 21 root root 500 Aug 15 04:17 ..
bash-5.2# lsblk -o NAME,TYPE,FSTYPE,MOUNTPOINT
NAME TYPE FSTYPE MOUNTPOINT
nvme1n1 disk
`-nvme1n1p1 part crypto_LUKS
`-BOTTLEROCKET-DATA crypt xfs /local
nvme0n1 disk
|-nvme0n1p1 part
|-nvme0n1p2 part vfat
|-nvme0n1p3 part vfat /boot
|-nvme0n1p4 part erofs
|-nvme0n1p5 part DM_verity_hash
|-nvme0n1p6 part
|-nvme0n1p7 part crypto_LUKS
| `-BOTTLEROCKET-PRIVATE crypt ext4 /var/lib/bottlerocket
`-nvme0n1p8 part
bash-5.2# apiclient lockdown
04:19:26 [INFO] Lockdown completed
bash-5.2# apiclient get settings.motd
Failed to get settings: Failed GET request to '/?prefix=settings.motd': Status 500 when GETing /?prefix=settings.motd: Data store error during get_prefix 'settings.motd' for Live: Data store integrity violation at /var/lib/bottlerocket/datastore/current/live: Live datastore missing
bash-5.2# systemctl --failed
UNIT LOAD ACTIVE SUB DESCRIPTION
0 loaded units listed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes:
tmpfs(/run) instead of the keystore and deleted after unlock.LUKS2cipher. Because the encryption key is temporary, we format the partition every boot (with the same parameters) and re-encrypt every boot.fscrypt. This requires an additional fs feature to be enabled (encrypt) which we pass in the previous step (or usingtune2fsin case of data partition).systemd-makefs. We force the reformat by runningwipefsfirst. This deletes all fs related signatures trickingsystemd-makefsinto reformatting and avoiding the additional overhead of writing 0s to the entire partition.early-boot-configinto populating the datastore every boot (because we format the private partition every boot).Testing done:
private_tsettings.motdand in every boot its the updated valueuser-data
output:
A second consequence of reformatting data partition is that the journal for previous boot is lost which was also checked.
Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.