Code Monkey home page Code Monkey logo

vault's Introduction

Vault build ci vault enterprise


Please note: We take Vault's security and our users' trust very seriously. If you believe you have found a security issue in Vault, please responsibly disclose by contacting us at [email protected].


Vault Logo

Vault is a tool for securely accessing secrets. A secret is anything that you want to tightly control access to, such as API keys, passwords, certificates, and more. Vault provides a unified interface to any secret, while providing tight access control and recording a detailed audit log.

A modern system requires access to a multitude of secrets: database credentials, API keys for external services, credentials for service-oriented architecture communication, etc. Understanding who is accessing what secrets is already very difficult and platform-specific. Adding on key rolling, secure storage, and detailed audit logs is almost impossible without a custom solution. This is where Vault steps in.

The key features of Vault are:

  • Secure Secret Storage: Arbitrary key/value secrets can be stored in Vault. Vault encrypts these secrets prior to writing them to persistent storage, so gaining access to the raw storage isn't enough to access your secrets. Vault can write to disk, Consul, and more.

  • Dynamic Secrets: Vault can generate secrets on-demand for some systems, such as AWS or SQL databases. For example, when an application needs to access an S3 bucket, it asks Vault for credentials, and Vault will generate an AWS keypair with valid permissions on demand. After creating these dynamic secrets, Vault will also automatically revoke them after the lease is up.

  • Data Encryption: Vault can encrypt and decrypt data without storing it. This allows security teams to define encryption parameters and developers to store encrypted data in a location such as a SQL database without having to design their own encryption methods.

  • Leasing and Renewal: All secrets in Vault have a lease associated with them. At the end of the lease, Vault will automatically revoke that secret. Clients are able to renew leases via built-in renew APIs.

  • Revocation: Vault has built-in support for secret revocation. Vault can revoke not only single secrets, but a tree of secrets, for example, all secrets read by a specific user, or all secrets of a particular type. Revocation assists in key rolling as well as locking down systems in the case of an intrusion.

Documentation, Getting Started, and Certification Exams

Documentation is available on the Vault website.

If you're new to Vault and want to get started with security automation, please check out our Getting Started guides on HashiCorp's learning platform. There are also additional guides to continue your learning.

For examples of how to interact with Vault from inside your application in different programming languages, see the vault-examples repo. An out-of-the-box sample application is also available.

Show off your Vault knowledge by passing a certification exam. Visit the certification page for information about exams and find study materials on HashiCorp's learning platform.

Developing Vault

If you wish to work on Vault itself or any of its built-in systems, you'll first need Go installed on your machine.

For local dev first make sure Go is properly installed, including setting up a GOPATH. Ensure that $GOPATH/bin is in your path as some distributions bundle the old version of build tools. Next, clone this repository. Vault uses Go Modules, so it is recommended that you clone the repository outside of the GOPATH. You can then download any required build tools by bootstrapping your environment:

$ make bootstrap
...

To compile a development version of Vault, run make or make dev. This will put the Vault binary in the bin and $GOPATH/bin folders:

$ make dev
...
$ bin/vault
...

To compile a development version of Vault with the UI, run make static-dist dev-ui. This will put the Vault binary in the bin and $GOPATH/bin folders:

$ make static-dist dev-ui
...
$ bin/vault
...

To run tests, type make test. Note: this requires Docker to be installed. If this exits with exit status 0, then everything is working!

$ make test
...

If you're developing a specific package, you can run tests for just that package by specifying the TEST variable. For example below, only vault package tests will be run.

$ make test TEST=./vault
...

Importing Vault

This repository publishes two libraries that may be imported by other projects: github.com/hashicorp/vault/api and github.com/hashicorp/vault/sdk.

Note that this repository also contains Vault (the product), and as with most Go projects, Vault uses Go modules to manage its dependencies. The mechanism to do that is the go.mod file. As it happens, the presence of that file also makes it theoretically possible to import Vault as a dependency into other projects. Some other projects have made a practice of doing so in order to take advantage of testing tooling that was developed for testing Vault itself. This is not, and has never been, a supported way to use the Vault project. We aren't likely to fix bugs relating to failure to import github.com/hashicorp/vault into your project.

