Bundle the AWS Session Manager plugin (built from source) #85

Closed
jknapp wants to merge 0 commits from feat/bundle-ssm-plugin into main
pull from: feat/bundle-ssm-plugin
Owner

Bundles AWS's Session Manager plugin with the app, so AWS workspaces connect without users installing it.

  • Built from source: AWS's Apache-2.0 repo, tag 1.2.896.0, pinned by commit and archive SHA-256, with Go 1.26.11 (pinned by SHA-256) and CGO off. Every target's output must match a pinned SHA-256 (the builds are reproducible). The pinned binaries are never redistributed by AWS; we build them.
  • Shipped as a Tauri sidecar (externalBin) for Linux, Windows and macOS (universal). find_plugin() tries TRIPLEC_SSM_PLUGIN, then the bundled copy, then PATH and system installs. Debug builds use a marked placeholder; release builds refuse it.
  • Windows: our build is signed with the app's Azure signing (now 6 signatures per release), and the verify step requires it in both the MSI and NSIS installers.
  • THIRD_PARTY_NOTICES: the plugin's LICENSE/NOTICE/THIRD-PARTY, the vendored modules' licences, and Go's.

Tests: cargo test --locked 1,614 passed, vitest 1,367 passed. A local AppImage build passed, and the plugin inside it matches its pin.
Needs CI / hands-on: the Windows and macOS runners reproducing the pinned hashes, Windows signing end to end, and a real AWS connection through the bundled plugin on each platform.

🤖 Generated with Claude Code

Bundles AWS's Session Manager plugin with the app, so AWS workspaces connect without users installing it. - **Built from source**: AWS's Apache-2.0 repo, tag 1.2.896.0, pinned by commit and archive SHA-256, with Go 1.26.11 (pinned by SHA-256) and CGO off. Every target's output must match a pinned SHA-256 (the builds are reproducible). The pinned binaries are never redistributed by AWS; we build them. - **Shipped as a Tauri sidecar** (`externalBin`) for Linux, Windows and macOS (universal). `find_plugin()` tries `TRIPLEC_SSM_PLUGIN`, then the bundled copy, then PATH and system installs. Debug builds use a marked placeholder; release builds refuse it. - **Windows**: our build is signed with the app's Azure signing (now 6 signatures per release), and the verify step requires it in both the MSI and NSIS installers. - **`THIRD_PARTY_NOTICES`**: the plugin's LICENSE/NOTICE/THIRD-PARTY, the vendored modules' licences, and Go's. Tests: `cargo test --locked` 1,614 passed, vitest 1,367 passed. A local AppImage build passed, and the plugin inside it matches its pin. Needs CI / hands-on: the Windows and macOS runners reproducing the pinned hashes, Windows signing end to end, and a real AWS connection through the bundled plugin on each platform. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jknapp added 5 commits 2026-11-17 16:13:09 +00:00
scripts/fetch-ssm-plugin.sh (Linux/macOS, incl. universal via lipo) and
scripts/fetch-ssm-plugin.ps1 (Windows) download plugin 1.2.896.0 from AWS's
S3 path into app/src-tauri/binaries/session-manager-plugin-<triple>[.exe],
checking a pinned SHA-256 of each artifact before extraction, AWS's GPG
signature on the Linux .deb (key committed, fingerprint pinned) or AWS's
Authenticode signature on Windows, and a pinned SHA-256 of the binary.

THIRD_PARTY_NOTICES reproduces the plugin's LICENSE (Apache-2.0), NOTICE
and AWS's THIRD-PARTY statement. The binaries directory is never committed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bundle.externalBin ships the plugin beside the app binary (usr/bin in the
AppImage, Contents/MacOS, the Windows install dir) and THIRD_PARTY_NOTICES as
a resource. find_plugin() now resolves TRIPLEC_SSM_PLUGIN, then the bundled
sidecar next to current_exe(), then PATH and AWS's install locations, then
the install hint; the order is unit-tested against temp dirs.

