Skip to content

Commit c11ca93

Browse files
committed
test: keep local macOS proof certificate-free
1 parent 4278b65 commit c11ca93

9 files changed

Lines changed: 76 additions & 251 deletions

File tree

scripts/build-test-macos-package.sh

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/bash
2-
# Build and inspect the exact macOS candidate package consumed by the Tart gate.
2+
# Build the unsigned local macOS candidate package consumed by the Tart gate.
3+
#
4+
# The installer postinstall ad-hoc signs the installed Mach-O payload with the
5+
# required entitlements. Developer ID signing, notarization, and stapling belong
6+
# only to the tagged publication workflow.
37
set -euo pipefail
48

59
ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
@@ -42,31 +46,8 @@ cargo build --release \
4246
-p capsem-gateway \
4347
-p capsem-tray \
4448
-p capsem-admin
45-
if [ -n "${APPLE_SIGNING_IDENTITY:-}" ]; then
46-
for binary in \
47-
capsem \
48-
capsem-service \
49-
capsem-process \
50-
capsem-tui \
51-
capsem-mcp \
52-
capsem-mcp-aggregator \
53-
capsem-mcp-builtin \
54-
capsem-gateway \
55-
capsem-tray \
56-
capsem-admin
57-
do
58-
codesign \
59-
--sign "$APPLE_SIGNING_IDENTITY" \
60-
--options runtime \
61-
--timestamp \
62-
--entitlements "$ROOT/entitlements.plist" \
63-
--force \
64-
"$ROOT/target/release/$binary"
65-
done
66-
fi
6749
bash scripts/build-pkg.sh \
6850
--manifest "$MANIFEST_URL" \
69-
--signing-identity "${CAPSEM_INSTALLER_SIGNING_IDENTITY:?missing installer identity}" \
7051
"$ROOT/target/release/bundle/macos/Capsem.app" \
7152
"$ROOT/target/release" \
7253
"$ROOT/assets" \
@@ -75,8 +56,6 @@ bash scripts/build-pkg.sh \
7556

7657
PKG="$ROOT/packages/Capsem-$VERSION.pkg"
7758
test -s "$PKG"
78-
/usr/sbin/pkgutil --check-signature "$PKG" | grep -F "Developer ID Installer"
79-
codesign --verify --deep --strict --verbose=2 "$ROOT/target/release/bundle/macos/Capsem.app"
8059
SBOM="$ROOT/target/macos-package-sbom.spdx.json"
8160
python3 scripts/generate-host-binary-sbom.py --output "$SBOM" "$PKG"
8261
python3 - "$SBOM" <<'PY'

scripts/macos_release_glowup.py

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@
1818
from release_glowup import ArtifactIdentity, assert_manifest_artifact
1919
except ModuleNotFoundError:
2020
from scripts.release_glowup import ArtifactIdentity, assert_manifest_artifact
21-
try:
22-
from macos_signing import ephemeral_signing_environment
23-
except ModuleNotFoundError:
24-
from scripts.macos_signing import ephemeral_signing_environment
2521

2622

2723
ROOT = Path(__file__).resolve().parent.parent
@@ -215,18 +211,16 @@ def main() -> int:
215211
env=frontend_env,
216212
)
217213
run(["bash", "scripts/materialize-config.sh"])
218-
with ephemeral_signing_environment(ROOT / "private" / "apple-certificate") as signing_env:
219-
run(
220-
[
221-
"bash",
222-
"scripts/build-test-macos-package.sh",
223-
"--version",
224-
args.version,
225-
"--manifest-url",
226-
manifest_url,
227-
],
228-
env=signing_env,
229-
)
214+
run(
215+
[
216+
"bash",
217+
"scripts/build-test-macos-package.sh",
218+
"--version",
219+
args.version,
220+
"--manifest-url",
221+
manifest_url,
222+
]
223+
)
230224
package = ROOT / "packages" / f"Capsem-{args.version}.pkg"
231225
sbom = ROOT / "target" / "macos-package-sbom.spdx.json"
232226
manifest_path, asset_share, profile_share = prepare_candidate_manifest(

scripts/macos_signing.py

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

scripts/macos_tart_guest.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ for binary in "${BINARIES[@]}"; do
7676
"$path" --version | grep -F "$VERSION"
7777
codesign --verify --strict "$path"
7878
codesign -d --verbose=4 "$path" 2>&1 \
79-
| grep -F "Authority=Developer ID Application:"
79+
| grep -F "Signature=adhoc"
8080
done
8181

8282
verify_channel() {
@@ -121,6 +121,7 @@ report = {
121121
"architecture": sys.argv[6],
122122
"clean_precondition": True,
123123
"app_bundle": True,
124+
"installed_binary_signature": "ad-hoc",
124125
},
125126
}
126127
Path(sys.argv[1]).write_text(json.dumps(report, indent=2, sort_keys=True) + "\n")

skills/dev-installation/SKILL.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,13 @@ same package on the physical Mac and boots a real Capsem guest from its exact
158158
binary/profile payload to a shell marker. Both focused scripts remain
159159
debugging tools; `just test` is the release gate that owns them.
160160

161+
The local `.pkg` is intentionally unsigned. Its installer postinstall applies
162+
ad-hoc signatures and the required entitlements to executable payloads, which
163+
the Tart guest verifies before service and gateway checks. Local installation
164+
tests must not import or unlock an Apple Developer certificate or mutate the
165+
user's keychain. Developer ID signing, notarization, and stapling are
166+
publication-workflow responsibilities.
167+
161168
## Key files
162169

163170
```

skills/dev-just/SKILL.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,14 @@ branching, reporting, cleanup, or resource ownership.
6060
- Linux parity and both `.deb` architectures;
6161
- host package SBOM;
6262
- Linux systemd install plus channel glow-up;
63-
- on macOS, signed exact `.pkg` install in Tart and physical Apple VZ boot.
63+
- on macOS, an unsigned local `.pkg` install in Tart, ad-hoc signature checks
64+
on the installed executable payload, and physical Apple VZ boot from that
65+
exact package.
6466

6567
Do not fork or approximate this graph in another public recipe.
68+
Local qualification must not import, unlock, or use Apple Developer
69+
certificates. Developer ID package signing, notarization, and stapling belong
70+
only to the tagged publication workflow.
6671

6772
## Public-surface gate
6873

skills/dev-testing/SKILL.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ production assembler, installs that exact file in a disposable headless Tart
6565
guest, verifies the receipt, app bundle, complete binary cohort, service and
6666
gateway health, then extracts the same package on the physical Mac and boots a
6767
real Capsem guest VM from its exact binary/profile payload to a shell marker.
68+
The local package is unsigned; its postinstall ad-hoc signs the installed
69+
Mach-O payload with the required entitlements. Local qualification must not
70+
load Developer ID material or create a signing keychain. The tagged publication
71+
workflow alone signs, notarizes, staples, and installs the final publishable
72+
package.
6873
Tart macOS guests do not support nested virtualization, so these are two
6974
explicit halves of one script rather than a claimed nested proof. `just smoke`
7075
deliberately excludes Tart; pulling a 25 GB

skills/release-process/SKILL.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,13 @@ GitHub-hosted macOS job separately builds, signs, notarizes, staples, installs,
219219
and verifies the exact publishable `.pkg`, but hosted runners cannot repeat the
220220
VZ guest path because nested virtualization is unavailable.
221221

222+
The local package is intentionally unsigned. Its postinstall ad-hoc signs the
223+
installed Mach-O payload with the required entitlements, so local qualification
224+
needs no release certificate, private key, or temporary keychain. Developer ID
225+
signing, notarization, stapling, Gatekeeper verification, and installation of
226+
that final signed artifact remain owned exclusively by the tagged publication
227+
workflow.
228+
222229
The accepted release risk is explicit: the published `.pkg` is not installed
223230
again on a physical Mac for a second VZ guest-shell run after publication. Do
224231
not claim that missing post-publication combination as evidence; record the

0 commit comments

Comments
 (0)