Skip to content

Add AGE_ASKPASS support for external secret prompting#617

Open
pinpox wants to merge 1 commit intostr4d:mainfrom
pinpox:age-askpass-support
Open

Add AGE_ASKPASS support for external secret prompting#617
pinpox wants to merge 1 commit intostr4d:mainfrom
pinpox:age-askpass-support

Conversation

@pinpox
Copy link
Copy Markdown

@pinpox pinpox commented May 6, 2026

Hardware security tokens (YubiKey, PicoHSM) often need PIN entry during age decryption via plugins like age-plugin-yubikey. The current pinentry/TTY-based prompting fails in non-interactive contexts (scripts, background services). AGE_ASKPASS allows delegating to a GUI askpass program (like ssh-askpass, ksshaskpass, or custom implementations) with optional caching via the Linux kernel keyring.

  • Add AGE_ASKPASS environment variable support to read_secret() in age/src/cli_common.rs
  • Follows the SSH_ASKPASS convention: program receives prompt as $1, prints secret to stdout
  • Enables GUI-based PIN/passphrase entry and kernel keyring caching for non-interactive contexts (scripts, systemd services, sops-nix)
  • Priority chain: AGE_ASKPASS > PINENTRY_PROGRAM > default pinentry > TTY
  • Fully backwards compatible, no behavior change unless AGE_ASKPASS is set

@pinpox pinpox changed the title WIP: Add AGE_ASKPASS support for external secret prompting Add AGE_ASKPASS support for external secret prompting May 6, 2026
@pinpox pinpox force-pushed the age-askpass-support branch from 02d09b7 to 7621165 Compare May 6, 2026 18:24
pinpox added a commit to pinpox/nixos that referenced this pull request May 10, 2026
Adds a fork of rage with AGE_ASKPASS support so the YubiKey PIN can be
prompted via noctalia-askpass during age decryption. Sets PASSAGE_AGE=rage
so passage delegates to it instead of the Go age (which has no askpass
support).

Temporary until str4d/rage#617 lands upstream.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant