Repository navigation
feat: add support for ephemeral-encryption-keys - #999
Conversation
5a99cea to
465d33c
Compare
99fd03a to
31bf6bb
Compare
| Conflicts=umount.target | ||
| After=selinux-policy-files.service | ||
| Wants=selinux-policy-files.service | ||
| Before=encrypt-datastore.service encrypt-localfs.service encrypt-privatefs.service |
There was a problem hiding this comment.
| Before=encrypt-datastore.service encrypt-localfs.service encrypt-privatefs.service | |
| Before=encrypt-datastore.service encrypt-local-fs.service encrypt-private-fs.service |
There was a problem hiding this comment.
Similar error in the [Install] section below
| // 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}") | ||
| }); | ||
| } |
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
There was a problem hiding this comment.
This file doesn't appear to be used
|
⬆️ 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. |
Signed-off-by: Piyush Jena <jepiyush@amazon.com>
Signed-off-by: Piyush Jena <jepiyush@amazon.com> Co-authored-by: Vighnesh Maheshwari <vighmah@amazon.com>
3a8352c to
700e8fa
Compare
|
Removed In the first boot we get the following journal logs. This shows that the bootstrap-commands run every time. |
|
In |
|
Tried changing the settings in ecs-5-fips and post reboot I found that only settings through user-data persisted. |
Signed-off-by: Piyush Jena <jepiyush@amazon.com> Co-authored-by: Vighnesh Maheshwari <vighmah@amazon.com>
700e8fa to
0f24565
Compare
|
force push addresses the above comments. |
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.