See also the section "Docker-based tests" below.

Acceptance Tests

Vault has comprehensive acceptance tests covering most of the features of the secret and auth methods.

If you're working on a feature of a secret or auth method and want to verify it is functioning (and also hasn't broken anything else), we recommend running the acceptance tests.

Warning: The acceptance tests create/destroy/modify real resources, which may incur real costs in some cases. In the presence of a bug, it is technically possible that broken backends could leave dangling data behind. Therefore, please run the acceptance tests at your own risk. At the very least, we recommend running them in their own private account for whatever backend you're testing.

To run the acceptance tests, invoke make testacc:

$ make testacc TEST=./builtin/logical/consul
...

The TEST variable is required, and you should specify the folder where the backend is. The TESTARGS variable is recommended to filter down to a specific resource to test, since testing all of them at once can sometimes take a very long time.

Acceptance tests typically require other environment variables to be set for things such as access keys. The test itself should error early and tell you what to set, so it is not documented here.

For more information on Vault Enterprise features, visit the Vault Enterprise site.

Docker-based Tests

We have created an experimental new testing mechanism inspired by NewTestCluster. An example of how to use it:

import (
  "testing"
  "github.com/hashicorp/vault/sdk/helper/testcluster/docker"
)

func Test_Something_With_Docker(t *testing.T) {
  opts := &docker.DockerClusterOptions{
    ImageRepo: "hashicorp/vault", // or "hashicorp/vault-enterprise"
    ImageTag:    "latest",
  }
  cluster := docker.NewTestDockerCluster(t, opts)
  defer cluster.Cleanup()
  
  client := cluster.Nodes()[0].APIClient()
  _, err := client.Logical().Read("sys/storage/raft/configuration")
  if err != nil {
    t.Fatal(err)
  }
}

Or for Enterprise:

import (
  "testing"
  "github.com/hashicorp/vault/sdk/helper/testcluster/docker"
)

func Test_Something_With_Docker(t *testing.T) {
  opts := &docker.DockerClusterOptions{
    ImageRepo: "hashicorp/vault-enterprise",
    ImageTag:  "latest",
	VaultLicense: licenseString, // not a path, the actual license bytes
  }
  cluster := docker.NewTestDockerCluster(t, opts)
  defer cluster.Cleanup()
}

Here is a more realistic example of how we use it in practice. DefaultOptions uses hashicorp/vault:latest as the repo and tag, but it also looks at the environment variable VAULT_BINARY. If populated, it will copy the local file referenced by VAULT_BINARY into the container. This is useful when testing local changes.

Instead of setting the VaultLicense option, you can set the VAULT_LICENSE_CI environment variable, which is better than committing a license to version control.

Optionally you can set COMMIT_SHA, which will be appended to the image name we build as a debugging convenience.

func Test_Custom_Build_With_Docker(t *testing.T) {
  opts := docker.DefaultOptions(t)
  cluster := docker.NewTestDockerCluster(t, opts)
  defer cluster.Cleanup()
}

There are a variety of helpers in the github.com/hashicorp/vault/sdk/helper/testcluster package, e.g. these tests below will create a pair of 3-node clusters and link them using PR or DR replication respectively, and fail if the replication state doesn't become healthy before the passed context expires.

Again, as written, these depend on having a Vault Enterprise binary locally and the env var VAULT_BINARY set to point to it, as well as having VAULT_LICENSE_CI set.

func TestStandardPerfReplication_Docker(t *testing.T) {
  opts := docker.DefaultOptions(t)
  r, err := docker.NewReplicationSetDocker(t, opts)
  if err != nil {
      t.Fatal(err)
  }
  defer r.Cleanup()

  ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
  defer cancel()
  err = r.StandardPerfReplication(ctx)
  if err != nil {
    t.Fatal(err)
  }
}

