GithubHelp home page GithubHelp logo

yubikey's Introduction

⚠️ Repository Deprecated ⚠️

Notice: This code repository is no longer maintained or updated. The content and code are provided as-is, and may no longer be relevant or functional.

For Datadog employee, see the "commit signing setup guide" in Confluence instead_

YubiKey at Datadog

Summary

GPG is useful for authenticating yourself over SSH and / or GPG-signing your git commits / tags. However, without hardware like the YubiKey, you would typically keep your GPG private subkeys in "plain view" on your machine, even if encrypted. That is, attackers who personally target [1, 2, 3, 4] you can compromise your machine can exfiltrate your (encrypted) private key, and your passphrase, in order to pretend to be you.

Instead, this setup lets you store your private subkeys on your YubiKey. Actually, it gives you much stronger guarantees: you cannot authenticate over SSH and / or sign GPG commits / tags without: (1) your YubiKey plugged in and operational, (2) your YubiKey PIN, and (3) touching your YubiKey. So, even if there is malware trying to get you to sign, encrypt, or authenticate something, you would almost certainly notice, because your YubiKey will flash, asking for your attention. (There is the "time of check to time of use" issue, but that is out of our scope.)

Estimated burden and prerequisites

About 2-3 hours. 15 minutes could save you 15% or more on cybersecurity insurance.

You will need macOS with Homebrew / Ubuntu / Archlinux, a password manager, and a YubiKey 5.

U2F

STRONGLY recommended: configure U2F for GitHub and Google.

GPG

Please read and follow all of the instructions carefully.

$ ./gpg.sh

(Protip: set TEMPDIR=1 when preparing YubiKey for someone else to avoid polluting your default GPG homedir.)

git

STRONGLY RECOMMENDED: signing your git commits and tags.

You must first set up GPG.

Then, to sign git commits and tags for a particular repository:

$ ./git.sh /path/to/git/repository

Or, to sign git commits and tags for all repositories:

$ ./git.sh

SSH

NOT recommended for most users. This script sets up your YubiKey as the holder of your SSH key, helping to prevent it from being leaked or stolen. The script will take control of ssh-agent, so it's not particularly compatible with other SSH keys - you should only run this if you intend to use this as your only SSH key on the machine you're using.

With this setup, you'll need to enter a PIN to unlock the key every 24 hours and then physically touch the key when it blinks (i.e. every time you SSH or push/pull Git). If you don't touch the key, the request will timeout and you'll get an unhelpful message.

This is compatible with usage on remote machines over SSH (it will set up agent forwarding to use the key remotely; touch is required on each action).

You must have first set up GPG. Then:

$ ./ssh.sh

Reset

If you need to reset YubiKeys, you may use the following script. The script looks for every plugged YubiKey, and shows a menu to reset one specific key, or all of them. Please read and follow all of the instructions carefully. YOU WILL NOT BE ABLE TO RETRIEVE KEYS/DATA FROM THE YUBIKEY AFTER COMPLETION.

$ ./reset.sh

Troubleshooting

Go here for troubleshooting common issues such as unblocking a blocked card, error when pulling or pushing with git over SSH, and rebasing with git.

Optional

Go here for support on optional bits such as configuring a computer to use an already configured YubiKey, signing for different git repositories with different keys, Keybase, VMware Fusion, and Docker Content Trust.

References

  1. YubiKey Handbook

  2. A Git Horror Story: Repository Integrity With Signed Commits

  3. Welp, there go my Git signatures

  4. [Bitcoin-development] PSA: Please sign your git commits

yubikey's People

Contributors

trishankatdatadog avatar daisukixci avatar klivan avatar masci avatar mdeous-datadog avatar mdgreenfield avatar ofek avatar pwyliu avatar srosenthal-dd avatar pratikgs-dd avatar badouralix avatar platinummonkey avatar cedricvanrompay-datadog avatar elptacek-dd avatar gmmeyer avatar guedou avatar guyboltonking avatar hadrienpatte avatar gharryg avatar xornivore avatar lucaspimentel avatar mbakht avatar pgimalac avatar romain-dd avatar bkabrda avatar tannerprynn-datadog avatar valerian-roche avatar drewcsillagdd avatar mtoffl01 avatar turettn avatar

Watchers

James Cloos avatar  avatar

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.