Repository navigation
[14.5-stable] Update ca-certificates to 20261020-r0 to stop trusting the compromised eMudhra CAs. - #6913
Conversation
|
Claude finished @shjala's task in 2m 42s —— View job Review: ca-certificates 20261020 backport to 14.5-stable
AssessmentThis is a careful, well-scoped backport. The core problem — Alpine 3.16's repo only ships I verified:
No correctness, security, or performance issues found. The dependent-tag regeneration and hash-check consistency are the main things that still need the full CI build to confirm (as the PR description already calls out under "Still required"). |
| source="https://distfiles.alpinelinux.org/distfiles/v3.22/ca-certificates-$pkgver.tar.bz2" | ||
|
|
||
| build() { | ||
| make |
There was a problem hiding this comment.
@shjala , could you please fix these Yetus issue....
|
Go Tests fails here because the bpftrace-compiler tests run past their 1h timeout on the self-hosted runners. #6936 raised the timeout to 5h on 14.5-stable. Re-running doesn't help, because the job tests the PR head. Please rebase onto the current 14.5-stable. |
|
@shjala some conflicts to fix |
1c81c22 to
cb089ec
Compare
|
Claude finished @shjala's task in 4m 35s —— View job Review: ca-certificates 20261020 backport to
|
| # Alpine 3.16 no longer receives CA bundle updates. Rebuild the current | ||
| # certificate data against this branch's libraries instead of upgrading Alpine. | ||
| COPY ca-certificates /tmp/ca-backport/main/ca-certificates/ | ||
| RUN cd /tmp/ca-backport/main/ca-certificates && abuild -F -P /tmp/ca-packages -r |
There was a problem hiding this comment.
This RUN cd … && … will trip hadolint DL3003 ("Use WORKDIR to switch to a directory"). The repo's .hadolint.yaml only ignores DL3059 and DL3002, and this is the only RUN cd in the file — every other directory switch here uses WORKDIR or a per-line # hadolint ignore=. So Apache Yetus/hadolint will likely fail on this line.
Either add an ignore comment (matching the existing DL3018/DL3059 pattern in this file):
| RUN cd /tmp/ca-backport/main/ca-certificates && abuild -F -P /tmp/ca-packages -r | |
| # hadolint ignore=DL3003 | |
| RUN cd /tmp/ca-backport/main/ca-certificates && abuild -F -P /tmp/ca-packages -r |
or switch to WORKDIR /tmp/ca-backport/main/ca-certificates before the RUN (the next step already resets WORKDIR /tmp/mirrors).
| echo "# Automatically generated by $pkgname-$pkgver-r$pkgrel" | ||
| echo "# $(date -u)" | ||
| echo "# Do not edit." | ||
| cd "$pkgdir"/usr/share/ca-certificates |
There was a problem hiding this comment.
Regarding the Yetus issue flagged earlier on this file: shellcheck (which Yetus runs) will warn here on SC2164 — cd without failure handling. Since this cd is inside a subshell that redirects into ca-certificates.conf, a failed cd would silently generate the conf from the wrong directory, so the fix is also correct on its own merits:
| cd "$pkgdir"/usr/share/ca-certificates | |
| cd "$pkgdir"/usr/share/ca-certificates || exit 1 |
Note that shellcheck will additionally emit SC2154 for the abuild-provided vars ($pkgdir, $pkgname, $subpkgdir, …), which it can't see are assigned. If those are part of the Yetus failures, add a # shellcheck disable=SC2154 (and shell=sh) directive near the top of the file rather than touching each use.
Eight eMudhra intermediate CAs were found with recoverable P-384 keys and revoked. They chain to emSign ECC Root CA - G3, which our current ca-certificates bundle (20260909) still trusts. EVE does not check revocation, so a TLS server certificate issued under one of them would be accepted. Alpine 3.22 ships ca-certificates 20261020-r0, which drops that root. Rebuild eve-alpine on top of the current cache so it picks up the new bundle. build-cache.sh refetches every listed package, so other packages updated upstream since the last build come along too. Backport to Alpine 3.16: its repository still ships ca-certificates 20240226, and its cache builder does not refresh existing packages. Build the checksum-pinned 20261020 source with the Alpine 3.16 recipe and the branch's OpenSSL, then replace both CA packages in every populated mirror before reindexing. Preserve the Alpine and Go versions. Signed-off-by: Shahriyar Jalayeri <shahriyar@posteo.de> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 2a6d5b0)
Point every package at the refreshed eve-alpine so EVE images ship ca-certificates 20261020-r0, which no longer trusts emSign ECC Root CA - G3 and the compromised eMudhra intermediates that chain to it. Packages built from eve-alpine get a new tag when eve-alpine changes, and so do the packages that pin them. Point every package that pins one of them (optee-os, bpftrace, dom0-ztools, fscrypt, gpt-tools, recovertpm, storage-resizer, uefi, debug) at its new tag. Backport adaptation: regenerate image tags from this stable branch. Its hash-consistency check includes cross-compilers, so refresh that image and its consumers too. Preserve the branch-specific package set and the existing hash-check exclusions. Signed-off-by: Shahriyar Jalayeri <shahriyar@posteo.de> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 4f93991)
cb089ec to
03ea036
Compare
|
Claude finished @shjala's task in 3m 58s —— View job Review: ca-certificates 20261020 backport to
|
| for p in ca-certificates ca-certificates-bundle; do | ||
| if ls "$CACHE/${p}"-[0-9]*.apk >/dev/null 2>&1; then | ||
| rm -f "$CACHE/${p}"-[0-9]*.apk | ||
| cp /tmp/ca-packages/main/"$(apk --print-arch)"/"${p}"-[0-9]*.apk "$CACHE/" |
There was a problem hiding this comment.
Likely build break: the ca-certificates-bundle copy looks in the wrong directory.
ca-certificates-bundle is declared as a noarch subpackage (subpackages="$pkgname-doc $pkgname-bundle::noarch" in the APKBUILD). abuild -P /tmp/ca-packages writes packages to $REPODEST/$repo/$arch, and noarch subpackages go to the noarch arch directory — so the bundle lands in /tmp/ca-packages/main/noarch/, not /tmp/ca-packages/main/$(apk --print-arch)/.
For the ca-certificates-bundle iteration, the cp glob therefore matches nothing. Combined with the preceding rm -f and the script's set -e, any populated cache that contains ca-certificates-bundle will have the old bundle deleted and then fail the cp → the whole cache build aborts. (The arch-specific ca-certificates package itself is fine, since it goes to main/$arch/.)
Suggest copying from whichever arch dir abuild used so both the arch package and the noarch bundle resolve:
| cp /tmp/ca-packages/main/"$(apk --print-arch)"/"${p}"-[0-9]*.apk "$CACHE/" | |
| cp /tmp/ca-packages/main/*/"${p}"-[0-9]*.apk "$CACHE/" |
Worth confirming against a real full image build (per the "Still required" items) — the local container test may not have gone through this exact build-cache.sh path for the bundle.
evetest: skipped suites for this PRThis PR is a backport that bumps the The only behavior that actually changes is which root CAs the system trust Skipped as unrelated to that change (each suite's own purpose has nothing to
An engineer can comment |
Description
Backport of #6891 to
14.5-stable.Update the CA packages to 20261020-r0 so the system trust store no longer trusts the emSign roots removed after the eMudhra intermediate-CA compromise. Both commits were cherry-picked from master with
-x:2a6d5b0313f8e337e100488fe71885ac23a5186a4f93991f4bd186894815708541427cc3b14f8b11This branch uses Alpine 3.16. Its repository still provides ca-certificates 20240226-r0, and its cache builder deliberately preserves existing APKs. A tag-only backport of the master change therefore would not update the certificates.
The first commit is adapted to build the checksum-pinned 20261020 CA source using the Alpine 3.16 package recipe and the branch's existing OpenSSL development package. Both
ca-certificatesandca-certificates-bundleare replaced in each populated cache before reindexing and signing, including packages fetched as dependencies. The existing Alpine and Go versions are preserved.The second commit updates downstream Alpine references and regenerates dependent tags from this stable tree. This branch's hash checker includes cross-compilers, so its image references are updated too. Existing package selection and branch-specific hash-check exclusions are preserved; packages absent on this branch are not introduced.
New Alpine image tag:
lfedge/eve-alpine:80c5dbe1085d0650030be8a110eaec66ef532672.How to test and validate this PR
Completed locally:
Fixed the CI-reported tabs and Dockerfile
RUN cdlint issues within the original first commit, preserving generated heredoc contents. Regenerated dependent image references in the original second commit (including Dockerfile.spec). The full local Yetus suite now returns +1 overall (codespell, blanks, hadolint, shellcheck); hash consistency also passes after these changes.Rebased the original two commits onto current
14.5-stable(aeed12555), preserving both-xtrailers and the base branch’s GitHub cross-compiler download fix. Resolved image-reference conflicts and regenerated the cross-compiler and OP-TEE hashes; no merge commit added. Hash consistency, shell syntax, and whitespace checks passed again after rebasing.make -o pkg-deps.mk check-docker-hashes-consistencypasses with this branch's checker.-oskips dependency-file regeneration, not the hash check.The newer master checker also passes with this branch's configured exclusions, including references resolved through Dockerfile
ARG.git diff upstream/14.5-stable HEAD --checkandsh -non the modified/new shell files pass.Verified that both master
-xreferences are retained and changes outsidepkg/alpineare image-tag substitutions only.Built the shared package recipe and exercised the cache replacement script in an amd64 Alpine 3.16 container. Both CA packages install as
20261020-r0;c_rehashlinks against OpenSSL 1.1 andupdate-ca-certificates --freshsucceeds.Verified removal of the affected emSign roots and AAA Certificate Services from the generated CA configuration. The regenerated certificate bundle is byte-for-byte identical to the bundle in the updated master Alpine image (
b4d0b9fe886ec5283e91da1ade3a47ed537bb47a); SHA-256:5961c0a3c65459931c023e0075c09733f09aea4ca439cb85bc4a08bb4f3f568b.Still required:
apk info -v | grep '^ca-certificates'and verify both packages are20261020-r0.update-ca-certificates --freshand inspect/etc/ca-certificates.confand/etc/ssl/certs/ca-certificates.crt; the affected emSign G3/C3/C1 roots and AAA Certificate Services must be absent. The unrelated emSign G1 root is not part of this removal.The local container test covers package building, installation, and cache replacement, not a full EVE image build. Hardware tests and other architecture builds have not been performed locally.
Changelog notes
Update the system CA certificate bundle to 20261020 and remove trust in the emSign roots associated with compromised eMudhra intermediate certificate authorities.
PR Backports
Checklist
For backport PRs:
And the last but not least:
The build adaptation is documented in code comments and this description; no separate user documentation is added. Device checkboxes remain unchecked because validation was performed in an amd64 container, not on EVE hardware.