Repository navigation
Fixes open-metadata/openmetadata-collate#7380: Keep JAVA_TOOL_OPTIONS secrets out of the startup logs (backport 2.0 #35402) - #35518
Conversation
… secrets out of the startup logs (backport 2.0 #35402) The JVM prints JAVA_TOOL_OPTIONS to stderr at startup ("Picked up JAVA_TOOL_OPTIONS: ..."), so a truststore password passed that way ended up in the server and migration logs. bin/openmetadata-server-start.sh, bootstrap/openmetadata-ops.sh and bin/openmetadata.sh now write the options to a -XX:VMOptionsFile and unset the variable. The JVM parses that file exactly like JAVA_TOOL_OPTIONS, quotes and '#' included, without echoing it. The file is created in /dev/shm or $TMPDIR, opened on fd 3 and unlinked at once, so nothing stays on disk and ps only shows -XX:VMOptionsFile=/dev/fd/3, also after the musl launcher re-exec on Alpine-based images. It goes ahead of the scripts' own options, so precedence is unchanged. If neither directory is writable, the launchers print a one-line warning without the value and leave the variable to the JVM. Same launcher changes as #35402 on main, without its smoke test assertion: 2.0 has no docker smoke test.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved🟡 Medium risk · Changing three JVM launchers to pass JAVA_TOOL_OPTIONS through an unlinked file affects startup option delivery and could omit or alter JVM options if parsing or fallback differs. Moves VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes:
Fixes open-metadata/openmetadata-collate#7380
Backport of #35402 to
2.0. It must ship in the same 2.0.x patch as open-metadata/openmetadata-collate#7420. On every pod start, the Collate chart'srun-db-migrationsinit container runs this repo'sbootstrap/openmetadata-ops.sh, with the sameextraEnvs. With only the Collate backport, the server log would be clean while the migration log still printed the password.When
JAVA_TOOL_OPTIONSis set, for example to pass a truststore password from a Kubernetes secret, the JVM prints it to stderr at startup (Picked up JAVA_TOOL_OPTIONS: ...). No flag turns that off.What changed:
bin/openmetadata-server-start.sh,bootstrap/openmetadata-ops.shandbin/openmetadata.shnow write the options to a-XX:VMOptionsFileand unset the variable.JAVA_TOOL_OPTIONS, quotes and#included, and doesn't echo it./dev/shm, falling back to$TMPDIR. It is opened on fd 3 and unlinked at once, so nothing stays on disk.psonly shows-XX:VMOptionsFile=/dev/fd/3. That holds on the 2.0 Alpine images too: the JVM reads the file itself after the musl launcher re-exec.2.0has no smoke test.Type of change:
High-level design:
N/A — backport of #35402.
Tests:
Use cases covered
JAVA_TOOL_OPTIONSset, its options still reach the JVM, and the value no longer appears in the server log, the migration log,logs/catalog.err, or the JVM's command line.#or quotes arrive exactly asJAVA_TOOL_OPTIONSwould deliver them.Unit tests
Not applicable: shell scripts only.
Backend integration tests
Ingestion integration tests
Playwright (UI) tests
Manual testing performed
On
2.0, these three files were identical to themainbase of Fixes open-metadata/openmetadata-collate#7380: Keep JAVA_TOOL_OPTIONS secrets out of the startup logs #35402, so this branch carries Fixes open-metadata/openmetadata-collate#7380: Keep JAVA_TOOL_OPTIONS secrets out of the startup logs #35402's final launchers byte for byte.I ran those launchers with stub main classes under several shells:
ashon the 2.0.5 Alpine image (musl), which is this branch's runtime.The values tested were
-Dsmoke.p=changeit -Xmx256m,-Dsmoke.p=pa#ss, and-Dsmoke.p='pa#s"s' -Dsmoke.q="a b". Results:changeit,pa#ss,pa#s"s,a b);JAVA_TOOL_OPTIONSis gone from the environment and the command line, on musl too;On
gcr.io/distroless/cc-debian13:debug-nonrootas uid 65532, I checked two edge cases:/dev/shmis still used;/dev/shmread-only as well, the launcher prints the one-line warning and falls back.UI screen recording:
Not applicable — launcher scripts only, no UI.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.🤖 Generated with Claude Code