Skip to main content

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

  1. Set up YubiKey PIN, as explained here.

  2. Run this only once to set up a private key on the YubiKey, or to renew it after expiration:

    google-yubikey generate-key
    
  3. Run this once to register YubiKey with each Service Account:

    google-yubikey upload-key -a <service_account_email>
    
  4. Run this every time you'd like to generate a Service Account token:

    google-yubikey token -a <service_account_email>
    
  5. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

google-yubikey-0.2.3.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

google_yubikey-0.2.3-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file google-yubikey-0.2.3.tar.gz.

File metadata

  • Download URL: google-yubikey-0.2.3.tar.gz
  • Upload date:
  • Size: 6.2 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

Hashes for google-yubikey-0.2.3.tar.gz
Algorithm Hash digest
SHA256 14048c4c0f080c0154b6d9d7ec07ed09e28052bb09f16846e2cb169bdf141cec
MD5 d6c6c2340e0a23d9f26b228f4b95a210
BLAKE2b-256 87ae6301f777edbcaac3830c330c7c8705481b2c1c8e3c1e2b8defc4b1aa83e5

See more details on using hashes here.

File details

Details for the file google_yubikey-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: google_yubikey-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 5.7 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

Hashes for google_yubikey-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b08c1e19babb629157ad3a260dcac64450c4f65927303bfe2faf44c5e51602b6
MD5 b302554b6ab5360c522867bf7904c5b9
BLAKE2b-256 26509435a38c0060b475bf2c019f845d57a2e291004c0720d04afb9d868ba816

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page