Coder Social home page Coder Social logo

Passphrase protecting age keys about sops-nix HOT 6 CLOSED

mic92 avatar mic92 commented on June 12, 2024
Passphrase protecting age keys

from sops-nix.

Comments (6)

dasJ avatar dasJ commented on June 12, 2024 1

We have something that might be helpful when you try to hack this together:

#!/usr/bin/env bash
set -euo pipefail

if [ -n "${VISOPS_PIPE:-}" ]; then
	declare SOPS_AGE_KEY_FILE
	SOPS_AGE_KEY_FILE="$(mktemp -p /dev/shm)"
	export SOPS_AGE_KEY_FILE
	trap 'rm -f "${SOPS_AGE_KEY_FILE}"' INT TERM EXIT
	eval "${VISOPS_PIPE}" > "${SOPS_AGE_KEY_FILE}"
fi
sops "${@}"

Essentially this allow you to do something like:

export VISOPS_PIPE='pass whatever/key | ssh-to-age -private-key'
$THE_SCRIPT_FROM_ABOVE -d myfile.yml

from sops-nix.

Mic92 avatar Mic92 commented on June 12, 2024

Would gnupg keys not be a better fit for you usecase?

from sops-nix.

Mic92 avatar Mic92 commented on June 12, 2024

I think age itself also supports password protected ssh keys? Maybe you can use age to decrypt another age key that is passed to sops. I have no plans on having support for this in sops-nix itself, but I would link to tutorials allowing this.

from sops-nix.

GrafBlutwurst avatar GrafBlutwurst commented on June 12, 2024

So in particular i want to move away from GPG for many reasons (basically what's listed in the blog post that is linked in the README). It really is more an issue of underlying sops but i opened the issue here because i thought maybe we can work around this using some nix shells as you described "Maybe you can use age to decrypt another age key that is passed to sops".

Personally I think it's odd that sops recommends age over gpg but then doesn't support passphrase protected keys.

I might hack around a bit with this when I find time and update this thread.

Thanks for your time!

from sops-nix.

Mic92 avatar Mic92 commented on June 12, 2024

Yeah something like should solve your issue.

from sops-nix.

Mic92 avatar Mic92 commented on June 12, 2024

You can also replace it with your favorite password manager

from sops-nix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.