Skip to content

security: avoid passing GPG passphrase on command line in Java publish workflow #3299

Description

@wjones127

.github/workflows/java-publish.yml:61 passes the GPG passphrase via the command line, which makes it visible in process listings on the runner and risks being echoed into debug logs.

Proposed

Switch to a passphrase mechanism that doesn't expose the secret as a CLI arg:

  • gpg --pinentry-mode loopback --passphrase-fd 0 with the passphrase piped on stdin, OR
  • Maven's gpg.passphrase property via environment variable, OR
  • gpg-agent preload before running Maven

Also worth checking: ensure -X/--debug is not enabled on Maven in the publish job (would echo secrets).

Related

Longer-term, consider replacing GPG-based signing with Sigstore via sigstore-maven-plugin — removes the need to manage a long-lived GPG key and passphrase at all. That's a bigger change; tracking separately if we pursue it.

Part of security review follow-up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions