933 Commits

Author SHA1 Message Date
Vault Automation
f48f3f2436
PKI: Allow SCEP to leverage PKCS#11 managed keys (#14247) (#14449)
* Initial implementation of PKCS11 managed key support for SCEP

* Add test using managed keys for SCEP

* Tweak docs and make pkcs7 decrypter tests after initial direct key tests

* Add cl

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2026-05-04 16:29:21 +00:00
Vault Automation
a3adda9940
Backport Fix a test sdk bug relating to joining nodes when using autoseal into ce/main (#14427)
Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
2026-04-29 20:40:42 +00:00
Vault Automation
8b448ab7af
Backport Delete cluster.Start for NewTestCluster clusters, and deprecate and clean up cluster.Cleanup for NewTestCluster clusters into ce/main (#14105)
* Delete cluster.Start for NewTestCluster clusters, and deprecate and clean up cluster.Cleanup for NewTestCluster clusters (#14014)

* progress

* more progress

* missed cleanup

* fix mistakes

* cleanup

* fix docker cleanup

* various fixes

* further fixes

* further cleanup

* the cleanup will continue until morale improves

* two morE

* more fixes

* how did I miss that

* new test cleanup

* update

* cleanup, attempt small de-flake

* fix and extra cleanup

* some docker cleanup

* newlines

* some testwaitactives

* CE changes

---------

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2026-04-21 09:33:14 -04:00
Vault Automation
448d859482
VAULT-43029: SCIM guardrail fixes (#12886) (#13026)
* unit tests passing, implementation

* other tests pass

* fix test godocs

* remove skip from tests

* add comments

Co-authored-by: miagilepner <mia.epner@hashicorp.com>
2026-03-16 11:23:04 +00:00
Vault Automation
5319eb2384
VAULT-42996 remove SCIM clien_role (IGAvsIdP) concept (#12889) (#12977)
* add resource orphaning to SCIM client delete

* add background orphaning handling

* delete instead of orphan, add retry and startup tests

* revert: undo accidental changes to Makefile and golang instructions

* fix tests

* stop log flood (try again)

* fix linter findings

* try to silence spam again

* try to silence spam once more

* dont allow running outside of active primary

* go docs

* fix active check and pass client id via context

* remove unnecessary change

* remove client_role concept

* add more tests

* remove reserved field from pb

* address review

* fix merge

* fix tests

* re-add duplicate canonical id metadata handling

* linter

* address test copilot feedback

Co-authored-by: Bruno Oliveira de Souza <bruno.souza@hashicorp.com>
2026-03-13 15:33:50 -03:00
Vault Automation
9b35f7dae7
VAULT-42598 add resource cleanup to SCIM client delete (#12489) (#12826)
* add resource orphaning to SCIM client delete

* add background orphaning handling

* delete instead of orphan, add retry and startup tests

* revert: undo accidental changes to Makefile and golang instructions

* fix tests

* stop log flood (try again)

* fix linter findings

* try to silence spam again

* try to silence spam once more

* dont allow running outside of active primary

* go docs

* fix active check and pass client id via context

* remove unnecessary change

* Remove Test_SCIM_ClientDeletion_Cascading

this test was added in another PR but mine already has a bunch of deleting test that work with the new behavior

Co-authored-by: Bruno Oliveira de Souza <bruno.souza@hashicorp.com>
2026-03-10 11:52:50 -03:00
Vault Automation
ef97ba7518
Backport Eliminate need for defer cluster.Cleanup into ce/main (#12770) 2026-03-09 14:44:43 +00:00
Vault Automation
f43fdf54ab
Vault 42257 root rotation in LDAP auth method for AD schema (#12223) (#12595)
* adding root rotation for ldap auth method for schema AD
* adding test cases for root rotation
* code fix and adding TestRotateRoot_EncodeUTF16LEBytes
* adding constants
* schema validation + unit test
* updated unit test
* removed duplicate enum
* adding acceptance test, unit test, changelog and updating schemaType to schema
* adding logs and comments for debugging
* added validation for config params
* adding validation and test cases to enforce encrypted connection requirements for AD password rotation
* adding fix to data race error in CI pipeline
* addressing PR comments
* fix for backward compatibility for schema and test
* adding validation and tests for multiple URLs for AD root rotation
---------

Co-authored-by: Stuti Srivastava <stuti.srivastava@hashicorp.com>
Co-authored-by: Prajna Nayak <prajna.nayak@hashicorp.com>
2026-03-09 10:21:29 +05:30
Vault Automation
b25410c747
VAULT-42603: SCIM guardrails for identity resources (#12626) (#12748)
* base

* unit tests

* group tests

* groups test

* entity test

* alias test and fix error code

* fix error message

* lint

---------

Co-authored-by: miagilepner <mia.epner@hashicorp.com>
Co-authored-by: Kuba Wieczorek <kuba.wieczorek@hashicorp.com>
2026-03-05 10:02:20 +00:00
Vault Automation
9f986e80de
Backport Import PKI External CA plugin into vault-enterprise into ce/main (#12671)
* no-op commit

* Backport ce: Import PKI External CA plugin

* Rename from pki_external_ca to pki-external-ca

---------

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2026-03-03 16:28:04 -05:00
Vault Automation
82072019a3
add additional fields to alias proto (#12533) (#12561)
Co-authored-by: davidadeleon <56207066+davidadeleon@users.noreply.github.com>
Co-authored-by: davidadeleon <ddeleon@hashicorp.com>
2026-02-26 15:36:50 -05:00
Vault Automation
91aa12ac19
VAULT-42658 Move Agent Registry to main (#12443) (#12455)
* wip

* wip

* wip

* wip

* add lookup by entity-id

* VAULT-42642 Fix feature branch tests, some CE -> Ent moving (#12417)

* VAULT-42642 Fix feathre branch tests, some CE -> Ent moving

* VAULT-42642 fix last test?

* skip test

* proto

* more test fixes

* buf format

* VAULT-42533 Agent Registry: enforce entity invariants, miscellaneous improvements (#12399)

* VAULT-42533 enforce entity invariants, miscellaneous improvements

* typos

* Moving stuff around for CE

* fmt

* backend

* more CE changes

* more fixes

* further fixes

* rework clone

---------

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
Co-authored-by: davidadeleon <ddeleon@hashicorp.com>
2026-02-20 14:41:29 -05:00
Bruno Oliveira de Souza
4f08068c5d
Backport #11933 VAULT-41176 CRUD API for SCIM clients (#12341)
* backport #11933

* add missing backport file

* move SCIM storage prefix to common CE/ent file
2026-02-13 17:35:14 -03:00
Vault Automation
b60d15a07c
Add experiment to enable the KMIP client API (#11981) (#12017)
* Make VAULT_EXPERIMENTS work as feature flags.

Make method IsFlagEnabled treat experiments as feature flags so that they
are accessible to plugins.

* Add experiment kmip.client_api.alpha1.

This experiment enables the KMIP client and template API endpoints.

* Use IsExperimentEnabled rather than ValidExperiments.

* Document TestCore_IsFlagEnabled.

Co-authored-by: Victor Rodriguez <vrizo@hashicorp.com>
2026-02-13 15:14:36 +00:00
Vault Automation
a728a665e1
Random API improvements (#12119) (#12143)
* In the random APIs, add a 'prng' param that causes a DRBG seeded from the selected source(s) to be the source of the returned bytes

* fixes, unit test next

* unit tests

* changelog

* memory ramifications

* switch to using a string called drbg

* Update helper/random/random_api.go



* wrong changelog

---------

Co-authored-by: Scott Miller <smiller@hashicorp.com>
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2026-02-03 20:02:48 +00:00
Vault Automation
edbc507488
Backport Add spiffe secrets engine into ce/main (#10648) 2026-02-03 10:41:44 -05: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
2e32e679d0
Backport PKI (SCEP): support compound octet strings for inner PKCS7 content into ce/main (#12021)
* PKI (SCEP): support compound octet strings for inner PKCS7 content (#12019)

* Support compound octet strings for inner PKCS7 content

* Add cl

* Remove hashicorp/go-cmp ENT dependency

---------

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2026-01-27 17:07:07 +00:00
Vault Automation
62be8c0fe6
Put fairshare and dnstest helper in sdk (#11583) (#11663) 2026-01-09 10:32:31 -05: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
2fca81e3c2
Backport Re-use kmip integ tests into ce/main (#11147)
* no-op commit

* Re-use kmip integ tests (#11050)

---------

Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
2025-12-04 09:15:29 -05:00
Bianca
bfbd6a9a93
Sync SCIM related files to CE/main (#11037) 2025-12-02 11:44:43 -03: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
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
3594d6d6b1
[VAULT-38605] Add self-enrollment option to the TOTP Login MFA method (#8711) (#8731)
Co-authored-by: Kuba Wieczorek <kuba.wieczorek@hashicorp.com>
2025-08-20 20:18:54 +01:00
Ryan Cragun
4c3a440e1f
testhelpers(ldap): always time out if we can't start the container in 1 minute (#31509)
Signed-off-by: Ryan Cragun <me@ryan.ec>
2025-08-15 17:35:06 -06:00
Steven Clark
bce06a8772
Add updates to various CE files to support the new ENT SPIFFE auth plugin (#31434) 2025-08-06 12:48:15 -04:00
Victor Rodriguez
32e3ecbf83
Add hooks for enterprise token auth metadata feature. (#31391) 2025-08-05 12:32:48 -04:00
Bruno Oliveira de Souza
194241e1d1
VAULT-35838: advance deprecation of duplicate HCL attributes to pending removal stage (#31215)
* HCL dup attr deprecation: pending removal

* correct docs

* add changelog

* better error message for possible common errors

* Update website/content/partials/deprecation/duplicate-hcl-attributes.mdx

Co-authored-by: Yoko Hyakuna <yoko@hashicorp.com>

* Update website/content/partials/deprecation/duplicate-hcl-attributes.mdx

Co-authored-by: Luis (LT) Carbonell <lt.carbonell@hashicorp.com>

---------

Co-authored-by: Yoko Hyakuna <yoko@hashicorp.com>
Co-authored-by: Luis (LT) Carbonell <lt.carbonell@hashicorp.com>
2025-07-24 15:17:51 -03:00
akshya96
1fb006633b
Update clientcountutil to accommodate entity record usage time changes CE changes (#31301)
* moving clientcountutil changes from ent

* adding random usage time for repeated clients

* replace math.rand with crypto.rand
2025-07-22 17:20:10 +00:00
Ellie
1e7f22aeec
Add DB type consts (#31295)
* add necessary consts

* add other db plugins

* correct ES

* Fix consts in test
2025-07-17 12:08:27 -05:00
Ellie
23e04c2409
Add MetricsReporter interface so that databaseBackend's can share their connection counts with CensusManager (#31269)
* add interface and impl

* add tests

* fix comments

* Update builtin/logical/database/backend.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-07-14 14:52:55 -05:00
Steven Clark
d9aa82470e
Add digest OID to PKCS7/SCEP digest failure logs (#31232)
* Add digest OID to PKCS7/SCEP digest failure logs

 - To help debugging in the future without requiring a full packet capture
   lets add the digest oid that we used to select the hashing algorithm that
   led to the digmest mismatch

* Add cl

* Fix type in CL header
2025-07-09 10:54:12 -04:00
Bruno Oliveira de Souza
0b9157156f
VAULT-32657 deprecate duplicate attributes in HCL configs and policies (#30386)
* upgrade hcl dependency on api pkg

This upgrades the hcl dependency for the API pkg,
and adapts its usage so users of our API pkg are
not affected. There's no good way of communicating
a warning via a library call so we don't.

The tokenHelper which is used by all Vault CLI
commands in order to create the Vault client, as
well as directly used by the login and server
commands, is implemented on the api pkg, so this
upgrade also affects all of those commands. Seems
like this was only moved to the api pkg because
the Terraform provider uses it, and I thought
creating a full copy of all those files back under
command would be too much spaghetti.

Also leaving some TODOs to make next deprecation
steps easier.

* upgrade hcl dependency in vault and sdk pkgs

* upgrade hcl dependency in vault and sdk pkgs

* add CLI warnings to commands that take a config

- vault agent (unit test on CMD warning)
- vault proxy (unit test on CMD warning)
- vault server (no test for the warning)
- vault operator diagnose (no tests at all, uses the
same function as vault server

* ignore duplicates on ParseKMSes function

* Extend policy parsing functions and warn on policy store

* Add warning on policy fmt with duplicate attributes

* Add warnings when creating/updating policy with duplicate HCL attrs

* Add log warning when switchedGetPolicy finds duplicate attrs

Following operations can trigger this warning when they run into a policy
with duplicate attributes:
* replication filtered path namespaces invalidation
* policy read API
* building an ACL (for many different purposes like most authZ operations)
* looking up DR token policies
* creating a token with named policies
* when caching the policies for all namespaces during unseal

* Print log warnings when token inline policy has duplicate attrs

No unit tests on these as new test infra would have to be built on all.
Operations affected, which will now print a log warning when the retrieved
token has an inline policy with duplicate attributes:
* capabilities endpoints in sys mount
* handing events under a subscription with a token with duplicate
attrs in inline policies
* token used to create another token has duplicate attrs in inline
policies (sudo check)
* all uses of fetchACLTokenEntryAndEntity when the request uses a
token with inline policies with duplicate attrs. Almost all reqs
are subject to this
* when tokens are created with inline policies (unclear exactly how that
can happen)

* add changelog and deprecation notice

* add missing copywrite notice

* fix copy-paste mistake

good thing it was covered by unit tests

* Fix manual parsing of telemetry field in SharedConfig

This commit in the hcl library was not in the
v1.0.1-vault-5 version we're using but is
included in v1.0.1-vault-7:
e80118accb

This thing of reusing when parsing means that
our approach of manually re-parsing fields
on top of fields that have already been parsed
by the hcl annotation causes strings (maybe
more?) to concatenate.

Fix that by removing annotation. There's
actually more occurrences of this thing of
automatically parsing something that is also
manually parsing. In some places we could
just remove the boilerplate manual parsing, in
others we better remove the auto parsing, but
I don't wanna pull at that thread right now. I
just checked that all places at least fully
overwrite the automatically parsed field
instead of reusing it as the target of the
decode call. The only exception is the AOP
field on ent but that doesn't have maps or
slices, so I think it's fine.

An alternative approach would be to ensure
that the auto-parsed value is discarded,
like the current parseCache function does

note how it's template not templates

* Fix linter complaints

* Update command/base_predict.go

Co-authored-by: Mike Palmiotto <mike.palmiotto@hashicorp.com>

* address review

* remove copywrite headers

* re-add copywrite headers

* make fmt

* Update website/content/partials/deprecation/duplicate-hcl-attributes.mdx

Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>

* Update website/content/partials/deprecation/duplicate-hcl-attributes.mdx

Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>

* Update website/content/partials/deprecation/duplicate-hcl-attributes.mdx

Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>

* undo changes to deprecation.mdx

* remove deprecation doc

* fix conflict with changes from main

---------

Co-authored-by: Mike Palmiotto <mike.palmiotto@hashicorp.com>
Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>
2025-05-23 16:02:07 -03:00
miagilepner
bea32a14ab
VAULT-35369: Loaded snapshots CE (#30529)
* full load

* snapshot manager tested

* integration test

* more tetsts

* remove obselete test

* fix failing test

* move tesdata to ent folder

* add test for RaftDataDirPath

* fix race condition, don't create new barrier instance

* check for nil result

* remove encryption from the barrier storage wrapper

* Update physical/raft/fsm.go

Co-authored-by: Kuba Wieczorek <kuba.wieczorek@hashicorp.com>

* fmt

---------

Co-authored-by: Kuba Wieczorek <kuba.wieczorek@hashicorp.com>
2025-05-16 14:27:04 +02:00
John-Michael Faircloth
86651479c8
test: fix CompilePlugin test helper (#30644)
This PR fixes CompilePlugin which would fail when run locally in certain
situations based on relative directory paths. This change makes
CompilePlugin perform os.Stat on the full path to the plugin's main.go
file to ensure the test changes to the appropriate directory for
building the plugin.
2025-05-15 20:42:44 +00:00
Steven Clark
1551d6943e
Add fixes for processing InTune SCEP messages within our PKCS7 library (#30595) 2025-05-14 08:25:15 -04:00
Steven Clark
dc8da38cb7
Add tweaks to tests for the new enterprise SCEP test (#30495) 2025-05-02 11:28:16 -04:00
Steven Clark
426088ddfb
Fix race within pkcs7.asn1Structured.EncodeTo (#30162)
- The function was incrementing and decrementing a global variable
   but was never used so remove it completely and all the commented
   out code that references the encodeIndent global.
2025-04-02 17:05:02 -04:00
Ryan Cragun
95b2d86870
ldap: pin test container to latest working version (#30148)
The test container that we use for many LDAP tests recently merged a
breaking change: https://github.com/rroemhild/docker-test-openldap/issues/62

Add support for using containers via references with digests and pin to the latest
version that worked. We can unpin later if so desired.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2025-04-01 22:24:15 +00:00
Bianca
6eeb228889
Persist automatic entity merges (#29568)
* Persist automatic entity merges

* Local aliases write in test

* Add identity entity merge unit property test

* N entities merge

* Persist alias duplication fix

---------

Co-authored-by: Paul Banks <pbanks@hashicorp.com>
Co-authored-by: Mike Palmiotto <mike.palmiotto@hashicorp.com>
2025-03-06 17:06:20 -05:00
Steven Clark
ce8094fb6c
Add underlining support for the PKI Enterprise SCEP work (#29604) 2025-02-13 15:54:18 +00:00
davidadeleon
6741773b0f
update vault auth submodules to api/v1.16.0 (#29548)
* update vault auth submodules to api/v1.16.0

* update go.mod

* make proto

---------

Co-authored-by: davidadeleon <ddeleon@hashicorp.com>
2025-02-11 07:28:45 -08:00
Mike Palmiotto
6d5759ecb3
identity: Introduce ActivationFunc for managing feature state (#29467)
* identity: Ensure state is changed on activation

This PR introduces some changes to the way activation flags are
processed in Vault.

Rather than reaching into subsystems and modifying
state from the activationflags package, each plugin can now register its
own ActivationFunc. Updates to activation flags now trigger the the
feature's ActivationFunc, which can encapsulate the associated
subsystem state.

We include a few bugfixes and minor cosmetic changes, like updates to
log lines and godocs.

* Check for nil system backend

* Move deduplication activation to common file

* Add identity dedup activation log lines

* Make interface methods clearer

* Clean up some comments

* More cleanups

* fixup! More cleanups

* fixup! More cleanups
2025-01-31 12:25:07 -03:00
Steven Clark
9456671f04
Prepare code base for Go 1.24 update. (#29412)
* Fix "t.Fatal from a non-test goroutine" errors in cache_test.go

 - t.Fatal(f) should not be called within a Go routine based on it's documentation and only from the main test's thread.
 - In 1.24 this seems to cause build failures

* Address all "non-constant format string errors" from go vet

 - Within 1.24 these now cause test builds to fail

…" from go vet
2025-01-27 14:34:07 -05:00
Mike Palmiotto
9d80c4548f
proto: bump protoc-gen-go to 1.36.3 (#29359) 2025-01-22 13:58:43 -05:00
Mike Palmiotto
f503f739de
identity: Resolve conflicts with rename (#29356)
This PR introduces a new type of conflict resolution for duplicate
Entities and Groups. Renaming provides a way of preventing Vault from
entering case-sensitive mode, which is the current behavior for any kind
of duplicate.

Renames append the conflicting identity artifact's UUID to its name and
updates a metadata field to indicate the pre-existing artifact's UUID.

The feature is gated by the force-identity-deduplication activation flag.

In order to maintain consistent behavior between the reporting resolver
and the rename operation, we need to adjust the behavior of generated
reports. Previously, they intentionally preserved existing Group merge
determinism, wherein the last MemDB update would win and all others
would be renamed. This approach is more complicated for the rename
resolver, since we would need to update any duplicated entity in the
cache while inserting the new duplicate (resulting in two MemDB
operations). Though we can ensure atomic updates of the two identity
artifacts with transactions (which we could get for groups with a minor
adjustment, and we will get along with batching of Entity upserts on 
load), it's far simpler to just rename all but the first insert as proposed
in the current PR.

Since the feature is gated by an activation flag with appropriate 
warnings of potential changes via the reporting resolver, we opt
for simplicity over maintaining pre-existing behavior. We can revisit
this assumption later if we think alignment with existing behavior
outweighs any potential complexity in the rename operation.

Entity alias resolution is left alone as a destructive merge operation
to prevent a potentially high-impact change in existing behavior.
2025-01-15 14:24:49 -05:00
Bianca
896532ef89
Add state change logic to reload from storage -- activation flags (#29341) 2025-01-10 11:56:40 +00:00
Bianca
ab4e8da697
Port activation flags with dynamic registration (#29237) 2025-01-09 10:27:58 -03:00