GithubHelp home page GithubHelp logo

lcpinto / varsgen Goto Github PK

View Code? Open in Web Editor NEW

This project forked from orange-cloudfoundry/varsgen

0.0 0.0 0.0 143 KB

Small cli utility to generate password, ssh key, rsa and certificate by passing a yaml file describing credentials to generate

License: Apache License 2.0

Go 100.00%

varsgen's Introduction

Varsgen

Small cli utility to generate password, ssh key, rsa and certificate by passing a yaml file describing credentials to generate.

This tools come from bosh-cli but useable outside of this context.

Install

Get the latest binary for your os in release page

Usage

You must create a file containing how credentials will be generated, example with file name my-creds-def.yml:

# Generate a random password
- name: a_password
  type: password
  options:
    # optional field for setting length of your password, Default to 20
    length: 24

# Generate a ssh key
- name: a_ssh_key
  type: ssh

# Generate a rsa
- name: a_rsa
  type: rsa

# Generate a CA certificate 
- name: my_ca_certificate
  options:
    # Required field giving the common name, don't forget to set common_name also as alternative_names for certificate
    common_name: a_common_name
    # optional field for setting organization name, Default to Cloud Foundry
    organization: an_organization
    # optional field for setting multiple organizations, Default to organization
    organizations: [ an_organization, a_second_org ]
    # optional field to set if certificate is CA certificate or not, default to false
    is_ca: true
    # optional field to set the number of days after certificate will expire, default to 365
    duration: 3650
  type: certificate


# Generate a certificate based on a CA
- name: my_app_certificate
  options:
    # Required field giving the common name, don't forget to set common_name also as alternative_names for certificate
    common_name: a_app_common_name
    # optional field for setting organization name, Default to Cloud Foundry
    organization: an_organization
    # optional field to set if certificate is CA certificate or not, default to false
    is_ca: true
    # optional field to set the number of days after certificate will expire, default to 365
    duration: 730
    # optional field to add alternative name to certificate, this can be an IP or a DNS entry
    # common name must be in alternative_name
    alternative_names:
      - a_app_common_name
    # Required field to connect to a ca certificate variable, here it will use my_ca_certificate from previous var generation
    # CA generation MUST be before certificate
    ca: my_ca_certificate
    # Optional field to set what is the key usage, it can be client_auth or server_auth, default to server_auth
    extended_key_usage:
      - client_auth
  type: certificate

You can now use command line for creating your credentials store based on your definitions, the command line will only create variable not existing in the store.

Run simply:

varsgen -d my-creds-def.yml -s creds-store.yml

You will now have a yml file with generated creds in creds-store.yml.

varsgen's People

Contributors

dependabot[bot] avatar arthurhlt 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.