func TestStandardDRReplication_Docker(t *testing.T) {
  opts := docker.DefaultOptions(t)
  r, err := docker.NewReplicationSetDocker(t, opts)
  if err != nil {
    t.Fatal(err)
  }
  defer r.Cleanup()

  ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
  defer cancel()
  err = r.StandardDRReplication(ctx)
  if err != nil {
    t.Fatal(err)
  }
}

Finally, here's an example of running an existing OSS docker test with a custom binary:

$ GOOS=linux make dev
$ VAULT_BINARY=$(pwd)/bin/vault go test -run 'TestRaft_Configuration_Docker' ./vault/external_tests/raft/raft_binary
ok      github.com/hashicorp/vault/vault/external_tests/raft/raft_binary        20.960s

vault's People

Contributors

armon avatar austingebauer avatar briankassouf avatar calvn avatar ccapurso avatar chrishoffman avatar cipherboy avatar fairclothjm avatar hashishaw avatar hellobontempo avatar jasonodonnell avatar jefferai avatar joshuaogle avatar meirish avatar mitchellh avatar mladlow avatar monkeychip avatar ncabatoff avatar noelledaley avatar peteski22 avatar raskchanky avatar sethvargo avatar sgmiller avatar stevendpclark avatar tomhjp avatar tvoran avatar violethynes avatar vishalnayak avatar yhyakuna avatar zofskeez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vault's Issues

Starting server gives "Error initializing core: missing advertisement address" message

I was going through the docs today, particularly http://vaultproject.io/intro/getting-started/deploy.html where it gives a sample server config file and then has you run the following
vault server --config=example.hcl
However, when I use the configuration file, I get the following error:
Error initializing core: missing advertisement address
Here is the example.hcl file:

backend "consul" {
  address = "demo.consul.io:80"
  path = "abvault12345"
}

listener "tcp" {
 address = "127.0.0.1:8200"
 tls_disable = 1
}

It seems that when you use Consul backend, it needs the .hcl file to be more like this:

backend "consul" {
  address = "demo.consul.io:80"
  path = "abvault12345"
  advertise_addr = "127.0.0.1"
}

listener "tcp" {
 address = "127.0.0.1:8200"
 tls_disable = 1
}

(I have no idea what kind of address advertise_addr wants)

Using this file, I was able to get the server started successfully. You can read more about the server configuration here: http://vaultproject.io/docs/config/index.html#advertise_addr.

Also, in your examples, frequently the "--" is rendered as a long dash instead of two. Probably most people know about this, but it will trip up new users.

Cannot compile on bsds

It is not possible to compile vault on free/new/open-bsd:

--> freebsd/amd64 error: exit status 2
Stderr: # github.com/hashicorp/vault/vault
../vault/vault/unix.go:11: undefined: syscall.Mlockall

I suspect people will want to use Vault on their BSDs, but this also means that anything using Vault as a dependency also cannot support BSD.

Documentation states that "advertise_addr" is optional, but it isn't

When attempting to start up a Vault server connecting to a local single-node Consul server, I was unable to start the Vault server without the advertise_addr option:

Error initializing core: missing advertisement address

It's marked as optional in the documentation, but should probably be marked as required, or at least required when using a backend with HA capabilities.

Docs encourage a default behaviour of entering secrets via the command line

Hi all - first up, I really like the idea of Vault and appreciate the work Hashicorp are doing to make a free software password manager, of which it's been really hard to find a good quality option.

What I don't like is the fact that for writing data, the docs encourage you to enter secrets through the command line, which could expose secrets through shell history or the process table.

