Giter Site home page Giter Site logo

ftntming / vault-secrets-gen Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sethvargo/vault-secrets-gen

0.0 1.0 0.0 4.59 MB

A Vault secrets plugin for generating high entropy passwords and passphrases.

License: MIT License

Makefile 32.25% Go 59.24% Shell 8.51%

vault-secrets-gen's Introduction

Password Generator for HashiCorp Vault

Build Status

The Vault Password Generator is a Vault secrets plugin for generating cryptographically secure passwords and passphrases.

This is both a real custom Vault secrets plugin, and an example of how to build, install, and maintain your own Vault secrets plugin.

Setup

The setup guide assumes some familiarity with Vault and Vault's plugin ecosystem. You must have a Vault server already running, unsealed, and authenticated.

  1. Download and decompress the latest plugin binary from the Releases tab on GitHub. Alternatively you can compile the plugin from source, if you're into that kinda thing.

  2. Move the compiled plugin into Vault's configured plugin_directory:

    $ mv vault-secrets-gen /etc/vault/plugins/vault-secrets-gen
  3. Enable mlock so the plugin can safely be enabled and disabled:

    setcap cap_ipc_lock=+ep /etc/vault/plugins/vault-secrets-gen
  4. Calculate the SHA256 of the plugin and register it in Vault's plugin catalog. If you are downloading the pre-compiled binary, it is highly recommended that you use the published checksums to verify integrity.

    $ export SHA256=$(shasum -a 256 "/etc/vault/plugins/vault-secrets-gen" | cut -d' ' -f1)
    
    $ vault plugin register \
        -sha256="${SHA256}" \
        -command="vault-secrets-gen" \
        secret secrets-gen
  5. Mount the secrets engine:

    $ vault secrets enable \
        -path="gen" \
        -plugin-name="secrets-gen" \
        plugin

Usage & API

Generate Password

Generates a random, high-entropy password with the specified number of characters, digits, symbols, and configurables.

Method Path Produces
POST /gen/password 200 (application/json)

Parameters

  • length (int: 64) - Specifies the total length of the password including all letters, digits, and symbols.

  • digits (int: 10) - Specifies the number of digits to include in the password.

  • symbols (int: 10) - Specifies the number of symbols to include in the password.

  • allow_uppercase (bool: true) - Specifies whether to allow uppercase and lowercase letters in the password.

  • allow_repeat (bool: true) - Specifies to allow duplicate characters in the password. If set to false, be conscious of password length as values cannot be re-used.

CLI

$ vault write gen/password length=36 symbols=0
Key  	Value
---  	-----
value	27f3L5zKCZS8DD6D2PEK1xm0ECNaImg1PJqg

Generate Passphrase

Generates a random, high-entropy passphrase with the specified number of words and separator using the diceware algorithm.

Method Path Produces
POST /gen/passphrase 200 (application/json)

Parameters

  • words (int: 6) - Specifies the total number of words to generate.

  • separator (string: "-") - Specifies the string value to use as a separator between words.

CLI

$ vault write gen/passphrase words=4
Key  	Value
---  	-----
value	obstacle-sacrament-sizable-variably

License

This code is licensed under the MIT license.

vault-secrets-gen's People

Contributors

frntn avatar scarolan avatar sethvargo avatar

Watchers

 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.