tauri-build fails any build whose externalBin file is missing, so build.rs
writes a marked placeholder in debug builds (cargo test/check, tauri dev)
and refuses a missing file or a placeholder in release builds.
find_plugin() skips the placeholder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both build workflows fetch the pinned plugin before tauri build on Linux,
macOS (universal: both slices plus the lipo'd file) and Windows. The test
job needs no fetch: debug builds get build.rs's placeholder.

finalize-appimage.sh asserts usr/bin/session-manager-plugin is a running
ELF and THIRD_PARTY_NOTICES is in the image.

Windows: the plugin ships under AWS's Authenticode signature and is not
re-signed (Tauri skips a sidecar signtool verify accepts).
windows-sign.ps1 refuses it if it is ever presented rather than letting the
allowlist skip it unsigned; windows-verify-signatures.ps1 requires it in
the MSI, valid, timestamped and signed by Amazon Web Services, Inc.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
build: build session-manager-plugin from source, not AWS's binaries
Build App (Preview) / compute-version (pull_request) Successful in 5s
Secret Scan / scan (push) Successful in 8s
Secret Scan / scan (pull_request) Successful in 7s
Build App (Preview) / create-release (pull_request) Successful in 2s
Build App (Preview) / build-macos (pull_request) Successful in 6m42s
Build App (Preview) / build-linux (pull_request) Successful in 12m41s
Build App (Preview) / build-windows (pull_request) Successful in 13m57s
Build App (Preview) / test (pull_request) Successful in 23m29s
Build App (Preview) / prune-previews (pull_request) Successful in 3s
5b23dc1aec
AWS ships its prebuilt plugin as "AWS Content" under the AWS Customer
Agreement; the source is Apache-2.0. Replace the binary fetch with
scripts/build-ssm-plugin.sh (any triple, cross-compiles; universal via
lipo) and build-ssm-plugin.ps1 (Windows runner):

- source: tag 1.2.896.0 at commit 6430675a, GitHub archive SHA-256
  checked before extraction;
- Go 1.26.11 from go.dev, published SHA-256 checked before use;
- the repo's own build (GOPATH mode, vendored deps, -s -w,
  sessionmanagerplugin-main) with VERSION stamped to the tag, plus
  -trimpath, no VCS stamp, empty build id, CGO off;
- output must equal a pinned SHA-256 per target (reproducible builds).

Each platform job builds its own targets. Windows: the exe is now ours
and unsigned, so windows-sign.ps1 allowlists it and
windows-verify-signatures.ps1 requires it signed by the installer's own
certificate in the MSI and NSIS. THIRD_PARTY_NOTICES now carries the
source's LICENSE/NOTICE/THIRD-PARTY, the commit, every linked vendored
module's licence and Go's. AWS's GPG key and the AWS-signature checks
are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jknapp added 1 commit 2026-11-17 16:20:10 +00:00
fix(ssm-plugin): review fixes for the source build and signing checks
Secret Scan / scan (push) Successful in 11s
Build App (Preview) / compute-version (pull_request) Successful in 11s
Secret Scan / scan (pull_request) Successful in 12s
Build App (Preview) / create-release (pull_request) Successful in 1s
Build App (Preview) / build-macos (pull_request) Successful in 6m42s
Build App (Preview) / test (pull_request) Successful in 15m11s
Build App (Preview) / build-linux (pull_request) Successful in 13m45s
Build App (Preview) / build-windows (pull_request) Successful in 13m59s
Build App (Preview) / prune-previews (pull_request) Successful in 2s
b62f472d79
- build-ssm-plugin.{sh,ps1}: skip the vendored SDK's Java codegen/ and
  test snapshot/ trees when extracting (codegen paths reach 258 chars,
  past MAX_PATH on Windows); the .ps1 works under a short
  %SystemDrive%\ssm-<8hex> root and falls back to rd /s /q on cleanup.
  Pinned output hashes unchanged (rebuilt every target).
- build-ssm-plugin.sh: the header no longer claims a git commit-id check.
- windows-verify-signatures.ps1: compare signer Subject + Issuer, not the
  thumbprint (Artifact Signing certificates rotate); require
  THIRD_PARTY_NOTICES in the MSI.
- windows-sign.ps1: allowlist exactly
  src-tauri\binaries\session-manager-plugin-x86_64-pc-windows-msvc.exe.
- macOS jobs: check the .app carries the two-slice plugin and
  Contents/Resources/THIRD_PARTY_NOTICES.
- CLAUDE.md: a local release build must re-run the build script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jknapp added 1 commit 2026-11-17 16:21:56 +00:00
fix(ssm-plugin): lock down the Windows work root; re-hash the output in place
Secret Scan / scan (push) Successful in 14s
Build App (Preview) / compute-version (pull_request) Successful in 14s
Secret Scan / scan (pull_request) Successful in 7s
Build App (Preview) / test (pull_request) Successful in 9m25s
Build App (Preview) / create-release (pull_request) Successful in 1s
Build App (Preview) / build-macos (pull_request) Successful in 6m40s
Build App (Preview) / build-linux (pull_request) Successful in 17m3s
Build App (Preview) / build-windows (pull_request) Successful in 13m53s
Build App (Preview) / prune-previews (pull_request) Successful in 2s
614e89bef4
The short %SystemDrive%\ssm-<8hex> root inherited the drive root's ACL,
where Authenticated Users can write, so another local user could swap the
source, toolchain or output between verification and use. Right after
creating it, icacls removes inheritance and grants full control only to
SYSTEM, Administrators and the current user's SID; failure aborts. It is
mandatory on Windows and skipped only off Windows (the pwsh test path).
The binary is hashed again at its final location.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Merged into main as part of #86 (8359135), which included this branch.

Merged into main as part of #86 (8359135), which included this branch.
jknapp closed this pull request 2026-11-17 23:09:07 +00:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: CyberCoveLLC/Triple-C#85