Skip to content

Generalize SOPS_AGE_KEY to arbitrary executable #1323

@gkleen

Description

@gkleen

I currently see a few workarounds of the form SOPS_AGE_KEY=$(…) sops … floating around.

I would like to store my age key in my password manager, not have to specify a workaround each invocation as above, not wrap my sops binary in an outer shell script to set SOPS_AGE_KEY (difficult when sops is provided by various nix flakes via direnv), and not just set SOPS_AGE_KEY as environment for my entire user session on login.

It seems to me that these and similar usecases would benefit from a new environment variable SOPS_AGE_KEY_EXEC (bikeshedding welcome) that would contain a command that would be passed to exec.Command and run without arguments.
The stdout the command produces would then be used as an additional sops identity.

This would allow me to specify SOPS_AGE_KEY_EXEC globally for my entire user session and have my, securely stored, age key picked up by sops, even in my various direnven.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions