- Go 96.7%
- HCL 2.1%
- Shell 0.5%
- Makefile 0.4%
- Dockerfile 0.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
* Consolidate identity benchmarks into one target Replaces `identity_population` and `identity_group_read` with a unified `identity` target that supports `none`, `login`, and `group_read` workloads via config. The new target centralizes setup, validation, attack configuration, and cleanup behavior, including run-scoped userpass mount cleanup. Also moves shared identity ID parsing into the auth link helper, updates benchmark docs and index references, and migrates fixture/test configs to the new `identity` + workload-based format (`identity_login.hcl`, updated group-read fixture, and renamed Docker test coverage). * Consolidate identity targets into identity_group_read Merges the former `identity` (target_identity.go) target into the existing `identity_group_read` target. The deleted file's login/population workload is absorbed into target_identity_group_read.go, which now supports all three workload modes: `none`, `login`, and `group_read`. Updates docs, test fixtures, and HCL configs to use the `identity_group_read` test type throughout. * Refine identity target cleanup and naming This updates the consolidated identity benchmark target with cleaner structure and naming. Cleanup logic is now an `IdentityGroupRead` method (`cleanupCreatedIdentityResources`) and all setup/teardown error paths use it consistently. It also simplifies string construction for entity/group names, tightens some error handling style, and trims/updates comments and TODOs to better reflect the merged group-read and login/population workload behavior. * Refactor identity group read setup and cleanup - Move entityName/selectGroupMembers helpers to identity_auth_link_helper.go - Convert createEntities/createGroups to return IDs instead of mutating struct fields - Use a deferred cleanup guard in Setup instead of repeated manual rollback calls - Add progress logging and elapsed timing to group creation and validation - Remove name_prefix config field (names are derived from mountName+runID+idx) - Simplify Target() by building a base vegeta.Target and mutating only what differs - Reorder docs fields by workload-first importance; update example HCL to match * Preserve identity populate workload data Rename the seed-only identity workload from `none` to `populate` and make it skip cleanup so seeded entities can be reused as a persistent bloat dataset. The attack-path fallback comments and docs were updated to reflect the new workload name and its cleanup behavior. * Clarify identity refactor TODO checklist Reworked the refactor TODO comments to centralize planning in `target_identity_group_read.go` with a phased, explicit checklist (renames, structural cleanup, config reframe, behavior, and feature-tier work). Updated `identity_auth_link_helper.go` to reference that master checklist and scope its own TODOs to phase 1/2 items, reducing duplicated guidance. |
||
| .github | ||
| .release | ||
| benchmarktests | ||
| command | ||
| config | ||
| docs | ||
| helper/dockertest | ||
| k8s | ||
| scripts | ||
| test-fixtures | ||
| version | ||
| .gitignore | ||
| .go-version | ||
| CHANGELOG.md | ||
| CODEOWNERS | ||
| CONTRIBUTING.md | ||
| docker-compose.yml | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| main.go | ||
| Makefile | ||
| README.md | ||
Vault Benchmark
vault-benchmark is a tool designed to test the performance of Vault auth methods and secret engines. Running the binary with a benchmark configuration file, will configure any necessary resources on the Vault instance itself required to perform the tests defined. Any auth methods or secrets engine tests defined that require an external dependency such as a database will require that infrastructure be set up correctly prior to benchmarking. vault-benchmark makes use of the Vegeta HTTP load testing utility.
Warning
vault-benchmark will put a great amount of stress against the cluster itself and the infrastructure that the cluster is running on during testing, and as such is intended to only be run against a test Vault cluster that is isolated from any production systems or any other systems that can cause any negative impact.
Installation
Official Release Binaries
You can download a release binary from our release page
Compiling From Source
You can compile the latest version including any fixes or features from source by running make bin. This will put the vault-benchmark binary in the dist folder in directories that map to your GOOS and GOARCH:
$ make bin
GOARCH=arm64 GOOS=darwin go build -o dist/darwin/arm64/vault-benchmark
Usage
vault-benchmark can be run directly as a binary, docker container or kubernetes job. Below is an example of running the binary.
First a configuration file needs to be created defining the basic vault-benchmark settings as well as defining which benchmark tests to be run. For Example:
# Basic Benchmark config options
vault_addr = "http://127.0.0.1:8200"
vault_token = "root"
vault_namespace="root"
duration = "30s"
cleanup = true
test "approle_auth" "approle_logins" {
weight = 50
config {
role {
role_name = "benchmark-role"
token_ttl="2m"
}
}
}
test "kvv2_write" "static_secret_writes" {
weight = 50
config {
numkvs = 100
kvsize = 100
}
}
This test configuration will run two different benchmark tests, an approle_auth test, and a kvv2_write test, with the percentage of requests being split evenly between the two.
Then we run the binary and provide the configuration file path:
$ vault-benchmark run -config=config.hcl
2023-05-06T11:11:44.926-0400 [INFO] vault-benchmark: setting up targets
2023-05-06T11:11:46.991-0400 [INFO] vault-benchmark: starting benchmarks: duration=30s
2023-05-06T11:12:16.994-0400 [INFO] vault-benchmark: cleaning up targets
2023-05-06T11:13:03.629-0400 [INFO] vault-benchmark: benchmark complete
Target: http://127.0.0.1:8200
op count rate throughput mean 95th% 99th% successRatio
approle_logins 155349 5178.303523 5177.967129 1.27286ms 2.142861ms 2.894675ms 100.00%
static_secret_writes 155334 5177.819051 5177.626953 640.232µs 1.055702ms 1.554777ms 100.00%
Docker
Tip: Create a Vault Benchmark image with the make image command.
First, create a network that Vault and Vault Benchmark will share:
docker network create vault
Next, deploy Vault to Docker and ensure it's running:
docker run \
--name=vault \
--hostname=vault \
--network=vault \
-p 8200:8200 \
-e VAULT_DEV_ROOT_TOKEN_ID="root" \
-e VAULT_ADDR="http://localhost:8200" \
-e VAULT_DEV_LISTEN_ADDRESS="0.0.0.0:8200" \
--privileged \
--detach hashicorp/vault:latest
docker logs -f vault
Once Vault is running, create a Vault Benchmark container and watch the logs for the results:
docker run \
--name=vault-benchmark \
--hostname=vault-benchmark \
--network=vault \
-v ./vault-benchmark/configs/:/opt/vault-benchmark/configs \
--detach hashicorp/vault-benchmark:latest \
vault-benchmark run -config=/opt/vault-benchmark/configs/config.hcl
docker logs -f vault-benchmark
Documentation
Documentation for vault-benchmark including usage and test configuration can be found in our docs
Community Project Disclaimer
No Official Support
Please note this is a community project, with best effort support. Hashicorp and Hashicorp Support do not offer any official support for the Vault-Benchmark project. If you encounter issues or have questions, we recommend reaching out to the community through the GitHub issues page. Community members are often helpful and responsive.
Contributions Welcome!
We welcome contributions, improvements, and suggestions from the community. If you have ideas for enhancements, bug fixes, or new features, please consider contributing. You can submit your contributions through GitHub issues.
How to Contribute
- Check the existing GitHub issues to see if your suggestion or issue has already been discussed.
- If not, open a new issue to report a bug, propose a new feature, or suggest an improvement.
- If you are interested in contributing code, feel free to submit a pull request. Please follow the project's contribution guidelines.
By contributing to this project, you are helping to make it better for everyone in the community. Thank you for your support and collaboration!