Skip to content
/ tmux-vault Public

Easily access vault cubbyhole secrets from tmux

License

Notifications You must be signed in to change notification settings

dbd/tmux-vault

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tmux-vault

Access your vault cubbyhole login items within tmux!

This plugin allows you to access your vault cubbyhole items within tmux, using vault's CLI.

Requirements

This plugin relies on the following:

Key bindings

In any tmux mode:

  • prefix + u - list login items in a bottom pane.
  • prefix + N - create new login item in a bottom pane.

Install

Using Tmux Plugin Manager (recommended)

  1. Add plugin to the list of TPM plugins in .tmux.conf:

    set -g @plugin 'dbd/tmux-vault'
    
  2. Hit prefix + I to fetch the plugin and source it. You should now be able to use the plugin.

Manual Installation

  1. Clone this repo:

    $ git clone https://github.com/dbd/tmux-vault ~/some/path
  2. Source the plugin in your .tmux.conf by adding the following to the bottom of the file:

    run-shell ~/some/path/plugin.tmux
    
  3. Reload the environment by running:

    $ tmux source-file ~/.tmux.conf

Usage

On the initial use you will be prompted to login if you don't have a ~/.vault-token file. Once the file is created you will have no keys in the cubbyhole for that token. Credentials can be added by running the following. Where ldap is the key for the account, username is the ldap username and password is the ldap password. username is optional but password is a required field.

read -s pass
export pass
vault write cubbyhole/ldap username=jdoe password="$pass"
unset pass

Alternatively you can use the utility helper to create new keys easily. This can be done by doing PREFEX+U. Note the capital u. This open a similar pane and will prompt for the key, ldap in the above example, username, jdoe, and password.

Configuration

Customize this plugin by setting these options in your .tmux.conf file. Make sure to reload the environment afterwards.

Changing the default key-binding for this plugin

set -g @vault-key 'x'

Default: 'u'

Changing the default key-binding to create a new entry

set -g @vault-key 'U'

Default: 'N'

Setting the signin subdomain

set -g @vault-url 'https://vault.example.com'

Default: 'https://vault/'

Setting the default vault

set -g @vault-login-method 'ldap'

Default: 'userpass'

Copy the password to clipboard

By default, the plugin will use send-keys to send the selected password to the targeted pane. By setting the following, the password will be copied to the system's clipboard, which will be cleared after 30 seconds.

set -g @vault-copy-to-clipboard 'on'

Default: 'off'

Prior art

Also see:


License

MIT © Yarden Sod-Moriah

About

Easily access vault cubbyhole secrets from tmux

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages