All Projects → kr1sp1n → Node Vault

kr1sp1n / Node Vault

Licence: mit
Client for HashiCorp's Vault

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Node Vault

Hvac
🔒 Python 2.7/3.X client for HashiCorp Vault
Stars: ✭ 839 (+114.58%)
Mutual labels:  api, hashicorp, vault, client
Php Curl Class
PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs
Stars: ✭ 2,903 (+642.46%)
Mutual labels:  api, api-client, client
teller
Cloud native secrets management for developers - never leave your command line for secrets.
Stars: ✭ 998 (+155.24%)
Mutual labels:  vault, secrets, hashicorp
Unifi Api Client
A PHP API client class to interact with Ubiquiti's UniFi Controller API
Stars: ✭ 602 (+53.96%)
Mutual labels:  api, api-client, client
Igdb
Go client for the Internet Game Database API
Stars: ✭ 65 (-83.38%)
Mutual labels:  api, api-client, client
Python Nomad
Client library Hashicorp Nomad
Stars: ✭ 90 (-76.98%)
Mutual labels:  api, hashicorp, client
T Vault
Simplified secrets management solution
Stars: ✭ 316 (-19.18%)
Mutual labels:  hashicorp, vault, secrets
Httpie
As easy as /aitch-tee-tee-pie/ 🥧 Modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more. https://twitter.com/httpie
Stars: ✭ 53,052 (+13468.29%)
Mutual labels:  api, api-client, client
Cryptr
Cryptr: a GUI for Hashicorp's Vault
Stars: ✭ 324 (-17.14%)
Mutual labels:  hashicorp, vault, secrets
k8s-vault-webhook
A k8s vault webhook is a Kubernetes webhook that can inject secrets into Kubernetes resources by connecting to multiple secret managers
Stars: ✭ 107 (-72.63%)
Mutual labels:  vault, secrets
secrets-proxy
🔑 A secure proxy service for managing OneOps secrets.
Stars: ✭ 12 (-96.93%)
Mutual labels:  vault, secrets
Azure Key Vault To Kubernetes
Azure Key Vault to Kubernetes (akv2k8s for short) makes it simple and secure to use Azure Key Vault secrets, keys and certificates in Kubernetes.
Stars: ✭ 253 (-35.29%)
Mutual labels:  vault, secrets
polymerase
A tool for populating templates with environment variables and Vault values
Stars: ✭ 84 (-78.52%)
Mutual labels:  vault, secrets
vault-token-helper-osx-keychain
An example @hashicorp Vault token helper for Mac OS X Keychain.
Stars: ✭ 64 (-83.63%)
Mutual labels:  vault, hashicorp
Daytona
a vault client, but for containers and servers.
Stars: ✭ 255 (-34.78%)
Mutual labels:  vault, secrets
vim-hcl
Syntax highlighting for HashiCorp Configuration Language (HCL)
Stars: ✭ 83 (-78.77%)
Mutual labels:  vault, hashicorp
Hubspot Php
HubSpot PHP API Client
Stars: ✭ 273 (-30.18%)
Mutual labels:  api, api-client
vault-unseal
auto-unseal utility for Hashicorp Vault
Stars: ✭ 57 (-85.42%)
Mutual labels:  vault, hashicorp
Pymisp
Python library using the MISP Rest API
Stars: ✭ 254 (-35.04%)
Mutual labels:  api, api-client
Messenger
Package messenger is used for making bots for use with Facebook messenger
Stars: ✭ 278 (-28.9%)
Mutual labels:  api, client

node-vault

Build Status Coverage Status Download Status Dependency Status Open Collective backers and sponsors

A client for the HTTP API of HashiCorp's Vault written for Node.js.

install

make sure to use node.js version >= 6

npm install node-vault

test

Run tests inside docker to do also nice integration testing:

docker-compose up --force-recreate test

This will create containers for vault, postgres and running the tests inside docker.

usage

init and unseal

var options = {
  apiVersion: 'v1', // default
  endpoint: 'http://127.0.0.1:8200', // default
  token: '1234' // optional client token; can be fetched after valid initialization of the server
};

// get new instance of the client
var vault = require("node-vault")(options);

// init vault server
vault.init({ secret_shares: 1, secret_threshold: 1 })
.then( (result) => {
  var keys = result.keys;
  // set token for all following requests
  vault.token = result.root_token;
  // unseal vault server
  return vault.unseal({ secret_shares: 1, key: keys[0] })
})
.catch(console.error);

write, read and delete secrets

vault.write('secret/hello', { value: 'world', lease: '1s' })
.then( () => vault.read('secret/hello'))
.then( () => vault.delete('secret/hello'))
.catch(console.error);

docs

Just generate docco docs via npm run docs.

examples

Please have a look at the examples and the generated feature list to see what is already implemented.

Instead of installing all the dependencies like vault itself, postgres and other stuff you can use docker and docker-compose to link and run multiple docker containers with all of its dependencies.

git clone [email protected]:kr1sp1n/node-vault.git
cd node-vault
docker-compose up vault

Now you can run the examples from another terminal window.

First of all you should initialize and unseal the vault:

node example/init.js

You should see root_token: followed by a long key in the response. Please copy that long key and export it as environment variable:

export VAULT_TOKEN=<insert long key here>

Now you are able to run all of the other examples:

node example/policies.js

Connecting to vault through a bastion host

To connect to a vault server in a private network with a bastion host, you'll need to first open a connection:

ssh -D <socks4Port> bastion.example.com
const SocksProxyAgent = require('socks-proxy-agent');
const agent = new SocksProxyAgent(`socks://127.0.0.1:${socks4Port}`, true);
const options = {
  apiVersion: 'v1',
  rpOptions: {
    agent,
  },
};

const vault = require('node-vault')(options);

Backers

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].