Code Monkey home page Code Monkey logo

vault-counter's Introduction

Vault Counter

Table of Contents

  1. Overview
  2. Usage
  3. Inputs

Overview

This fork includes a print function to print out metadata associated with each Entity, User, Role and optionally Tokens. To print token metatada, please export PRINT_TOKEN_META=1 before running the script.

Simply container script to run and count HashiCorp Vault entities, roles/users, and tokens created without entities. The script will drill into an child namespaces below the supplied namespace input.

Usage

The container runs several cURL commands against the API. Here's what it looks like with supplied arguments:

$ docker run --rm \
  -e VAULT_ADDR=http://my.vault.url.com:8200 \
  -e VAULT_TOKEN=$VAULT_TOKEN \
  whatsaranjit/vault_counter
Vault address: http://my.vault.url.com:8200
Total entities: 2
Total auth roles/users: 2
Total tokens: 1

TLS Example

Be sure to share the cert/key/ca into the container for use.

docker run --rm \
  -v $PWD/certs:/certs \
  -e VAULT_CLIENT_CERT=/certs/test.crt \
  -e VAULT_CLIENT_KEY=/certs/test.key \
  -e VAULT_CACERT=/certs/ca.crt \
  -e VAULT_ADDR=https://my.vault.url.com:8200 \
  -e VAULT_TOKEN=$VAULT_TOKEN \
  whatsaranjit/vault_counter

Inputs

These are supplied to the runtime via environment variables.

  • VAULT_ADDR

The URL to your Vault server

Default: http://127.0.0.1:8200

  • VAULT_TOKEN

A token with enough permissions to access the identity/ and sys/auth/ endpoints.

Default: root

  • VAULT_NAMESPACE

Namespace within Vault to count along with all child namespaces.

Default: null

  • VAULT_CLIENT_CERT

Path to file containing the client certificate.

Default: null

  • VAULT_CLIENT_KEY

Path to file containing the client key.

Default: null

  • VAULT_CACERT

Path to file containing the CA certificate.

Default: null

  • CURL_VERBOSE

Set to anything to add the -v flag to cURL statements.

Default: null

vault-counter's People

Contributors

whatsaranjit avatar kawsark avatar

Stargazers

James Bayer avatar

Watchers

James Cloos 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.