Distrust incident CA roots in Bionic and Focal workers #1275
<!-- ccr-overview-v2 -->
🟢 Approval recommended
The mitigation is narrowly scoped, includes regression coverage for both worker architectures, and has no unresolved review findings.
No open issues 🎉
<details>
<summary><strong>What changed in this PR</strong></summary>
This PR removes trust in two incident CA roots from Dalec’s constructed Bionic and Focal workers, covering native and cross-architecture builds without changing other distributions or named worker overrides.
Changes:
| File | Description |
| ---- | ----------- |
| test/worker_ca_test.go | Adds certificate checks for both architectures and trust-store formats. |
| test/target_ubuntu_test.go | Enables CA distrust checks for Bionic and Focal. |
| targets/linux/deb/distro/worker.go | Applies targeted CA distrust during native and cross-architecture worker construction. |
</details>
<sub>Review effort: Balanced</sub>
Approved these changes.
nit: seems like this could be inlined in testWorkerCADistrust. I'd rather add a helper for setting up test, rather than putting actual test logic in separate function.
nit: could go below checkWorkerCAs if we keep it, since it's a less significant helper.
nit: Maybe it could be defined in Worker(), so we check this condition only once? Or make workerCADistrustScript return llb.State, either amended or not to confine the conditional?
LGTM, some suggestions for more simplicity.
The result of this function is what Worker() returns. I could factor it out into an llb.StateOption instead, but its effectively the same thing.
I'm not sure I follow what you mean by checking the condition only once?
Actually trying to factor it out into a state option is far more complicated.
>I'm not sure I follow what you mean by checking the condition only once?
I mean so that workerCADistrustScript or equivalent is called unconditionally, once, so it becomes part of the composition with internal logic, rather than a conditional path.
I realized we didn't need this chroot nonsense for the CA stuff. So simplified this up a bit.
named return and defer to mutate the return at the end, that's fairly complex and annoying to read. Perhaps workerWithBuildPlatform content should be moved to separate function and workerWithBuildPlatform should become a compound of both instead (if not moving the call to Worker()`?
Ok, I extracted the main build logic out into a separate function.
Right now this is called in 3 places: Worker, SysextWorker, and HandleWorker.
LGTM, thanks for addressing comments!
jeremyrickard
cpuguy83
What this PR does / why we need it:
Deselect emSign ECC Root CA - G3 and Comodo AAA Services root in Bionic/Focal workers and regenerate their system trust stores, matching USN-8944-2 where fixed packages require ESM. Covers native and cross-architecture worker builds without changing other distributions.
Which issue(s) this PR fixes:
N/A
Special notes for your reviewer:
Integration tests verify both roots are absent from decoded CA bundles and hashed stores on amd64 and arm64. All four worker cases, short tests, custom lint, and generation checks passed. Both worker images also rejected the incident test endpoint with curl error 60.
Named worker overrides remain unchanged. This adjusts the system CA store, not independent application/NSS stores.