If this is fixed I will strongly consider you as a replacement for our current solution (http://www.passwordstore.org, note that they throw the user into an editor before writing data, which may provide inspiration for an alternative).

I'm aware that there is the option to write data from a file, but this isn't default and there's the possibility of the file being accidentally left behind. I think a purely editor-based solution would be best?

Lastpass as a backend storage mechanism.

What do people think of adding support for lastpass vaults to be used as backend storage for credentials? There's a master password on a lastpass vault but you could namespace certain configs into folders.

It could also allow for the import into vault from a lastpass vault. I know that I have some shared passwords in lastpass that would be great to be able to "import" into vault. Perhaps that should be more of a manual process though?

I can see the syncing of the remote lastpass vault state and the local vault state as potentially being an issue.

Examples for webdevelopers

My UseCase:

I have developed a php app as microservice, which is being called by the main application. The main application is on another server. The microservice is a notification messages app, that has it's own database to store messages.

The main application can perform CRUD actions on the microservice. Right now I am looking into vault to implement some authentication. But it's not very clear on how it all fits in. I get the bigger "vault" picture.. but I do not get how I should get authentication working through REST calls.
Do I need to set headers? Do I run php exec?

It would be nice to get a broader view on how you would like us to work with this.

advertise_addr has to include schema

4:59 PM <tarrant> So next issue. It looks like when forwarding requests with HA vaults they don't know what protocol or IP to connect to.
5:00 PM <tarrant> Get https:///v1/secret/<program_name>/<env>/<key>: http: no Host in request URL
5:10 PM <mitchellh> tarrant: Hm, this should come from the advertise_addr, is that set on the master?
5:10 PM <tarrant> Should be
5:10 PM <tarrant> I'll double check
5:10 PM <mitchellh> armon: ping on you for this one ^
5:11 PM <tarrant> {"backend":{"consul":{"advertise_addr":"10.192.64.146","path":"/application-data/vault/production"}},"listener":{"tcp":{"address":"0.0.0.0:8200","tls_disable":"1"}}}
5:11 PM <tarrant> Maybe it needs to be http://10.192...
5:15 PM <tarrant> ahh yes that fixed  it
5:15 PM <tarrant> `http://<ip>:8200` as the advertise addr
5:15 PM <mitchellh> oh wow
5:16 PM <mitchellh> Okay :| let me open that issue

Missing build instructions for builds on Windows

It seems that building of vaul using MSys isn't supported yet:

2015/04/29 10:12:06 [INFO] core: post-unseal setup starting
2015/04/29 10:12:06 [INFO] core: post-unseal setup complete
2015/04/29 10:12:06 [INFO] rollback: starting rollback manager
FAIL
FAIL    github.com/hashicorp/vault/command      0.457s
ok      github.com/hashicorp/vault/command/server       0.072s
--- FAIL: TestHelperPath (0.00s)
        helper_test.go:23: input: /foo, expected: /foo, got: C:\Users\whatever\AppData\Local\Temp\go-build301769015\github.com\hashicorp\vault\command\token\_test\t
oken.test.exe token-/foo
--- FAIL: TestHelper (0.04s)
        testing.go:17: err: Error: exit status 127

                sh: C:UserswhateverAppDataLocalTempgo-build301769015github.comhashicorpvaultcommandtoken_testtoken.test.exe: command not found
FAIL
FAIL    github.com/hashicorp/vault/command/token        0.072s

Running vault in dev mode does not work

Following the tutorial and fell at the first fence :-(

$ uname -a
Linux myhost 3.13.0-49-generic #83-Ubuntu SMP Fri Apr 10 20:11:33 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

$ vault version
Vault v0.1.0-dev (e9b3ad035308f73889dca383c8c423bb5939c4fc+CHANGES)

$ vault server -dev
Error initializing core: failed to lock memory: cannot allocate memory

Runtime error when "vault auth" against revoked token

I ran vault token-create and received a token. I then ran vault auth TOKEN_ID and received a "Successfully authenticated!" message. Finally I ran vault token-revoke TOKEN_ID and received a "Revocation successful" message. So far so good.

I then ran another vault auth TOKEN_ID again to see what error I would receive for an invalid auth token, and received the following error:

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x20 pc=0x4a5765]

goroutine 1 [running]:
github.com/hashicorp/vault/command.(*AuthCommand).Run(0xc20808e200, 0x0, 0x0, 0x0, 0xc208042380)
        /Users/mitchellh/code/go/src/github.com/hashicorp/vault/command/auth.go:156 +0x1665
github.com/mitchellh/cli.(*CLI).Run(0xc208044b40, 0xc20801e640, 0x0, 0x0)
        /Users/mitchellh/code/go/src/github.com/mitchellh/cli/cli.go:100 +0x3ce
github.com/hashicorp/vault/cli.RunCustom(0xc20800a010, 0x2, 0x2, 0xc20800b1a0, 0xa1a080)
        /Users/mitchellh/code/go/src/github.com/hashicorp/vault/cli/main.go:44 +0x484
github.com/hashicorp/vault/cli.Run(0xc20800a010, 0x2, 0x2, 0x5055d0)
        /Users/mitchellh/code/go/src/github.com/hashicorp/vault/cli/main.go:11 +0x53
main.main()
        /Users/mitchellh/code/go/src/github.com/hashicorp/vault/main.go:10 +0x6d

goroutine 5 [syscall]:
os/signal.loop()
        /Users/mitchellh/code/3rdparty/go/src/os/signal/signal_unix.go:21 +0x1f
created by os/signal.init·1
        /Users/mitchellh/code/3rdparty/go/src/os/signal/signal_unix.go:27 +0x35

goroutine 6 [semacquire]:
sync.(*Cond).Wait(0xc2080c8030)
        /Users/mitchellh/code/3rdparty/go/src/sync/cond.go:62 +0x9e
io.(*pipe).read(0xc2080c8000, 0xc20800f000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
        /Users/mitchellh/code/3rdparty/go/src/io/pipe.go:52 +0x303
io.(*PipeReader).Read(0xc208036058, 0xc20800f000, 0x1000, 0x1000, 0xb9f630, 0x0, 0x0)
        /Users/mitchellh/code/3rdparty/go/src/io/pipe.go:134 +0x5b
bufio.(*Scanner).Scan(0xc20808e280, 0x48c17b)
        /Users/mitchellh/code/3rdparty/go/src/bufio/scan.go:180 +0x688
github.com/hashicorp/vault/command.func·010()
        /Users/mitchellh/code/go/src/github.com/hashicorp/vault/command/meta.go:176 +0x3d
created by github.com/hashicorp/vault/command.(*Meta).FlagSet
        /Users/mitchellh/code/go/src/github.com/hashicorp/vault/command/meta.go:179 +0x4c1

goroutine 15 [runnable]:
net/http.(*persistConn).readLoop(0xc2080c60b0)
        /Users/mitchellh/code/3rdparty/go/src/net/http/transport.go:928 +0x9ce
created by net/http.(*Transport).dialConn
        /Users/mitchellh/code/3rdparty/go/src/net/http/transport.go:660 +0xc9f

goroutine 16 [select]:
net/http.(*persistConn).writeLoop(0xc2080c60b0)
        /Users/mitchellh/code/3rdparty/go/src/net/http/transport.go:945 +0x41d
created by net/http.(*Transport).dialConn
        /Users/mitchellh/code/3rdparty/go/src/net/http/transport.go:661 +0xcbc

Display giant warning when running without mlock

When running vault on a system that doesn't offer mlock, there should be a giant warning, similar to what GPG does. The docs should clearly describe this situation and explain the danger of swapping secret data to disk.

gpg: Warning: using insecure memory!

I'm happy to make a pull request if you're interested.

Panic when running on Windows 8

Running vault in Windows 8 immediately panics with both the 32 and 64-bit prebuilt binaries.

PS C:\Users\William\Downloads> .\vault.exe
panic: Failed to find SetConsoleMod procedure in kernel32.dll: The specified procedure could not be found.

goroutine 1 [running]:
syscall.(*DLL).MustFindProc(0xc082006bc0, 0xa6c830, 0xd, 0xc082008b70)
        /Users/mitchellh/code/3rdparty/go/src/syscall/dll_windows.go:95 +0x88
github.com/hashicorp/vault/helper/password.init()
        /Users/mitchellh/code/go/src/github.com/hashicorp/vault/helper/password/password_windows.go:12 +0xff
github.com/hashicorp/vault/command.init()
        /Users/mitchellh/code/go/src/github.com/hashicorp/vault/command/write.go:122 +0xdf
github.com/hashicorp/vault/cli.init()
        /Users/mitchellh/code/go/src/github.com/hashicorp/vault/cli/version.go:13 +0x67
main.init()
        /Users/mitchellh/code/go/src/github.com/hashicorp/vault/main.go:11 +0x49

goroutine 2 [runnable]:
runtime.forcegchelper()
        /Users/mitchellh/code/3rdparty/go/src/runtime/proc.go:90
runtime.goexit()
        /Users/mitchellh/code/3rdparty/go/src/runtime/asm_amd64.s:2232 +0x1

goroutine 3 [runnable]:
runtime.bgsweep()
        /Users/mitchellh/code/3rdparty/go/src/runtime/mgc0.go:82
runtime.goexit()
        /Users/mitchellh/code/3rdparty/go/src/runtime/asm_amd64.s:2232 +0x1

goroutine 4 [runnable]:
runtime.runfinq()
        /Users/mitchellh/code/3rdparty/go/src/runtime/malloc.go:712
runtime.goexit()
        /Users/mitchellh/code/3rdparty/go/src/runtime/asm_amd64.s:2232 +0x1

goroutine 5 [runnable]:
os/signal.loop()
        /Users/mitchellh/code/3rdparty/go/src/os/signal/signal_unix.go:19
created by os/signal.init┬╖1
        /Users/mitchellh/code/3rdparty/go/src/os/signal/signal_unix.go:27 +0x3c

SSH accounts as a secret backend

A "ssh" secret backend that generates SSH accessible user accounts on production servers. When coupled with Issue #94 (LDAP authentication) one would have an account management solution that would satisfy any corporate audit.

Concept could be extended to control when a user is allowed access. For example only during business hours or perhaps a requirement to submit a valid change request ticket. How far can you take this idea?

Create some vault managed servers

$ vault mount ssh -path "server000123"
$ vault write ssh/config/connection/server000123 host="server000123" user="root" pass="ZZZZZZZZ"

$ vault mount ssh -path "server000124"
$ vault write ssh/config/connection/server000124 host="server000124" user="root" pass="ZZZZZZZZ"

Set a lease period on credentials

$ vault write ssh/config/lease lease=1h lease_max=24h

Configure some user roles

$ vault write ssh/roles/admin value="useradd -G admins {{name}}"
$ vault write ssh/roles/user value="useradd -G users {{name}}"

Usage

Request "admin" access on the first server:

$ vault read server000123/creds/admin
..
username admin-12345XYZ
password 132ae3ef-5a64-7499-351e-bfe59f3a2a21

Request "user" access on the second server

$ vault read server000124/creds/user
..
username user-XYZ1234
password 132ae3ef-34567-7499-351e-xhsgdooedjkd

A tool like the Consul template could be used to keep configure files up to date for automated SSH processes.

A bad audit backend can make Vault unusable

If I enable an audit backend for file, for example, but I specify a path I do not have write permissions to, Vault becomes unusable. All requests will fail because the audit fails to write, but I cannot disable the audit without killing the server.

2015/04/24 14:57:02 [ERR] audit: backend 'audit/' failed to log request: open testing: no such file or directory
2015/04/24 14:57:02 [ERR] core: failed to audit request (*logical.Request{Operation:"delete", Path:"sys/audit/testing", Data:map[string]interface {}(nil), Storage:logical.Storage(nil), Secret:<nil>, Auth:<nil>, Connection:(*logical.Connection)(nil), ClientToken:"...", DisplayName:"root"}): no audit backend succeeded in logging the request

Provide a way to list secrets

It would be really great to have some way to list the secrets stored in a Vault. This would make it easier to keep a vault clean, to document what's present, and (potentially) to export secrets to a new vault, if the configuration needs to change or if the unsealing keys need to be changed for some reason.

command/server.go ignores err return from vault.NewCore

Found use HA Consul as a backend without specifying an advertise_addr in the configuration file. vault.NewCore returns nil, fmt.Errorf("missing advertisement address") but command/server.go does not check the error and uses nil.

Cloudflare's certificate sharing

The choice of certificate is rather unfortunate. The SANs are shared with, among others:

  • icanhazmeow.com
  • warezfiles.ru

It's weird to see a site dedicated to keeping secrets co-located with a "warez" host. The server gets an A grade from Qualys, and no one complained about CloudFlare so far, but the co-tenancy is kinda risky (see https://security.stackexchange.com/a/37038/13820).

Failed to lock memory: cannot allocate memory

Hello everybody,

Can somebody explain this to me:

[12:12 PM]-[vagrant@cockmagic]-[/var/www]
$ vault server -dev
Error initializing core: failed to lock memory: cannot allocate memory

htop screenshot:
htop

Runtime error when "vault auth" against revoked token

I ran vault token-create and received a token. I then ran vault auth TOKEN_ID and received a "Successfully authenticated!" message. Finally I ran vault token-revoke TOKEN_ID and received a "Revocation successful" message. So far so good.

I then ran another vault auth TOKEN_ID again to see what error I would receive for an invalid auth token, and received the following error:

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x20 pc=0x4a5765]

goroutine 1 [running]:
github.com/hashicorp/vault/command.(*AuthCommand).Run(0xc20808e200, 0x0, 0x0, 0x0, 0xc208042380)
        /Users/mitchellh/code/go/src/github.com/hashicorp/vault/command/auth.go:156 +0x1665
github.com/mitchellh/cli.(*CLI).Run(0xc208044b40, 0xc20801e640, 0x0, 0x0)
        /Users/mitchellh/code/go/src/github.com/mitchellh/cli/cli.go:100 +0x3ce
github.com/hashicorp/vault/cli.RunCustom(0xc20800a010, 0x2, 0x2, 0xc20800b1a0, 0xa1a080)
        /Users/mitchellh/code/go/src/github.com/hashicorp/vault/cli/main.go:44 +0x484
github.com/hashicorp/vault/cli.Run(0xc20800a010, 0x2, 0x2, 0x5055d0)
        /Users/mitchellh/code/go/src/github.com/hashicorp/vault/cli/main.go:11 +0x53
main.main()
        /Users/mitchellh/code/go/src/github.com/hashicorp/vault/main.go:10 +0x6d

goroutine 5 [syscall]:
os/signal.loop()
        /Users/mitchellh/code/3rdparty/go/src/os/signal/signal_unix.go:21 +0x1f
created by os/signal.init·1
        /Users/mitchellh/code/3rdparty/go/src/os/signal/signal_unix.go:27 +0x35

goroutine 6 [semacquire]:
sync.(*Cond).Wait(0xc2080c8030)
        /Users/mitchellh/code/3rdparty/go/src/sync/cond.go:62 +0x9e
io.(*pipe).read(0xc2080c8000, 0xc20800f000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
        /Users/mitchellh/code/3rdparty/go/src/io/pipe.go:52 +0x303
io.(*PipeReader).Read(0xc208036058, 0xc20800f000, 0x1000, 0x1000, 0xb9f630, 0x0, 0x0)
        /Users/mitchellh/code/3rdparty/go/src/io/pipe.go:134 +0x5b
bufio.(*Scanner).Scan(0xc20808e280, 0x48c17b)
        /Users/mitchellh/code/3rdparty/go/src/bufio/scan.go:180 +0x688
github.com/hashicorp/vault/command.func·010()
        /Users/mitchellh/code/go/src/github.com/hashicorp/vault/command/meta.go:176 +0x3d
created by github.com/hashicorp/vault/command.(*Meta).FlagSet
        /Users/mitchellh/code/go/src/github.com/hashicorp/vault/command/meta.go:179 +0x4c1

goroutine 15 [runnable]:
net/http.(*persistConn).readLoop(0xc2080c60b0)
        /Users/mitchellh/code/3rdparty/go/src/net/http/transport.go:928 +0x9ce
created by net/http.(*Transport).dialConn
        /Users/mitchellh/code/3rdparty/go/src/net/http/transport.go:660 +0xc9f

goroutine 16 [select]:
net/http.(*persistConn).writeLoop(0xc2080c60b0)
        /Users/mitchellh/code/3rdparty/go/src/net/http/transport.go:945 +0x41d
created by net/http.(*Transport).dialConn
        /Users/mitchellh/code/3rdparty/go/src/net/http/transport.go:661 +0xcbc

Vault vs configuration store

Hi,

I've been playing with Vault and it looks really interesting. It has features we are currently missing from our internal configuration store which we'd like to open-source. And I'm wondering what direction we should go, a short introduction about Kevlar:

Upload existing properties to a dev or test environment. This creates a keyset with values for that environment. You can change each value of a key in that keyset. All changes (CRUD) are journalled ; this can be queried. In order to have values in other environments, you clone values to a new environments. Again, you can change values per key and per environment. Depending on your deployment strategy, such value changes can be watched for in your application so that you can have live updates. When the set of key changes (add,remove) for your application, you create a new version of the keyset by cloneing. Values are automatically copied to all existing environments for that keyset. While that new version is not locked, you can add and remove keys.

We looked at using Consul as a configuration store but there are some features missing that were on our list of requirements like versioning of property keysets and encryption (which Vault can provide). I would love to hear where you think versioning of properties would fit, either in Consul, Vault or somewhere else. We can share the source of Kevlar (written in Go) privately if you want a better understanding.

Doc update: Go minimum version

During test compiles, I had to update my golang to 1.4, as make updatedeps errors with this following:

go get -u golang.org/x/tools/cmd/stringer
go list ./... \
    | xargs go list -f '{{join .Deps "\n"}}' \
    | grep -v github.com/hashicorp/vault \
    | sort -u \
    | xargs go get -f -u -v
flag provided but not defined: -f
usage: get [-d] [-fix] [-t] [-u] [build flags] [packages]

AWS S3 as backend

I'm wondering why S3 is not supported as a backend option. It would provide HA and many organizations are already using S3.
Is there something I'm missing?

OAuth2 token refreshing as a secret backend

To make an OAuth2 request we need an access token. Access token has a TTL, so once it is expired we need to get a new one using a refresh token. Instead of refreshing the access tokens directly it would be better if Vault would do it. This way the app itself does not need to know anything about the Oauth2 refresh tokens, application ids or application secrets, it could just fetch an access token from Vault and not care about the details. If the app can only access the expiring access token, then it would be also a lot securer than knowing also the non-expiring refresh token.

Implement a FUSE filesystem which presents secrets as files

Vault looks like a really great program! Thank you for releasing it.

A possible feature suggestion:

One of the nice features of keywhiz is keywhizfs, a FUSE-based filesystem that makes secrets available as ordinary files, for use with programs that expect secrets to be stored as files.

There's a go go-fuse library that might simplify the implementation here.

Starting in Docker container: Error initializing core

I'm attempting to follow the tutorial using a ubuntu:trusty Docker container and am getting the following error when I try to start vault:

root@31a7d422e87f:/# vault server -dev
Error initializing core: failed to lock memory: cannot allocate memory

I'm not sure if this is due to Docker, or if there is something special about memory allocation in general in Docker that needs to be done here so vault will work.

Here is the Dockerfile

LDAP Support as Auth Backend

Are there any plans to support LDAP as an auth backend?

This would have to be added in
https://github.com/hashicorp/vault/tree/master/builtin/credential
in a similar fashion to the existing auth backends. Right?

By the way is there a roadmap for vault?

Unattended startup mode

Edit by @mitchellh: Read comments below on why. Let's add the @filename syntax to read keys for unseal.

Creating this for tracking, would be a feature for a future version.

While the n-of-m unsealing is the best default, some cases will require a less manual process for starting/restarting the Vault server. The best way to handle this is probably to allow putting the whole master key in a file that Vault can read. This comes with no shortage of security implications and the docs will need to reflect that, but would be good to have an option for situations where the operator is willing to take on key management for that master key and knows the risks.

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.