Commit a7b7274
DFLOW-152 - JVM client setup (macOS)
Adds a macOS client-side installer + validator that wires a corporate CA
into the JVM trust path so Maven / Gradle / sbt / Apache Ivy traffic
redirected through package-reroute validates correctly. JVM trust only —
does not configure Node/npm/Python and does not touch Docker credentials.
Pair with install_certs_macos.sh if you need those flows.
Based on the published research wiki (DFLOW-136):
https://jfrog-int.atlassian.net/wiki/spaces/RTFACT/pages/2440101931
Sibling to DFLOW-150 (Linux). Single path on macOS — there is no
update-ca-trust fork because KeychainStore is broken per JDK-8321045:
1. Build a per-user JKS truststore at
~/Library/Application Support/JFrog/package-route-jvm/truststore.jks
2. Write a per-user LaunchAgent at
~/Library/LaunchAgents/com.jfrog.package-reroute.jto-env.plist
calling `launchctl setenv JAVA_TOOL_OPTIONS=…` at RunAtLoad
3. Bootstrap the agent into `gui/<uid>` so Dock-launched IDEs
(IntelliJ, JetBrains Toolbox, `open -a …`) inherit the env var
The ~/.zshrc / ~/.bash_profile shortcut is deliberately NOT touched —
verified in the research wiki to silently fail for GUI-launched IDE
builds.
Files:
install_certs_jvm_macos.sh Installer (~540 lines).
validate_certs_jvm_macos.sh Companion validator.
_jvm_macos_paths.sh Shared constants sourced by both.
testing/test_install_certs_jvm_macos.sh 12-invariant smoke runner.
.github/workflows/ci.yml New test-macos-jvm job.
README.md New "macOS (JVM)" section.
Hardening fixes folded in from a round of pr-review-toolkit review (5
agents, 21 findings: 5 Critical + 13 Important + 3 Minor):
Critical:
- validate_pem leaf-cert (CA:FALSE) check now works on stock macOS
LibreSSL. The previous `openssl x509 -ext` flag is OpenSSL 3.x-only;
LibreSSL silently failed → leaf certs accepted as trust anchors.
New path parses `-noout -text` output (portable across both).
- chown failure capture at both call sites (JKS dir + plist).
Under --all-users a silent chown would leave root-owned plists in a
user's ~/Library/LaunchAgents/, which launchd silently refuses to
load — exactly the phantom-success the project bans.
- --cert-name semantics clarified in constants file + --help. The
previous "LaunchAgent label suffix" claim was wishful thinking; the
flag is alias-cosmetic only.
- Test runner docstring rewritten (cleanup runs only on positive
cases) and the iter_all_users "mirrors install_certs_macos.sh"
claim corrected (it's a stricter filter, not a mirror).
Important:
- get_single_target_user filter+order matches install_certs_macos.sh
(SUDO_USER → /dev/console → logname; rejects loginwindow pseudo-user).
- get_user_home eval-on-username fallback replaced with dscacheutil.
- bootstrap_launch_agent retry bumped 5×100ms → 20×100ms to survive
EDR exec latency; warn text no longer suggests a logout dance.
- Validator --help documents the absence of --cert-name.
- Validator final summary qualifies "All checks passed" with a WARN
count so a green exit doesn't over-promise when launchctl getenv
was skipped (no GUI session).
- install_as_test_user / validate_as_test_user capture combined
stdout/stderr to a tempfile; dump on UNEXPECTED exit only.
- Smoke matrix gained 3 new invariants: --all-users iteration (#11),
plist content validation via plutil -extract (#10), validate_pem
warn-paths for 30-day-expiry and multi-cert bundle (#12).
- Test #9 (launchctl getenv) now retries 20×100ms to mirror the
installer.
- CI workflow uses explicit `sudo env JAVA_HOME=… PATH=…` instead of
--preserve-env, surviving future actions/setup-java renames. PATH
includes /usr/sbin so chown is resolvable under sudo.
Minor:
- README requirements list names plutil/launchctl/dscl/stat.
- README "five launch contexts" claim scoped to what the test
actually verifies.
- JKS_PASSWORD "not a secret" comment scoped to trustedCertEntry-only
stores (PrivateKeyEntry would change the calculus).
Smoke matrix: 12/12 green locally on dev Mac, 12/12 green on CI
(Test (macOS JVM) job, macos-latest runner with Temurin 21).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 3403ac6 commit a7b7274
6 files changed
Lines changed: 1415 additions & 0 deletions
File tree
- .github/workflows
- testing
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
21 | 44 | | |
22 | 45 | | |
23 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
| |||
317 | 320 | | |
318 | 321 | | |
319 | 322 | | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
320 | 415 | | |
321 | 416 | | |
322 | 417 | | |
| |||
563 | 658 | | |
564 | 659 | | |
565 | 660 | | |
| 661 | + | |
566 | 662 | | |
567 | 663 | | |
568 | 664 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
0 commit comments