smlx / piv-agent

An SSH and GPG agent which you can use with your PIV hardware security device (e.g. a Yubikey).
https://smlx.github.io/piv-agent/
Apache License 2.0
74 stars 6 forks source link
gpg gpg-agent hacktoberfest pgp piv ssh ssh-agent yubikey

PIV Agent

Release Coverage Go Report Card User Documentation

About


DISCLAIMER

I make no assertion about the security or otherwise of this software and I am not a cryptographer. If you are, please take a look at the code and send PRs or issues. :green_heart:


Features

Design philosophy

This agent should require no interaction and in general do the right thing when security keys are plugged/unplugged, laptop is power cycled, etc.

It is highly opinionated:

It makes some concession to practicality with OpenPGP:

It tries to strike a balance between security and usability:

Hardware support

Tested with:

Will be tested with (once PIV support is available):

Any device implementing the SCard API (PC/SC), and supported by piv-go / pcsclite may work. If you have tested another device with piv-agent successfully, please send a PR adding it to this list.

Platform support

Currently tested on Linux with systemd and macOS with launchd.

Protocol / Encryption Algorithm support

Supported Not Supported Support Blocked (Curve25519)

Curve25519 algorithms are blocked on hardware support. Currently I'm only aware of Solo V2 which intends to implement this non-standard curve. Support is not yet available (see the link above).

ssh-agent

Security Key Keyfile
ecdsa-sha2-nistp256
ssh-ed25519

gpg-agent

Security Key Keyfile
ECDSA Sign (NIST Curve P-256)
EDDSA Sign (Curve25519)
ECDH Decrypt
RSA Sign
RSA Decrypt

Install and Use

Please see the documentation.

Develop

Prerequisites

Install build dependencies:

# debian/ubuntu
sudo apt install libpcsclite-dev

Build and test

make

Build and test manually

This D-Bus variable is required for pinentry to use a graphical prompt:

go build ./cmd/piv-agent && systemd-socket-activate -l /tmp/piv-agent.sock -E DBUS_SESSION_BUS_ADDRESS ./piv-agent serve --debug

Then in another terminal:

export SSH_AUTH_SOCK=/tmp/piv-agent.sock
ssh ...

Build and test the documentation

cd docs && make serve