Commit 03dc73a
committed
feat(security): make composefs verity opt-in via mios.toml [security]
Sealed-image opt-in (gap #1 from the bootc-comparison audit). The
existing 40-composefs-verity.sh wrote /usr/lib/ostree/prepare-root.conf
unconditionally with composefs in fs-verity mode. fs-verity requires
ext4 or btrfs -- on XFS roots (some cloud images, some podman-machine
disks) this bricks the deploy. There was no operator-facing escape
hatch.
Adds [security] table to mios.toml SSOT:
composefs_mode = "verity" | "yes" | "off"
mask_systemd_remount_fs = true | false
- "verity" current behavior (tamper-evident, ext4/btrfs only). Default.
- "yes" composefs read-only /usr without verity (works on XFS too;
upstream FCOS/bootc default).
- "off" skip prepare-root.conf rewrite entirely; honor base image.
automation/40-composefs-verity.sh now:
- Sources lib/packages.sh for the canonical _resolve_mios_toml chain
(so /etc/mios/ + ~/.config/ overrides land here too).
- Inlines a minimal _read_mios_scalar awk helper (the same shape as
get_packages_from_toml -- top-level scalars, strips quotes + inline
comments).
- Branches on composefs_mode and renders the matching prepare-root.conf
body. The "yes" body keeps the [root] / [etc] transient=false stanzas
so the immutable-/usr posture stays intact even without verity.
- Only masks systemd-remount-fs.service when verity is selected AND
mask_systemd_remount_fs is truthy. The "yes" path uses the upstream
mount sequence and doesn't need the mask.
- Logs the resolved mode + whether it backed up an existing config.
No behavior change for existing deployments: default is "verity", which
matches the pre-commit unconditional path. Operators on XFS/cloud
substrates can drop a single override into /etc/mios/mios.toml:
[security]
composefs_mode = "yes"
and the next bootc switch flips to the non-verity path without code
changes.
Verified: bash -n on the rewritten script; tomllib + the awk resolver
both round-trip the new [security] table; the resolver also continues
to read [hwcaps] cleanly (no regression to the existing toml consumers).1 parent 6e5d84f commit 03dc73a
2 files changed
Lines changed: 158 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
4 | 18 | | |
5 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
6 | 74 | | |
7 | 75 | | |
8 | 76 | | |
9 | | - | |
| 77 | + | |
10 | 78 | | |
11 | 79 | | |
12 | 80 | | |
13 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
14 | 88 | | |
15 | 89 | | |
| 90 | + | |
16 | 91 | | |
17 | 92 | | |
18 | 93 | | |
| |||
22 | 97 | | |
23 | 98 | | |
24 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
25 | 118 | | |
26 | | - | |
27 | | - | |
28 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
29 | 127 | | |
30 | | - | |
| 128 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
260 | 311 | | |
261 | 312 | | |
262 | 313 | | |
| |||
0 commit comments