Commit graph

872 commits

Author SHA1 Message Date
Vault Automation
caf642b7d2
Backport Vault 42177 Add Backend Field into ce/main (#12152)
* Vault 42177 Add Backend Field (#12092)

* add a new struct for the total number of successful requests for transit and transform

* implement tracking for encrypt path

* implement tracking in encrypt path

* add tracking in rewrap

* add tracking to datakey path

* add tracking to  hmac path

* add tracking to sign  path

* add tracking to verify path

* unit tests for verify path

* add tracking to cmac path

* reset the global counter in each unit test

* add tracking to hmac verify

* add methods to retrieve and flush transit count

* modify the methods that store and update data protection call counts

* update the methods

* add a helper method to combine replicated and local data call counts

* add tracking to the endpoint

* fix some formatting errors

* add unit tests to path encrypt for tracking

* add unit tests to decrypt path

* fix linter error

* add unit tests to test update and store methods for data protection calls

* stub fix: do not create separate files

* fix the tracking by coordinating replicated and local data, add unit tests

* update all reference to the new data struct

* revert to previous design with just one global counter for all calls for each cluster

* complete external test

* no need to check if current count is greater than 0, remove it

* feedback: remove unnacassary comments about atomic addition, standardize comments

* leave jira id on todo comment, remove unused method

* rename mathods by removing HWM and max in names, update jira id in todo comment, update response field key name

* feedback: remove explicit counter in cmac tests, instead put in the expected number

* feedback: remove explicit tracking in the rest of the tests

* feedback: separate transit testing into its own external test

* Update vault/consumption_billing_util_test.go

Co-authored-by: divyaac <divya.chandrasekaran@hashicorp.com>

* update comment after test name change

* fix comments

* fix comments in test

* another comment fix

* feedback: remove incorrect comment

* fix a CE test

* fix the update method: instead of storing max, increment by the current count value

* update the unit test, remove local prefix as argument to the methods since we store only to non-replicated paths

* update the external test

* Adds a field to backend to track billing data

removed file

* Changed implementation to use a map instead

* Some more comments

* Add more implementation

* Edited grpc server backend

* Refactored a bit

* Fix one more test

* Modified map:

* Revert "Modified map:"

This reverts commit 1730fe1f358b210e6abae43fbdca09e585aaaaa8.

* Removed some other things

* Edited consumption billing files a bit

* Testing function

* Fix transit stuff and make sure tests pass

* Changes

* More changes

* More changes

* Edited external test

* Edited some more tests

* Edited and fixed tests

* One more fix

* Fix some more tests

* Moved some testing structures around and added error checking

* Fixed some nits

* Update builtin/logical/transit/path_sign_verify.go

Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>

* Edited some errors

* Fixed error logs

* Edited one more thing

* Decorate the error

* Update vault/consumption_billing.go

Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>

---------

Co-authored-by: Amir Aslamov <amir.aslamov@hashicorp.com>
Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>

* Edited stub function

---------

Co-authored-by: divyaac <divya.chandrasekaran@hashicorp.com>
Co-authored-by: Amir Aslamov <amir.aslamov@hashicorp.com>
Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
Co-authored-by: divyaac <divyaac@berkeley.edu>
2026-02-03 22:48:12 +00:00
Vault Automation
375a59c4cd
Fix client-controlled-consistency for external plugins (#12117) (#12134)
* Allow requests to external plugins that modify storage to populate the X-Vault-Index response header.
2026-02-03 18:01:09 +00:00
Vault Automation
38bb6eae78
Add PasswordModify to new LDAP Connection interface wrapper (#12094) (#12113)
* Add method to ldap connection interface

* Move to interface wrapper

Co-authored-by: Robert <17119716+robmonte@users.noreply.github.com>
2026-01-30 23:45:35 +00:00
Vault Automation
d7d140a3a3
Backport Add kmip cluster tests. Also fix a bug in EnableDRSecondaryNoWait. into ce/main (#12059)
* no-op commit

* Apply CE changes from #12052

---------

Co-authored-by: ncabatoff <ncabatoff@hashicorp.com>
2026-01-29 10:38:19 -05:00
Vault Automation
744024c83e
VAULT-41729 Refactor PKI Cert Counting Code (#11657) (#11881)
* Basic refactoring to reuse PKI certs for SSH

* Refactored so that files are moved to CE

* Modified comment

* Renamed CertCountSystemView

* Moved forwarding function and redefined consume function

* Renamed cert view file

* Moved forwarding function and redefined consume function

Small edit

Renamed cert view file

* Fix issues with commit

* Fix consume job

* Removed error

* Update vault/logical_system_helpers.go



---------

Co-authored-by: divyaac <divya.chandrasekaran@hashicorp.com>
Co-authored-by: Victor Rodriguez <vrizo@hashicorp.com>
2026-01-26 08:28:41 -05:00
Vault Automation
cab60d761b
Backport rotationManager: add configurable limit to rotation retries with orphaning into ce/main (#11782)
Co-authored-by: vinay-gopalan <86625824+vinay-gopalan@users.noreply.github.com>
2026-01-15 09:31:40 -06:00
Vault Automation
d978f9720c
VAULT-41600: SSH OTP observations (#11704) (#11783)
* ssh observations and tests

* remove unnecessary comments

* add metadata in comments

* limit to only otp paths

* remove unnecessary change

Co-authored-by: miagilepner <mia.epner@hashicorp.com>
2026-01-15 15:22:11 +00:00
Vault Automation
3fde566dd2
Put alias_metadata tokenutil field into public SDK (#11468) (#11717) 2026-01-13 09:43:33 -06:00
Vault Automation
c98c3d6d35
Allow setting extrahosts (#11679) (#11703)
Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
2026-01-12 14:38:05 +00:00
Vault Automation
62be8c0fe6
Put fairshare and dnstest helper in sdk (#11583) (#11663) 2026-01-09 10:32:31 -05:00
Vault Automation
e7965c8bdf
[VAULT-41294] docker: build OCI container images (#11545) (#11549)
This change does a few things that might not be obvious:

- We stop requesting the previous runner image. This will result in us
  using Docker 29 instead of 28. With this comes changes in our
  container build system, most notably that container images are now
  exported as OCI images. Every container runtime that we support also
  supports OCI images so this ought to have no meaningful impact to
  downstream users. One noticeable change is that the image layers are
  now compressed so the final image size on disk will be considerably
  smaller than before.

- Upgrade `hashicorp/action-setup-enos` to the latest version. This is not
  strictly required for this change but as we just released a new version of
  the CLI it makes sense to update it here. We should also note that recently
  we released a new version of `terraform-provider-enos` which contains
  necessary for this change as our docker and kind resources needed to be
  updated handle OCI and Docker exported images. Previously they relied on
  files that existed only in Docker images.

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-12-29 10:58:02 -08:00
Vault Automation
ce23f4f2de
VAULT-41425: AWS secrets engine observations (#11395) (#11514)
* add observations for the aws secrets engine

* add mock recorder

* add tests to verify observations are created

* fix comment

* update godoc and switch to require

* fix type assertion, add test

Co-authored-by: miagilepner <mia.epner@hashicorp.com>
2025-12-19 10:57:08 -08:00
Vault Automation
6c52175b8d
events: send events from primary to secondary clusters (#8214) (#11451)
Collect event subscriber filters on the active node of a cluster as
"cluster wide" filters, and send them from the secondary active to the
primary active node (`SendSecondaryFilters rpc`). The primary active
node forwards events downstream to the secondary active node if the
events match the secondary cluster's subscriber filters
(`RecvPrimaryEvents rpc`). Then the events are further distributed
around the secondary cluster via the existing `RecvActiveNodeEvents`
and `SendStandbyFilters` rpc's.

Events are forwarded downstream to the secondary cluster if the mount
exists on the secondary cluster, i.e. events from mounts with
`local=true` aren't forwarded, and events from mounts that are not
replicated via paths-filter aren't forwarded.

(This is the CE portion of the above^^)

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
2025-12-18 10:56:55 -08:00
Vault Automation
f9bb8aa7d4
Enforce Checks on Chain in Common Criteria Mode (#10915) (#11251)
* Add Disable-Time-Check flag, and also respect common criteria when doing so.

* Switch to EnableTimeChecks to not change default behavior.

* Check Common Criteria Flag Before Disabling Verification.

* Add Changelog.

* Update builtin/logical/pki/issuing/cert_verify_ent.go



* Update changelog/_10915.txt



* PR feedback.

* Merge-fix

* Test case requested by PR review.

---------

Co-authored-by: Kit Haines <khaines@mit.edu>
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2025-12-15 14:08:43 -05:00
Vault Automation
e78aea2ec1
Correctly set signature bits. (#10700) (#10977)
* Correctly set signature bits.

* All the other places that accidentally conflate issuer and issued key.

* Update builtin/logical/pki/path_roles.go



* PR Feedback.

* Add changelog.

* Test and validate keybits in a single call

* License header.

* Add/combine validate and get default hashbits calls.

* Actually set keyBits on the role.

* Fix storage test, switch to defaultOrValue.

* fix storage test.

* Update error return for linter.

* Look at underlaying key type not type which might include "managedKeyType" for ca-issuer.

* Update expected role values, and convert between PublicAlgorithm and KeyType internally.

* Move the ec to ecdsa transformation to helper functions.  More consistant usage.

* Speed improvement to testing - pregenerate CA bundles and CSR.

* Add go test doc.

* Fix issue with web-merge.

* Error wrapping error now warnings aren't errors.

* PR feedback - move ecdsa support to subfunctions.

---------

Co-authored-by: Kit Haines <khaines@mit.edu>
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2025-12-15 14:08:17 -05:00
Vault Automation
41bc535dc9
sdk/rotation: Prevent rotation attempts on read-only storage (#10762) (#11156)
* sdk/rotation: Prevent rotation attempts on read-only storage

Rotation is a write operation that mutates both Vault's storage
and an external resource. Attempting this on a read-only node
(like in a performance secondary cluster) will fail.

This check preempts the rotation to prevent a split-brain scenario
where the external credential is changed but Vault's storage
cannot be updated.

* changelog

* fix failing test

Co-authored-by: John-Michael Faircloth <fairclothjm@users.noreply.github.com>
2025-12-15 10:47:28 -06:00
Vault Automation
6c2f2a84ee
VAULT-40506: Disable custom JSON limit parsing on ClusterListener (#10848) (#11075)
* add test for issue

* add bool to disable json limit parsing

* clean up tests

* fix godoc

* restore previous clustering setup

* add nil check for VaultNodeConfig

* add changelog

* move docker test to appropriate directory to allow testing in CI

---------

Co-authored-by: davidadeleon <56207066+davidadeleon@users.noreply.github.com>
Co-authored-by: davidadeleon <ddeleon@hashicorp.com>
2025-12-12 17:23:36 -05:00
Vault Automation
0a52566ccc
Correct misleading godoc re DisplayAttrs.Value. (#11189) (#11227) 2025-12-12 21:00:07 +00:00
Vault Automation
be2cb06f8c
Backport refactor dependencies and removes disallowed vault imports from builtin Okta auth into ce/main (#11295)
* refactor dependencies and removes disallowed vault imports from builtin Okta auth (#10965)

* move SkipUnlessEnvVarsSet from vault/helper/testhelpers/ to vault/sdk/helper/testhelpers

* use unittest framework from vault-testing-stepwise module in place of sdk/logical

* refactor SkipUnlessEnvVarsSet() and NewAssertAuthPoliciesFunc() to sdk

* bump docker API version to 1.44 matching 2f33549

---------

Co-authored-by: Thy Ton <maithytonn@gmail.com>
2025-12-12 13:20:57 -06:00
Vault Automation
50c9fd55e5
Workaround backport for docker 29 ce main (#11177)
Co-authored-by: LT Carbonell <lt.carbonell@hashicorp.com>
2025-12-12 19:13:57 +00:00
Vault Automation
8cce47281e
[VAULT-41179] go: bump golang.org/x/crypto to v0.45.0 (#11056) (#11065)
* [VAULT-41179] go: bump golang.org/x/crypto to v0.45.0

Bump the golang.org/x/crypto module to v0.45.0 to resolve several CVE's
with the prior version:
  - https://github.com/advisories/GHSA-f6x5-jh6r-wrfv
  - https://github.com/advisories/GHSA-j5w8-q4qc-rx2x
  - https://pkg.go.dev/vuln/GO-2025-4134
  - https://pkg.go.dev/vuln/GO-2025-4135

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-12-02 21:00:06 +00:00
Vault Automation
4e2f3ba489
Support external plugins in NewTestDockerCluster (#11023) (#11035) 2025-11-28 21:37:26 +00:00
Vault Automation
b612e02fe9
Backport Enforce the minimum set of key usages for each ExtKeyUsage set in a PKI role (#10900)
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2025-11-20 20:37:22 +00:00
Vault Automation
399a10f22d
Force NotBefore=now when common_criteria_mode feature flag is enabled (#10739) (#10849) 2025-11-20 19:38:39 +00:00
Vault Automation
21935979ec
Backport Define common criteria flag which forbids certain TLS cipher suite options into ce/main (#10806) 2025-11-19 19:07:18 +00:00
Vault Automation
77f1980d29
go: bump golang.org/x/crypto => v0.44.0 to resolve GO-2025-4116 (#10871) (#10891)
* go: bump golang.org/x/crypto => v0.44.0 to resolve GO-2025-4116

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-11-18 17:57:11 +00:00
Vault Automation
0699b2150e
Disallow logins with empty passwords in LDAP Auth (#10752) (#10777)
Co-authored-by: vinay-gopalan <86625824+vinay-gopalan@users.noreply.github.com>
2025-11-13 18:43:28 +00:00
Vault Automation
ab7d41d465
Use RotationSchedule string instead of cron.SpecSchedule (#10376) (#10773)
Co-authored-by: kpcraig <3031348+kpcraig@users.noreply.github.com>
2025-11-13 12:31:08 -05:00
Vault Automation
e67da36b58
Allow sign-verbatim to handle CSRs with basic constraints extension where isCA=false (#10466) (#10474) 2025-10-29 15:09:28 +00:00
Vault Automation
d8f870d125
Refactor Identity.ActivationFunc to make room for SCIM activation (#10317) (#10349)
Co-authored-by: Bianca <48203644+biazmoreira@users.noreply.github.com>
2025-10-23 15:41:36 +00:00
Vault Automation
0c6c13dd38
license: update headers to IBM Corp. (#10229) (#10233)
* license: update headers to IBM Corp.
* `make proto`
* update offset because source file changed

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-10-21 15:20:20 -06:00
Vault Automation
68d559dd6e
SDK rotation changes (#9942) (#10025)
Co-authored-by: kpcraig <3031348+kpcraig@users.noreply.github.com>
2025-10-10 12:23:51 -04:00
Vault Automation
7efe8aa99b
Fix seal rewrap running unnecessarily (#9466) (#9895)
Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
2025-10-07 07:24:17 -04:00
Vault Automation
732c1e590d
Backport secrets/database: escape usernames/passwords in self-managed static roles, unless disable_escaping is set into ce/main (#9732)
Co-authored-by: kpcraig <3031348+kpcraig@users.noreply.github.com>
Co-authored-by: Kay Craig <kay.craig@hashicorp.com>
2025-10-02 12:52:49 -04:00
Vault Automation
eadd2bde15
bump cap/ldap dependency to fix data race (#9760) (#9783)
Co-authored-by: John-Michael Faircloth <fairclothjm@users.noreply.github.com>
2025-10-02 11:35:43 -05:00
Vault Automation
0adb749a82
Check rate limits before doing json limits checking (#9688) (#9775)
* update the order of the requests handlers

* switch back to maxrequestsize, prevent the error by restricting the buffer size

* add test

Co-authored-by: miagilepner <mia.epner@hashicorp.com>
2025-10-02 09:30:31 +00:00
Vault Automation
a24046a0b4
Increment certificate counts in all PKI backends (#9693) (#9721)
Increment certificate counts in all PKI backends.

Ensure that the PkiCertificateCounter is invoked every time we store and
issue a certificate by any of the PKI backends.

Co-authored-by: Victor Rodriguez <vrizo@hashicorp.com>
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2025-09-29 15:33:00 -04:00
Vault Automation
a48469ef13
Fix flaky test TestSpiffeWebPemWithStandbys, do not send seal commands to standby nodes (#9615) (#9716)
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2025-09-29 14:02:34 +00:00
Vault Automation
44ced707f9
Add PkiCertificateCountSystemView to the PKI backend's SystemView (#9573) (#9617)
Add PkiCertificateCountSystemView to the PKI backend's SystemView.

Co-authored-by: Victor Rodriguez <vrizo@hashicorp.com>
2025-09-24 18:23:22 +00:00
Vault Automation
b19e74c29a
JSON limits covering new use cases and MaxTokens (#9406) (#9596)
Co-authored-by: Bianca <48203644+biazmoreira@users.noreply.github.com>
2025-09-24 07:13:21 +00:00
Vault Automation
64fd8225bc
Move PluginLicenseUtil to CE so it can be used via vault/sdk module (#9371) (#9381) 2025-09-16 20:22:17 +00:00
Vault Automation
3ce68d9623
[VAULT-38602] Remove the redundant PeekByKey method from the priority queue and login MFA priority queue (#9362) (#9373) 2025-09-16 17:19:39 +00:00
Vault Automation
ba4b639445
CE backport: Rename token_auth_metadata to alias_metadata (#9237)
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2025-09-10 08:57:18 -04:00
Vault Automation
c19829ccd7
Fix KDF for key import with derivation enabled (#9106) (#9218)
* add fix and tests for importing keys with derivation enabled

* add changelog

* add check to fix kdf for existing imported keys

* only set kdf on derived keys

Co-authored-by: Rachel Culpepper <84159930+rculpepper@users.noreply.github.com>
2025-09-09 19:28:12 +00:00
Vault Automation
10855a6bcd
Update to Go 1.25.1 (#8284) (#9191)
* Update github.com/petermattis/goid to support Go 1.25
* Update to Go 1.25.1

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2025-09-09 13:21:57 +00:00
Vault Automation
02a0e63d8b
Copy Auth Config Display Attr Updates into main (#8995) (#8997)
* updates display attrs for auth method configs

* fixes plugin identity util fields tests

* adds comments explaining variadic operator choice

* stubs original automatedrotation and pluginidentity util functions

* updates group name in TestAddPluginIdentityTokenFieldsWithGroup

---------

Co-authored-by: Jordan Reimer <jordan.reimer@hashicorp.com>
2025-09-03 09:37:28 -06:00
Vault Automation
e40eca1286
VAULT-39294: Deprecate recover_snapshot_id query param and use a header instead (#8834) (#9042)
* deprecate snapshot query params, use a header instead

* keep read query param, but deprecate recover one

* fix test

* remove list change

* add changelog

* rename header, allow request method

* update changelog

Co-authored-by: miagilepner <mia.epner@hashicorp.com>
2025-09-01 15:28:10 +00:00
Vault Automation
5d632efcf3
[VAULT-38600] Create TOTP Login MFA credential self-enrollment API endpoint (#8970) (#8999)
Co-authored-by: Kuba Wieczorek <kuba.wieczorek@hashicorp.com>
2025-08-29 17:46:27 +01:00
Vault Automation
eaf949cb1f
VAULT-37633: Database static role recover operations (#8922) (#8982)
* initial implementation

* fix

* tests

* changelog

* fix vet errors

* pr comments

Co-authored-by: miagilepner <mia.epner@hashicorp.com>
2025-08-29 09:48:18 -05:00
Vault Automation
3e4627137e
Backport [VAULT-38910]: upgrade docker package to resolve GO-2025-3829 into ce/main (#8875)
* [VAULT-38910]upgrade docker package to resolve GO-2025-3829 (#8642)

* bump github.com/hashicorp/go-secure-stdlib/plugincontainer to v0.4.2
* bump github.com/docker/docker to v28.3.3+incompatible

Signed-off-by: Ryan Cragun <me@ryan.ec>

* go mod tidy

Signed-off-by: Ryan Cragun <me@ryan.ec>

---------

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-08-26 16:16:55 -06:00