Generate Google Service Account tokens with your YubiKey
Project description
google-yubikey
Generate Google Service Account tokens with your YubiKey!
Motivation
This is perhaps the most secure way to use Google credentials outside of Google Cloud, since the private key never leaves the device, and so it cannot be leaked or stolen without physically stealing the YubiKey.
Additionally, each operation is protected with a YubiKey PIN, providing a 2nd factor of authentication as something a user knows (in addition to something a user has, which is the YubiKey itself).
In this way, a single YubiKey can represent the identity of a user across many Service Accounts, without the need to send the private key material over the wire at any point.
This makes it even more secure than Service Account impersonation, where a user's long-term refresh token has been traditionally stored on their machine, and could thus be compromised.
Requirements
YubiKey 4+
Setup
pip3 install google-yubikey
Usage
-
Set up YubiKey PIN, as explained here.
-
Run this only once to set up a private key on the YubiKey, or to renew it after expiration:
google-yubikey generate-key
-
Run this once to register YubiKey with each Service Account:
google-yubikey upload-key -a <service_account_email>
-
Run this every time you'd like to generate a Service Account token:
google-yubikey token -a <service_account_email>
-
Further customization options are available through:
google-yubikey [<command>] -h
Disclaimer
This tool is still early on in the development. It works, but may have unusual edge cases that make it fail for your setup. Please use with caution, and raise an issue if you come across one.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file google-yubikey-0.2.0.tar.gz
.
File metadata
- Download URL: google-yubikey-0.2.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 857a5c1fc920aedbb5525faf56586f557b3113dc5abbc772945938edff836b6d |
|
MD5 | 231063ec563e8004dec89a8499eb24b3 |
|
BLAKE2b-256 | b83bcb7865fb52fd98c191a87053ebd59c01542f90041e83b4587af5cbd4b70b |
File details
Details for the file google_yubikey-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: google_yubikey-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 744ae3b33fcc9aaf1d51afcc2349a9fb1b7c580186517cbde332d56e63b6ac3a |
|
MD5 | dfb5a3691f2a028000f4fb506a3fb847 |
|
BLAKE2b-256 | ede83c4fafed76527c8cdf04291e9b92115665b6f5a62f2f9199c5567e864608 |