Repository navigation
Revert "Stop trusting compromised eMudhra roots in the build-toolchain images (#9528)" #9540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,12 +2,6 @@ | |
| FROM mcr.microsoft.com/dotnet/runtime-deps:5.0-buster-slim AS base | ||
| ARG DOTNETSDK_VERSION | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛡️ Codex Security Review · Automatically triggered
An attacker with a compromised eMudhra intermediate key and network interception can exploit this when the image performs an uncached download. Deleting the rules here makes the Debian builder trust that chain again; it then downloads and executes Useful? React with 👍 / 👎. |
||
| # buster is EOL, so no fixed ca-certificates package will ship: drop the distrusted eMudhra roots | ||
| # "emSign ECC Root CA - G3" / "AAA Certificate Services" (IR-62343) from the system trust store. | ||
| RUN sed -i -e 's|^mozilla/emSign_ECC_Root_CA_-_G3.crt|!&|' -e 's|^mozilla/Comodo_AAA_Services_root.crt|!&|' /etc/ca-certificates.conf \ | ||
| && rm -f /usr/share/ca-certificates/mozilla/emSign_ECC_Root_CA_-_G3.crt /usr/share/ca-certificates/mozilla/Comodo_AAA_Services_root.crt \ | ||
| && update-ca-certificates -f | ||
|
|
||
| # Based on https://github.com/dotnet/dotnet-docker/blob/34c81d5f9c8d56b36cc89da61702ccecbf00f249/src/sdk/6.0/bullseye-slim/amd64/Dockerfile | ||
| # and https://github.com/dotnet/dotnet-docker/blob/1eab4cad6e2d42308bd93d3f0cc1f7511ac75882/src/sdk/5.0/buster-slim/amd64/Dockerfile | ||
| ENV \ | ||
|
|
@@ -89,27 +83,6 @@ RUN curl -sSL https://github.com/dotnet/install-scripts/raw/2bdc7f2c6e00d60be57f | |
| # Trigger first run experience by running arbitrary cmd | ||
| && dotnet help | ||
|
|
||
| # The .NET SDK ships its own NuGet signing trust bundles (sdk/*/trustedroots/*.pem) that still contain the | ||
| # distrusted eMudhra / AAA Certificate Services roots (IR-62343): strip those certificates from them. | ||
| RUN for f in /usr/share/dotnet/sdk/*/trustedroots/*.pem; do \ | ||
| d=$(mktemp -d) \ | ||
| && awk -v d="$d" '/-----BEGIN CERTIFICATE-----/ { n++; out = sprintf("%s/%05d.pem", d, n); incert = 1 } incert { print > out } /-----END CERTIFICATE-----/ { incert = 0; close(out) }' "$f" \ | ||
| && : > "$f" \ | ||
| && for c in "$d"/*.pem; do \ | ||
| openssl x509 -noout -subject -in "$c" | grep -qE 'CN ?= ?(emSign ECC Root CA - G3|emSign Root CS CA - G3|AAA Certificate Services)' || cat "$c" >> "$f"; \ | ||
| done \ | ||
| && rm -rf "$d" || exit 1; \ | ||
| done | ||
|
|
||
| # buster's libnss3 compiles the distrusted roots into libnssckbi.so and no fixed NSS will ship for buster: | ||
| # point NSS at p11-kit's trust module so it reads the patched system store above instead. | ||
| RUN apt-get update \ | ||
| && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends p11-kit-modules \ | ||
| && trust_module=$(find /usr/lib -name p11-kit-trust.so | head -n 1) \ | ||
| && test -n "$trust_module" \ | ||
| && find / -xdev -name 'libnssckbi.so*' -exec ln -sf "$trust_module" {} \; \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| ENV \ | ||
| DOTNET_ROOT=/usr/share/dotnet \ | ||
| DOTNET_ROLL_FORWARD_TO_PRERELEASE=1 \ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a fresh CentOS toolchain build, centos-release-scl creates repository files after the initial vault rewrite. Removing the second rewrite leaves those SCLo repositories pointing at retired mirrorlist.centos.org, causing the subsequent yum install of devtoolset-11 to fail. Preserve the SCLo repository repair after centos-release-scl installation independently of the certificate rollback.
React: 👍 useful · 👎 wrong · 😕 unclear · 👀 right, but not acting on it
What each reaction means
🤖 Bits Code Review · Open Bits AI session
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eliottness I'm unsure if this is now a new issue caused by the prior merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bouwkast for the record: no, that one predates #9528.
mirrorlist.centos.orgis gone, so the stockcentos7.build.dockerfileno longer built on a cold cache. #9528 fixed it by moving the SCLo repos to vault, and reverting would have brought the break back. Moot now that the VMs are rebuilt and this is closed. Thanks for handling it, and sorry again for the early merge.