Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f7a9084
feat: dedicated verity hash partitions, UUID-based boot, and trident …
bfjelds Jun 1, 2026
f48bd11
feat: move verity slot identity into PARTUUID-based UKI addons
bfjelds Jun 1, 2026
3f37071
fix: restore UUID validation, move mount.usr to main UKI, reject non-…
bfjelds Jun 5, 2026
3857985
fix: harden jq lookups, validate JSON structure, improve temp cleanup
bfjelds Jun 5, 2026
08a261e
Re-enable SELinux policy minimization
bfjelds Jul 13, 2026
b396009
fix: address Copilot review feedback on A/B verity boot
bfjelds Jul 14, 2026
159dd99
fix: write FS UUID in both verity modes; unify verity paths
bfjelds Jul 14, 2026
9e2d158
fix: raise InvalidLayout for missing verity_hash partition reference
bfjelds Jul 14, 2026
625a18a
fix: drop unused 'count' local in _lookup_partuuid
bfjelds Jul 14, 2026
566a92f
fix: normalize verity_hash cross-reference to str before lookup
bfjelds Jul 14, 2026
6485eb7
Increase UKI ESP size from 128 MiB to 256 MiB
bfjelds Jul 19, 2026
2e17ae6
fix: address PR #28 review comments
bfjelds Jul 20, 2026
1f7abae
Revert grub verity-hash die back to pre-existing warn
bfjelds Jul 20, 2026
5b82902
fix: drop jq -e in _lookup_partuuid so explicit null check runs
bfjelds Jul 20, 2026
aa12a3e
uki: add arm64 test-image device-timeout addon
bfjelds Jul 21, 2026
8b072ba
Address review: harden UKI timeout addon + tridentd.socket enablement
bfjelds Jul 22, 2026
a0fc553
Address review: fail fast on empty verity_hash in disk_util Verity
bfjelds Jul 22, 2026
e28a115
Address review: guard ukify build under strict mode; genericize FS UU…
bfjelds Jul 22, 2026
3e502b5
Address review: use sudo rm -rf for ukify temp-dir cleanup
bfjelds Jul 22, 2026
8cdc0c7
acl-grub: use dedicated /usr verity hash partitions, consistent with UKI
Jul 23, 2026
97fcc37
vm_image_util: extend device-init timeout to GRUB arm64 test images too
Jul 24, 2026
1e0b995
grub timeout override: fail if sed substitution does not take effect
bfjelds Jul 24, 2026
1528eb5
validate_qemu: avoid pipefail/SIGPIPE race in libvirt network active …
bfjelds Jul 31, 2026
abea204
rpm mode: disable auditd.service by default
bfjelds Aug 6, 2026
a4ac985
rpm mode: install trident-acl-agent instead of trident
bfjelds Aug 6, 2026
c59aa94
include trident RPM (not trident-acl-agent) initially
bfjelds Aug 24, 2026
41b7f26
Address PR #28 review feedback
bfjelds Aug 27, 2026
1f81d57
rpm mode: uninstall auditd instead of just disabling it
bfjelds Aug 28, 2026
fee4ee4
prod_image_util.sh: initialize rootdev/usrdev to avoid unbound-var crash
bfjelds Aug 28, 2026
c46dc7f
uki_install.sh: rename verity slot addons to slot-*.addon.efi, add ac…
bfjelds Aug 28, 2026
6a3c132
uki_install.sh: fix stray trailing slash in doc comment
bfjelds Aug 28, 2026
8a450f2
Merge pull request #64 from microsoft/user/bfjelds/acl-slot-addon-rename
bfjelds Aug 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions acl/docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ ACL's primary boot path uses **systemd-boot** with **Unified Kernel Images (UKI)

The `/usr` partition (USR-A) is a read-only btrfs filesystem with zstd compression. **dm-verity** provides block-level integrity verification:

- The verity hash tree is appended to the USR partition data.
- At boot, `systemd-veritysetup` activates the verity device using kernel command-line parameters embedded in the UKI: `systemd.verity_usr_data`, `systemd.verity_usr_hash`, and `systemd.verity_usr_options=hash-offset=<N>,panic-on-corruption`.
- The verity hash tree is stored in a dedicated hash partition (HASH-A, immediately following USR-A on disk).
- At boot, `systemd-veritysetup` activates the verity device using slot-specific parameters delivered via a per-slot systemd-stub addon: `systemd.verity_usr_data=PARTUUID=<usr-data-partition>`, `systemd.verity_usr_hash=PARTUUID=<usr-hash-partition>`, and `systemd.verity_usr_options=panic-on-corruption`.
- The main UKI cmdline stays slot-independent (`mount.usr=/dev/mapper/usr`); Trident switches slots by swapping which addon is active in `<uki>.efi.extra.d/`, so the same signed UKI boots either A or B. (The secondary GRUB boot path instead builds the verity cmdline from filesystem/verity UUIDs, `UUID=<btrfs-uuid>` / `UUID=<verity-uuid>`.)
- Any corruption of `/usr` causes an immediate kernel panic, preventing the system from running a tampered image.

The A/B partition scheme (USR-A / USR-B) enables safe updates: the inactive slot is written, verified, and then atomically switched on reboot.
Expand Down
7 changes: 6 additions & 1 deletion acl/validate/validate_qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ ensure_libvirt_network() {
return 1
fi
fi
if ! virsh net-info default 2>/dev/null | grep -q 'Active:.*yes'; then
# Capture output first instead of piping directly into grep: under `set -o pipefail`
# (inherited from validate_common.sh, since this file is sourced not executed),
# grep -q can exit as soon as it matches while virsh is still writing, causing a
# SIGPIPE in virsh and a false pipeline failure even though the pattern matched.
net_info="$(virsh net-info default 2>/dev/null)"
if ! grep -q 'Active:.*yes' <<< "$net_info"; then
info "Starting libvirt default network..."
if sudo virsh net-start default; then
sudo virsh net-autostart default 2>/dev/null || true
Expand Down
11 changes: 11 additions & 0 deletions build_library/build_image_util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,8 @@ EOF

"${BUILD_LIBRARY_DIR}/disk_util" --disk_layout="${disk_layout}" --arch="${BOARD}" verity \
--root_hash="${BUILD_DIR}/${image_name%.bin}_verity.txt" \
--verity_uuid="${BUILD_DIR}/${image_name%.bin}_verity_uuid.txt" \
--fs_uuid="${BUILD_DIR}/${image_name%.bin}_fs_uuid.txt" \
"${BUILD_DIR}/${image_name}"

# Magic alert! Root hash injection works by writing the hash value to a
Expand Down Expand Up @@ -953,6 +955,15 @@ EOF
if [[ -f "${verity_hash_file}" ]]; then
bootloader_args+=(--verity_hash="${verity_hash_file}")
fi
# Pass UUID files for UUID-based cmdline construction
local verity_uuid_file="${BUILD_DIR}/${image_name%.bin}_verity_uuid.txt"
if [[ -f "${verity_uuid_file}" ]]; then
bootloader_args+=(--verity_uuid="${verity_uuid_file}")
fi
Comment thread
bfjelds marked this conversation as resolved.
local fs_uuid_file="${BUILD_DIR}/${image_name%.bin}_fs_uuid.txt"
if [[ -f "${fs_uuid_file}" ]]; then
bootloader_args+=(--fs_uuid="${fs_uuid_file}")
fi
fi
else
bootloader_args+=(--noverity)
Expand Down
42 changes: 32 additions & 10 deletions build_library/disk_layout.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,38 @@
"fs_type":"btrfs",
"fs_compression":"zstd",
"mount":"/usr",
"verity_hash":"4",
Comment thread
bfjelds marked this conversation as resolved.
Comment thread
bfjelds marked this conversation as resolved.
"legacy_verity_offset":true,
"features": ["prioritize", "verity"]
},
"4":{
"label":"HASH-A",
"uuid":"1fae528b-6baf-4efc-a226-2a23f9291ce6",
Comment thread
bfjelds marked this conversation as resolved.
"type":"dps-usr-verity",
"blocks":"20480"
},
"5":{
"label":"USR-B",
"uuid":"e03dd35c-7c2d-4a47-b3fe-27f15780a57c",
"type":"flatcar-rootfs",
"blocks":"2097152",
"fs_blocks":"262144"
"fs_blocks":"262144",
"verity_hash":"6",
"legacy_verity_offset":true
},
"5":{
"6":{
"label":"HASH-B",
"uuid":"accb60b1-1d72-4e05-9363-6fd51e2ce788",
Comment thread
bfjelds marked this conversation as resolved.
"type":"dps-usr-verity",
"blocks":"20480"
},
"7":{
"label":"ROOT-C",
"uuid":"d82521b4-07ac-4f1c-8840-ddefedc332f3",
"type":"blank",
"blocks":"0"
},
"6":{
"8":{
Comment thread
bfjelds marked this conversation as resolved.
"label":"OEM",
"fs_label":"OEM",
"type":"data",
Expand All @@ -56,17 +72,17 @@
"fs_compression":"zlib",
"mount":"/oem"
},
"7":{
"9":{
"label":"OEM-CONFIG",
"type":"flatcar-reserved",
"blocks":"131072"
},
"8":{
"10":{
"type":"blank",
"label":"flatcar-reserved",
"blocks":"0"
},
"9":{
"11":{
Comment thread
bfjelds marked this conversation as resolved.
"label":"ROOT",
"fs_label":"ROOT",
"type":"dps-root",
Expand All @@ -76,28 +92,28 @@
}
},
"vm":{
"9":{
"11":{
"label":"ROOT",
"fs_label":"ROOT",
"blocks":"12943360"
}
},
"azure":{
"9":{
"11":{
"label":"ROOT",
"fs_label":"ROOT",
"blocks":"58875904"
}
},
"vagrant":{
"9":{
"11":{
"label":"ROOT",
"fs_label":"ROOT",
"blocks":"33845248"
}
},
"onmetal":{
"7":{
"9":{
"label":"config-2",
"fs_label":"config-2",
"type":"data",
Expand Down Expand Up @@ -130,6 +146,12 @@
"type":"blank"
},
"9":{
"type":"blank"
},
"10":{
"type":"blank"
},
"11":{
"label":"ROOT",
"fs_label":"ROOT",
"type":"0fc63daf-8483-4772-8e79-3d69d8477de4",
Expand Down
38 changes: 29 additions & 9 deletions build_library/disk_layout_uki.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"layouts": {
"base": {
"1": {
"_comment": "128 MiB -> 192 MiB (blocks are 512-byte sectors). UKI boot keeps kernel+initramfs on the ESP, and the acl-t UKI rebuilt by Image Customizer needs more headroom than stock.",
"_comment": "128 MiB -> 256 MiB (blocks are 512-byte sectors). UKI boot keeps kernel+initramfs on the ESP; the acl-t UKI rebuilt by Image Customizer and Trident A/B update addons both need more headroom than stock.",
"label": "EFI-SYSTEM",
"fs_label": "EFI-SYSTEM",
"type": "efi",
"blocks": "393216",
"blocks": "524288",
"fs_type": "vfat",
"mount": "/boot",
"features": []
Expand All @@ -24,23 +24,37 @@
"uuid": "7130c94a-213a-4e5a-8e26-6cce9662f132",
"type": "flatcar-rootfs",
"blocks": "2097152",
"fs_blocks": "260094",
"fs_blocks": "262144",
"fs_type": "btrfs",
"fs_compression": "zstd",
"mount": "/usr",
"verity_hash": "3",
"features": [
"prioritize",
"verity"
]
},
"3": {
"label": "HASH-A",
"uuid": "b736baf1-cdb4-4535-beba-ddaaa30ad7b7",
"type": "dps-usr-verity",
"blocks": "20480"
},
"4": {
"label": "USR-B",
"uuid": "e03dd35c-7c2d-4a47-b3fe-27f15780a57c",
"type": "flatcar-rootfs",
"blocks": "2097152",
"fs_blocks": "262144"
"fs_blocks": "262144",
"verity_hash": "5"
},
"4": {
"5": {
"label": "HASH-B",
"uuid": "35bdf78b-c453-4661-98e6-f834f534ef5b",
"type": "dps-usr-verity",
"blocks": "20480"
},
"6": {
"label": "OEM",
"fs_label": "OEM",
"type": "data",
Expand All @@ -49,7 +63,7 @@
"fs_compression": "zlib",
"mount": "/oem"
},
"5": {
"7": {
"label": "ROOT",
"fs_label": "ROOT",
"type": "dps-root",
Expand All @@ -59,21 +73,21 @@
}
},
"vm": {
"5": {
"7": {
"label": "ROOT",
"fs_label": "ROOT",
"blocks": "12943360"
}
},
"azure": {
"5": {
"7": {
"label": "ROOT",
"fs_label": "ROOT",
"blocks": "58875904"
}
},
"vagrant": {
"5": {
"7": {
"label": "ROOT",
"fs_label": "ROOT",
"blocks": "33845248"
Expand All @@ -93,6 +107,12 @@
"type": "blank"
},
"5": {
"type": "blank"
},
"6": {
"type": "blank"
},
"7": {
"label": "ROOT",
"fs_label": "ROOT",
"type": "0fc63daf-8483-4772-8e79-3d69d8477de4",
Expand Down
Loading
Loading