{"id":13397552,"url":"https://github.com/hashicorp/vault","last_synced_at":"2026-01-07T20:10:48.646Z","repository":{"id":27799792,"uuid":"31288958","full_name":"hashicorp/vault","owner":"hashicorp","description":"A tool for secrets management, encryption as a service, and privileged access management","archived":false,"fork":false,"pushed_at":"2025-05-05T02:20:19.000Z","size":321240,"stargazers_count":32335,"open_issues_count":1366,"forks_count":4356,"subscribers_count":799,"default_branch":"main","last_synced_at":"2025-05-05T13:50:10.774Z","etag":null,"topics":["go","secrets","vault"],"latest_commit_sha":null,"homepage":"https://developer.hashicorp.com/vault","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hashicorp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG-pre-v1.10.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":"audit/backend.go","citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-02-25T00:15:59.000Z","updated_at":"2025-05-05T11:25:42.000Z","dependencies_parsed_at":"2023-10-16T19:39:25.253Z","dependency_job_id":"4579e15f-700a-4d95-b272-e0be9b822e79","html_url":"https://github.com/hashicorp/vault","commit_stats":{"total_commits":19351,"total_committers":1469,"mean_commits":"13.172906739278421","dds":0.815616763991525,"last_synced_commit":"0810b583c41f0f549ff7bd4d134d32af989912bc"},"previous_names":[],"tags_count":427,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fvault","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fvault/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fvault/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fvault/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hashicorp","download_url":"https://codeload.github.com/hashicorp/vault/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253757941,"owners_count":21959505,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","secrets","vault"],"created_at":"2024-07-30T18:01:30.530Z","updated_at":"2026-01-07T20:10:48.628Z","avatar_url":"https://github.com/hashicorp.png","language":"Go","readme":"# Vault [![build](https://github.com/hashicorp/vault/actions/workflows/build.yml/badge.svg)](https://github.com/hashicorp/vault/actions/workflows/build.yml) [![ci](https://github.com/hashicorp/vault/actions/workflows/ci.yml/badge.svg)](https://github.com/hashicorp/vault/actions/workflows/ci.yml)  [![vault enterprise](https://img.shields.io/badge/vault-enterprise-yellow.svg?colorB=7c8797\u0026colorA=000000)](https://www.hashicorp.com/products/vault/?utm_source=github\u0026utm_medium=banner\u0026utm_campaign=github-vault-enterprise)\n\n----\n\n**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 [security@hashicorp.com](mailto:security@hashicorp.com).\n\n----\n\n- Website: [developer.hashicorp.com/vault](https://developer.hashicorp.com/vault)\n- Announcement list: [Google Groups](https://groups.google.com/group/hashicorp-announce)\n- Discussion forum: [Discuss](https://discuss.hashicorp.com/c/vault)\n- Documentation: [https://developer.hashicorp.com/vault/docs](https://developer.hashicorp.com/vault/docs)\n- Tutorials: [https://developer.hashicorp.com/vault/tutorials](https://developer.hashicorp.com/vault/tutorials)\n- Certification exam: [https://developer.hashicorp.com/certifications/security-automation](https://developer.hashicorp.com/certifications/security-automation)\n- Documentation source: [https://github.com/hashicorp/web-unified-docs](https://github.com/hashicorp/web-unified-docs)\n\n\u003cimg width=\"300\" alt=\"Vault Logo\" src=\"https://github.com/hashicorp/vault/blob/f22d202cde2018f9455dec755118a9b84586e082/Vault_PrimaryLogo_Black.png\"\u003e\n\nVault 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.\n\nA 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.\n\nThe key features of Vault are:\n\n* **Secure Secret Storage**: Vault can store arbitrary key/value pairs. Vault encrypts data before writing it to persistent\n  storage, so gaining access to the raw storage isn't enough to access\n  your secrets. Vault can write to disk, [Consul](https://www.consul.io),\n  and more.\n\n* **Dynamic Secrets**: Vault can generate secrets on-demand for some\n  systems, such as AWS or SQL databases. For example, when an application\n  needs to access an S3 bucket, it asks Vault for credentials, and Vault\n  will generate an AWS keypair with valid permissions on demand. After\n  creating these dynamic secrets, Vault will also automatically revoke them\n  after the lease is up.\n\n* **Data Encryption**: Vault can encrypt and decrypt data without storing\n  it. This allows security teams to define encryption parameters and\n  developers to store encrypted data in a location such as a SQL database without\n  having to design their own encryption methods.\n\n* **Leasing and Renewal**: Vault associates a **lease** with each secret.\n  At the end of the lease, Vault automatically revokes the\n  secret. Clients are able to renew leases via built-in renew APIs.\n\n* **Revocation**: Vault has built-in support for secret revocation. Vault\n  can revoke not only single secrets, but a tree of secrets, for example,\n  all secrets read by a specific user, or all secrets of a particular type.\n  Revocation assists in key rolling as well as locking down systems in the\n  case of an intrusion.\n\nDocumentation, Getting Started, and Certification Exams\n-------------------------------\n\nDocumentation is available on the [Vault website](https://developer.hashicorp.com/vault/docs).\n\nIf you're new to Vault and want to get started with security automation, please\ncheck out our [Getting Started guides](https://learn.hashicorp.com/collections/vault/getting-started)\non HashiCorp's learning platform. There are also [additional guides](https://learn.hashicorp.com/vault)\nto continue your learning.\n\nFor examples of how to interact with Vault from inside your application in different programming languages, see the [vault-examples](https://github.com/hashicorp/vault-examples) repo. An out-of-the-box [sample application](https://github.com/hashicorp/hello-vault-go) is also available.\n\nShow off your Vault knowledge by passing a certification exam. Visit the\n[certification page](https://www.hashicorp.com/certification/#hashicorp-certified-vault-associate)\nfor information about exams and find [study materials](https://learn.hashicorp.com/collections/vault/certification)\non HashiCorp's learning platform.\n\nDeveloping Vault\n--------------------\n\nIf you wish to work on Vault itself or any of its built-in systems, you'll\nfirst need [Go](https://www.golang.org) installed on your machine.\n\nFor local dev first make sure Go is properly installed, including setting up a\n[GOPATH](https://golang.org/doc/code.html#GOPATH), then setting the \n[GOBIN](https://pkg.go.dev/cmd/go#hdr-Environment_variables) variable to `$GOPATH/bin`. \nEnsure that `$GOPATH/bin` is in your path as some distributions bundle the old version \nof build tools. \n\nNext, clone this repository. Vault uses [Go Modules](https://github.com/golang/go/wiki/Modules),\nso it is recommended that you clone the repository ***outside*** of the GOPATH.\nYou can then download any required build tools by bootstrapping your environment:\n\n```sh\n$ make bootstrap\n...\n```\n\nTo compile a development version of Vault, run `make` or `make dev`. This will\nput the Vault binary in the `bin` and `$GOPATH/bin` folders:\n\n```sh\n$ make dev\n...\n$ bin/vault\n...\n```\n\nTo compile a development version of Vault with the UI, run `make static-dist dev-ui`. This will\nput the Vault binary in the `bin` and `$GOPATH/bin` folders:\n\n```sh\n$ make static-dist dev-ui\n...\n$ bin/vault\n...\n```\n\nTo run tests, type `make test`. Note: this requires Docker to be installed. If\nthis exits with exit status 0, then everything is working!\n\n```sh\n$ make test\n...\n```\n\nIf you're developing a specific package, you can run tests for just that\npackage by specifying the `TEST` variable. For example below, only\n`vault` package tests will be run.\n\n```sh\n$ make test TEST=./vault\n...\n```\n\n### Troubleshooting\n\nIf you encounter an error like `could not read Username for 'https://github.com'` you may need to adjust your git config like so:\n\n```sh\n$ git config --global --add url.\"git@github.com:\".insteadOf \"https://github.com/\"\n```\n\n\n### Importing Vault\n\nThis repository publishes two libraries that may be imported by other projects:\n`github.com/hashicorp/vault/api` and `github.com/hashicorp/vault/sdk`.\n\nNote that this repository also contains Vault (the product), and as with most Go\nprojects, Vault uses Go modules to manage its dependencies. The mechanism to do\nthat is the [go.mod](./go.mod) file. As it happens, the presence of that file\nalso makes it theoretically possible to import Vault as a dependency into other\nprojects. Some other projects have made a practice of doing so in order to take\nadvantage of testing tooling that was developed for testing Vault itself. This\nis not, and has never been, a supported way to use the Vault project. We aren't \nlikely to fix bugs relating to failure to import `github.com/hashicorp/vault` \ninto your project.\n\nSee also the section \"Docker-based tests\" below.\n\n### Acceptance Tests\n\nVault has comprehensive [acceptance tests](https://en.wikipedia.org/wiki/Acceptance_testing)\ncovering most of the features of the secret and auth methods.\n\nIf you're working on a feature of a secret or auth method and want to\nverify it is functioning (and also hasn't broken anything else), we recommend\nrunning the acceptance tests.\n\n**Warning:** The acceptance tests create/destroy/modify *real resources*, which\nmay incur real costs in some cases. In the presence of a bug, it is technically\npossible that broken backends could leave dangling data behind. Therefore,\nplease run the acceptance tests at your own risk. At the very least,\nwe recommend running them in their own private account for whatever backend\nyou're testing.\n\nTo run the acceptance tests, invoke `make testacc`:\n\n```sh\n$ make testacc TEST=./builtin/logical/consul\n...\n```\n\nThe `TEST` variable is required, and you should specify the folder where the\nbackend is. The `TESTARGS` variable is recommended to filter down to a specific\nresource to test, since testing all of them at once can sometimes take a very\nlong time.\n\nAcceptance tests typically require other environment variables to be set for\nthings such as access keys. The test itself should error early and tell\nyou what to set, so it is not documented here.\n\nFor more information on Vault Enterprise features, visit the [Vault Enterprise site](https://www.hashicorp.com/products/vault/?utm_source=github\u0026utm_medium=referral\u0026utm_campaign=github-vault-enterprise).\n\n### Docker-based Tests\n\nWe have created an experimental new testing mechanism inspired by NewTestCluster.\nAn example of how to use it:\n\n```go\nimport (\n  \"testing\"\n  \"github.com/hashicorp/vault/sdk/helper/testcluster/docker\"\n)\n\nfunc Test_Something_With_Docker(t *testing.T) {\n  opts := \u0026docker.DockerClusterOptions{\n    ImageRepo: \"hashicorp/vault\", // or \"hashicorp/vault-enterprise\"\n    ImageTag:    \"latest\",\n  }\n  cluster := docker.NewTestDockerCluster(t, opts)\n  defer cluster.Cleanup()\n  \n  client := cluster.Nodes()[0].APIClient()\n  _, err := client.Logical().Read(\"sys/storage/raft/configuration\")\n  if err != nil {\n    t.Fatal(err)\n  }\n}\n```\n\nOr for Enterprise:\n\n```go\nimport (\n  \"testing\"\n  \"github.com/hashicorp/vault/sdk/helper/testcluster/docker\"\n)\n\nfunc Test_Something_With_Docker(t *testing.T) {\n  opts := \u0026docker.DockerClusterOptions{\n    ImageRepo: \"hashicorp/vault-enterprise\",\n    ImageTag:  \"latest\",\n\tVaultLicense: licenseString, // not a path, the actual license bytes\n  }\n  cluster := docker.NewTestDockerCluster(t, opts)\n  defer cluster.Cleanup()\n}\n```\n\nHere is a more realistic example of how we use it in practice.  DefaultOptions uses \n`hashicorp/vault`:`latest` as the repo and tag, but it also looks at the environment\nvariable VAULT_BINARY. If populated, it will copy the local file referenced by\nVAULT_BINARY into the container. This is useful when testing local changes.\n\nInstead of setting the VaultLicense option, you can set the VAULT_LICENSE_CI environment\nvariable, which is better than committing a license to version control.\n\nOptionally you can set COMMIT_SHA, which will be appended to the image name we\nbuild as a debugging convenience.\n\n```go\nfunc Test_Custom_Build_With_Docker(t *testing.T) {\n  opts := docker.DefaultOptions(t)\n  cluster := docker.NewTestDockerCluster(t, opts)\n  defer cluster.Cleanup()\n}\n```\n\nThere are a variety of helpers in the `github.com/hashicorp/vault/sdk/helper/testcluster`\npackage, e.g. these tests below will create a pair of 3-node clusters and link them using\nPR or DR replication respectively, and fail if the replication state doesn't become healthy\nbefore the passed context expires.\n\nAgain, as written, these depend on having a Vault Enterprise binary locally and the env\nvar VAULT_BINARY set to point to it, as well as having VAULT_LICENSE_CI set.\n\n```go\nfunc TestStandardPerfReplication_Docker(t *testing.T) {\n  opts := docker.DefaultOptions(t)\n  r, err := docker.NewReplicationSetDocker(t, opts)\n  if err != nil {\n      t.Fatal(err)\n  }\n  defer r.Cleanup()\n\n  ctx, cancel := context.WithTimeout(context.Background(), time.Minute)\n  defer cancel()\n  err = r.StandardPerfReplication(ctx)\n  if err != nil {\n    t.Fatal(err)\n  }\n}\n\nfunc TestStandardDRReplication_Docker(t *testing.T) {\n  opts := docker.DefaultOptions(t)\n  r, err := docker.NewReplicationSetDocker(t, opts)\n  if err != nil {\n    t.Fatal(err)\n  }\n  defer r.Cleanup()\n\n  ctx, cancel := context.WithTimeout(context.Background(), time.Minute)\n  defer cancel()\n  err = r.StandardDRReplication(ctx)\n  if err != nil {\n    t.Fatal(err)\n  }\n}\n```\n\nFinally, here's an example of running an existing OSS docker test with a custom binary:\n\n```bash\n$ GOOS=linux make dev\n$ VAULT_BINARY=$(pwd)/bin/vault go test -run 'TestRaft_Configuration_Docker' ./vault/external_tests/raft/raft_binary\nok      github.com/hashicorp/vault/vault/external_tests/raft/raft_binary        20.960s\n```\n","funding_links":[],"categories":["Go","Secrets management","DevSecOps","Security","Secret Management","Go (134)","Networking, Distributed, Microservices \u0026 Cloud - Tools \u0026 Services","go","Security Enabling Tools","Security \u0026 Compliance","微服务生态","Systems","Back-End Development","Recently Updated","Secret","Repos","Map of the content","Tools","Repositories","Developer Tools"],"sub_categories":["Sensor and Acuator Interfaces","Other tools","[Jul 26, 2025](/content/2025/07/26/README.md)","Password Managers","Satellite","Runtime Security"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashicorp%2Fvault","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhashicorp%2Fvault","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashicorp%2Fvault/lists"}