Skip to content

Commit 79a1904

Browse files
committed
🎨 Template bootstrap by kettle-jem v7.1.43
1 parent 5fc1e91 commit 79a1904

24 files changed

Lines changed: 853 additions & 443 deletions

‎.github/workflows/coverage.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ env:
1111
K_SOUP_COV_MIN_BRANCH: 50
1212
K_SOUP_COV_MIN_LINE: 80
1313
K_SOUP_COV_MIN_HARD: true
14+
K_SOUP_COV_MIN_STRICT: false
1415
K_SOUP_COV_FORMATTERS: "xml,rcov,lcov,tty"
1516
K_SOUP_COV_DO: true
1617
K_SOUP_COV_MULTI_FORMATTERS: true

‎.github/workflows/current.yml‎

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,86 @@ jobs:
5252
bundler: latest
5353

5454
steps:
55+
- name: Remove eMudhra roots from the macOS CA bundle
56+
if: runner.os == 'macOS'
57+
shell: bash
58+
run: |
59+
#!/bin/sh
60+
# Remove the eMudhra-related roots from the macOS system CA bundle.
61+
#
62+
# Apple's /etc/ssl/cert.pem still carries roots from the eMudhra incident, and the
63+
# developer tools Apple ships (git, curl, python3) read that file, so a network
64+
# attacker could tamper with downloads made during a release build. GitHub's macOS
65+
# runners are ephemeral, so removing the roots at job start needs no re-application
66+
# after OS updates. Reference: https://github.com/galadran/we-have-a-problem.com/issues/157
67+
#
68+
# It must run BEFORE the first step that downloads anything (actions/checkout runs
69+
# git), so the workflows inline this exact file. A contract test keeps them identical.
70+
#
71+
# Matching is by certificate subject so no fingerprints need to be guessed; every
72+
# removed certificate is printed with its SHA-256 fingerprint for the audit log, and
73+
# the script fails if any matching certificate is still present afterwards.
74+
#
75+
# Environment (for tests): CA_BUNDLE (default /etc/ssl/cert.pem), SUDO (default sudo).
76+
set -eu
77+
78+
bundle="${CA_BUNDLE:-/etc/ssl/cert.pem}"
79+
sudo_cmd="${SUDO-sudo}"
80+
work="$(mktemp -d)"
81+
trap 'rm -rf "$work"' EXIT
82+
83+
matches() {
84+
case "$1" in
85+
*"AAA Certificate Services"* | *"emSign ECC Root CA - G3"* | *[eE][mM]udhra*) return 0 ;;
86+
*) return 1 ;;
87+
esac
88+
}
89+
90+
total="$(grep -c -- '-----BEGIN CERTIFICATE-----' "$bundle")"
91+
[ "$total" -ge 100 ] || { echo "refusing to edit $bundle: only $total certificates" >&2; exit 1; }
92+
93+
awk -v dir="$work" '
94+
/-----BEGIN CERTIFICATE-----/ { if (out != "") close(out); n++; out = dir "/c" n ".pem" }
95+
out != "" { print > out }
96+
' "$bundle"
97+
98+
: > "$work/clean.pem"
99+
removed=0
100+
i=1
101+
while [ "$i" -le "$total" ]; do
102+
file="$work/c$i.pem"
103+
subject="$(openssl x509 -in "$file" -noout -subject 2>/dev/null || true)"
104+
if [ -n "$subject" ] && matches "$subject"; then
105+
fingerprint="$(openssl x509 -in "$file" -noout -fingerprint -sha256)"
106+
echo "removing: $subject ($fingerprint)"
107+
removed=$((removed + 1))
108+
else
109+
cat "$file" >> "$work/clean.pem"
110+
fi
111+
i=$((i + 1))
112+
done
113+
114+
if [ "$removed" -gt 0 ]; then
115+
$sudo_cmd tee "$bundle" < "$work/clean.pem" > /dev/null
116+
fi
117+
118+
# Verify what is on disk now, not what we intended to write.
119+
after="$(grep -c -- '-----BEGIN CERTIFICATE-----' "$bundle")"
120+
[ "$after" -eq $((total - removed)) ] || { echo "certificate count mismatch: $after != $total - $removed" >&2; exit 1; }
121+
rm -f "$work"/c*.pem
122+
awk -v dir="$work" '
123+
/-----BEGIN CERTIFICATE-----/ { if (out != "") close(out); n++; out = dir "/v" n ".pem" }
124+
out != "" { print > out }
125+
' "$bundle"
126+
for file in "$work"/v*.pem; do
127+
subject="$(openssl x509 -in "$file" -noout -subject 2>/dev/null || true)"
128+
if [ -n "$subject" ] && matches "$subject"; then
129+
echo "still trusted after cleanup: $subject" >&2
130+
exit 1
131+
fi
132+
done
133+
echo "CA bundle $bundle: $total certificates, removed $removed, $after remain."
134+
55135
- name: Checkout
56136
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
57137
with:

‎.github/workflows/macos.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
- name: Checkout
5454
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
5555
- name: Setup Ruby & Bundle
56-
uses: ruby/setup-ruby@7f797815d8adceb1c412e7abefdd1ab4abc47a5f # v1.335.0
56+
uses: ruby/setup-ruby@b3aaceaef7e0ee231b499e7b5f49c03fc1d32199 # v1.338.0
5757
with:
5858
ruby-version: ${{ matrix.ruby }}
5959
rubygems: ${{ matrix.rubygems }}

‎.github/workflows/windows.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
- name: Checkout
5353
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
5454
- name: Setup Ruby & Bundle
55-
uses: ruby/setup-ruby@7f797815d8adceb1c412e7abefdd1ab4abc47a5f # v1.335.0
55+
uses: ruby/setup-ruby@b3aaceaef7e0ee231b499e7b5f49c03fc1d32199 # v1.338.0
5656
with:
5757
ruby-version: ${{ matrix.ruby }}
5858
rubygems: ${{ matrix.rubygems }}

‎.kettle-drift.lock‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,23 @@
8989
148
9090
]
9191
}
92+
],
93+
"out != \"\" { print > out }\n' \"$bundle\"": [
94+
{
95+
"file": ".github/workflows/current.yml",
96+
"lines": [
97+
95,
98+
124
99+
]
100+
}
101+
],
102+
"subject=\"$(openssl x509 -in \"$file\" -noout -subject 2>/dev/null || true)\"\nif [ -n \"$subject\" ] && matches \"$subject\"; then": [
103+
{
104+
"file": ".github/workflows/current.yml",
105+
"lines": [
106+
103,
107+
127
108+
]
109+
}
92110
]
93111
}

‎.rubocop_gradual.lock‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)