Commit graph

2996 commits

Author SHA1 Message Date
Vault Automation
ad4d228f1f
Backport Sgm/without envelope wireup into ce/main (#15700)
* no-op commit

* Sgm/without envelope wireup (#15441)

* Changes needed to allow encryption/decryption with gcpckms in managed keys

* wip

* wip

* wip

* Normalize key purposes across implementations

* update kmse

* Update kms wrapper deps to those that support WithoutEnvelope

* crucially, supply the option in the wrapper managed key impl

* restore the kmse update

* no, thats done via the encryptWithManagedKey in Policy, not needed here

* changelog

* remove replace

* Update sdk's go-kms-wrapping

* mod tidy

* Switch to using the main wrapper even for testing.

* update test cluster usage

* Update go.mod

Co-authored-by: wiz-inc-0e7a25329d[bot] <177343755+wiz-inc-0e7a25329d[bot]@users.noreply.github.com>

* Update go.mod

Co-authored-by: wiz-inc-0e7a25329d[bot] <177343755+wiz-inc-0e7a25329d[bot]@users.noreply.github.com>

* more go.sum update

* PR feedback

* GCPC KMS needed some more config massaging to work w/ encryption

---------

Co-authored-by: wiz-inc-0e7a25329d[bot] <177343755+wiz-inc-0e7a25329d[bot]@users.noreply.github.com>

---------

Co-authored-by: Scott Miller <smiller@hashicorp.com>
Co-authored-by: wiz-inc-0e7a25329d[bot] <177343755+wiz-inc-0e7a25329d[bot]@users.noreply.github.com>
2026-06-22 18:40:49 +00:00
Vault Automation
39a95742d8
Backport Add managed keys support to Transit rewrap endpoint into ce/main (#15496)
* Add managed keys support to Transit rewrap endpoint (#15321)
2026-06-19 10:38:08 -05:00
Vault Automation
edb540f843
Backport Change to Trail of Bits library for PQC into ce/main (#14616)
* no-op commit

* Backport Change to Trail of Bits library for PQC into release/2.x.x+ent (#14617)

* Change to Trail of Bits library for PQC (#12676)

* switch to tob library

* test fixes for mldsa public keys

* fix public keys in tests

* add logic for slh-dsa param changes

* add logic to handle both key encodings

* fix slhdsa key gen

* fix slhdsa public key

* add logic for hybrid keys

* fix slhdsa verify

* add test cases

* fix public key in read for pqc

* fix mldsa decoding

* fix mldsa public key encoding

* make encoding consistent

* fix tests

* fixes and bob tests

* add changelog

* fix test case

* adjust existing test cases

* add test cases with old keys

* go mod tidy

* run go mod tidy

---------

Co-authored-by: Rachel Culpepper <84159930+rculpepper@users.noreply.github.com>
Co-authored-by: rculpepper <rculpepper@hashicorp.com>

* go mod tidy

* add function for pqc public keys

* delete ent file

* remove library

---------

Co-authored-by: Rachel Culpepper <84159930+rculpepper@users.noreply.github.com>
Co-authored-by: rculpepper <rculpepper@hashicorp.com>
2026-06-12 20:54:07 +00:00
Vault Automation
2e9c402889
VAULT-44140 - Fix Radius case collision (#14493) (#14797)
* added a toggle to normalize radius usernames and reject case-variant duplicates to prevent case-collision

Co-authored-by: Himnish-Nadiminti <himnish.nadiminti@hashicorp.com>
2026-06-07 23:52:30 +05:30
Vault Automation
c0d95b0acf
Inline base64 func into getACMEToken (#15156) (#15171)
Inline base64 func into getACMEToken

Co-authored-by: Luciano Arroyo <95649169+DeLuci@users.noreply.github.com>
2026-06-05 10:03:26 -05:00
Vault Automation
0b34abf902
Backport: Copy PrepareTestContainer helper for LDAP into SDK, update references into ce/main (#15028)
Co-authored-by: Robert <17119716+robmonte@users.noreply.github.com>
2026-06-01 16:12:15 +00:00
Vault Automation
cd7b17c65f
PKI: JKS param rename (#15004) (#15026)
* tidy docs

* remove jks_alias for sign intermediate endpoint

* rename jks_alias to jks_private_key_alias

* only include jks_private_key_alias param in relevant endpoints

* initialize alias to empty string, reuse schema default

Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>
2026-05-27 21:47:12 +00:00
Vault Automation
df30dc67fe
VAULT-45232 - SSH roles List response schema updates (#14984) (#14989)
* VAULT-45232 - adds FieldSchema for SSH roles list

* fixed linting errors

Co-authored-by: mohit-hashicorp <mohit.ojha@hashicorp.com>
2026-05-26 22:23:40 +05:30
Vault Automation
26ea5081ea
SECVULN-41102: Use crypto compare on tokens (#14965) (#14971)
* use crypto compare on tokens

Co-authored-by: Jasper Milan <jasper.milan@ibm.com>
2026-05-26 10:12:09 -04:00
Vault Automation
06ed06acc2
Transit: Add openapi docs for context around transit key params (#14806) (#14829)
* update key ring to include keys from min_available_version

* Revert "update key ring to include keys from min_available_version"

This reverts commit 914c92def22d3d210bd20a3f100e712125fe478e.

* add openapi field schema

* rename method, move defaults inline

Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>
2026-05-15 12:43:15 -07:00
Vault Automation
0d65786a35
Fix PKI certificate issuance not_after time to respect role's max TTL (#14777) (#14830)
* Fix PKI certificate issuance not_after to respect role's max TTL

* Add changelog message

Co-authored-by: Luciano Arroyo <95649169+DeLuci@users.noreply.github.com>
2026-05-15 18:37:55 +00:00
Vault Automation
8a8b9f5e23
Backport PKI - Add java keystore format support into ce/main (#14817)
* no-op commit

* manual cherry-pick 6cb3e14dd0ee9840b46e9a9e10098a35d2727f92

---------

Co-authored-by: claire bontempo <cbontempo@hashicorp.com>
2026-05-15 10:51:37 -07:00
Vault Automation
2fa4d895a2
Remove invalid value from the supported list of ACME algorithms (#14737) (#14748)
* Remove Ed25519 from the allowed ACME account key types

* Add changelog entry

Co-authored-by: Luciano Arroyo <95649169+DeLuci@users.noreply.github.com>
2026-05-12 20:32:35 +00:00
Vault Automation
bd8da3ad0f
Resolve some code-alerts, and add particular tests. (#14689) (#14704)
Co-authored-by: Kit Haines <khaines@mit.edu>
2026-05-11 14:04:12 -04:00
Vault Automation
a4780807e8
Allow WIF and rotation parameters to be set independently (#14414) (#14713)
* allowing WIF and rotation parameters to be set independently

* adding CL entry

* VAULT-42211 allowing independently setting of parameter for client/config endpoint

* introducing logic for identity token and rotation parameter detection

* moving the detectection change logic to corresponding packages

* sdk: add rotation and wif helpers

* changelog

* changelog updates

---------

Co-authored-by: John-Michael Faircloth <fairclothjm@users.noreply.github.com>
Co-authored-by: Martin Hristov <mhristov@hashicorp.com>
2026-05-11 17:24:42 +00:00
Vault Automation
42c2b75141
Backport PKI - Add PKCS#12 format support into ce/main (#14588)
* no-op commit

* rebase

---------

Co-authored-by: claire bontempo <cbontempo@hashicorp.com>
2026-05-08 14:54:54 -07:00
Vault Automation
a419e96d4e
Validate 2 character ISO 3166 codes for the Country role field (#13346) (#13496)
* Validate 2 character ISO 3166 codes for the Country role field

* stricter validation

* dont validate on GetRole unless it was modified by upgrade.  This should help not error out on existing roles with a bad validation

* Validate, but only warn rather than fail

* fix unit tests that were using invalid country codes

* fix more tests

* lint

* Update changelog/_13346.txt



* simply slice searches

* rephrase changelog

---------

Co-authored-by: Scott Miller <smiller@hashicorp.com>
Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
2026-05-08 19:04:21 +00:00
Vault Automation
23eec51fc1
move helper function to backend_test so as not to be ENT or CE specific (#14619) (#14635)
Co-authored-by: Scott Miller <smiller@hashicorp.com>
2026-05-07 21:41:18 +00:00
Vault Automation
720efc200d
On-Time Autorotation Maintained in a Queue. (#14463) (#14503)
* On-Time Autorotation Maintained in a Queue.

* Add changelog.

* Renamed changelog correctly.

* Add a check to exit-out early if initialization of the backend has not run (probably only relevant in tests, but not a bad check).

* GoTestDoc added for test.

* Initialize backend in tests.

* Add error checks, compilation check, and move initialize function.  Switch to object with a zero-value.

Co-authored-by: Kit Haines <khaines@mit.edu>
2026-05-06 12:39:43 -04:00
Vault Automation
daeade6ba1
Backport Add transit test using managed keys into ce/main (#14534)
Also includes https://github.com/hashicorp/vault-enterprise/pull/14540
2026-05-06 12:05:40 -04:00
Vault Automation
c9430538b3
VAULT-44064 - Add rollback support to the snowflake key pair root credentials rotation (#14046) (#14400)
* Add rollback support to the snowflake key pair root rotation flow

* Added changelog

* Updated changelog

* Updated changelog

* Updated rollback logic

* Updated rollback logic

* Updated rollback logic

* Updated rollback logic

* Updated tests

* Addressed PR comments

* Updated tests

* Addressing PR Review Comments



---------

Co-authored-by: santoshhashicorp <santosh.yelamarthi@hashicorp.com>
Co-authored-by: John-Michael Faircloth <fairclothjm@users.noreply.github.com>
2026-04-29 15:29:02 +05:30
Vault Automation
2f4fe5345a
Backport fix: add timeout context around UpdateUser to prevent static role rotation hang into ce/main (#13971)
* fix: add timeout context around UpdateUser to prevent static role rotation hang (#13697)

* fix: add timeout context around UpdateUser to prevent static role rotation hang

* changelog: add entry for static role rotation timeout fix

* fix: rename changelog file to match expected format

* fix: update changelog format to release-note style

* Bound database Initialize to prevent static rotation stalls

* add missing go doc

* pr comments: close changelog block, distinguish parent context cancellation from UpdateUser timeout

* changelog: include Initialize timeout handling

* async Close on init cancel/timeout, add test, and set PluginName in test config

* add UpdateUser timeout test coverage for static role rotation

* go doc comments fix

* Apply suggestions from code review

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

* welp copilot prompt was out of date and I shouldn't have accepted it.

---------

Co-authored-by: Angel Garbarino <argarbarino@gmail.com>
Co-authored-by: Angel Garbarino <Monkeychip@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* fix(database): remove async UpdateUser timeout and use synchronous context to avoid race conditions

* fix(backport): restore async UpdateUser timeout behavior

---------

Co-authored-by: arslan23-push <arslan.muhammad@ibm.com>
Co-authored-by: Angel Garbarino <argarbarino@gmail.com>
Co-authored-by: Angel Garbarino <Monkeychip@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-04-28 09:01:57 -06:00
Vault Automation
ac8286bd3c
This adds a comment which tripped up our code-reviewers. We are disabling a check that doesn't make sense for our customers. (#14268) (#14278)
Co-authored-by: Kit Haines <khaines@mit.edu>
2026-04-27 14:08:40 -04:00
Vault Automation
2cf5691315
Change Policy locking so that GetPolicy always returns a locked policy (#13899) (#14277)
* change GetPolicy to return a locked policy always

* add more fixes and changelog

* remove extra unlock

* make fmt

* fix transform test

* fix write locks with cache

* address comments

Co-authored-by: Rachel Culpepper <84159930+rculpepper@users.noreply.github.com>
2026-04-27 11:34:47 -04:00
Vault Automation
dcea542a3a
Upload-Issuer Compliance with Common Criteria. (#12101) (#12501)
* Upload-Issuer Compliance with Common Criteria.

* Add Changelog.

* Update changelog/_12101.txt



* Update builtin/logical/pki/storage_validate_imports_ent.go



* PR-Review, add trap for deletion errors.

* Add test-doc referencing NIAP requirement.

---------

Co-authored-by: Kit Haines <khaines@mit.edu>
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2026-04-24 14:06:07 -04:00
Vault Automation
d6e909ae4b
Fix flaky test TestTransit_SignVerify_ECDSA (#14185) (#14205)
* Fix flaky test TestTransit_SignVerify_ECDSA

* Fix comment on incrementing

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2026-04-23 09:03:30 -04: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
d5b7b698d3
Add Freshest CRL to Base CRL (#13564) (#13766)
* add freshest crl to base

* add test

* add helper, add test case for delta crl

* add openssl test

* add changelog

* add removed nil check

* add go doc

* change keytype to ec

* rotate CRL instead of role/issue/revoke a cert and add ldap url test case

* move root generation outside test loop

* remove length check so urls are always set for each test case

* remove unnecessary clearing

Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>
2026-04-09 10:06:01 -07:00
Vault Automation
a23dc5c0e0
[VAULT-43618] sdk: migrate from github.com/docker/docker to github.com/moby/moby
Resolve GHSA-x744-4wpc-v9h2 and GHSA-pxq6-2prw-chj9 in `vault` by replacing
`github.com/docker/docker` with `github.com/moby/moby/client` @ `v0.3.0` and
`github.com/moby/moby/api` @ `v1.54.0`. This is necessary as `docker/docker`
 is no longer maintained and the fixes are not available in it.

Resolve GO-2026-4518, GHSA-x6gf-mpr2-68h6 and GHSA-jqcq-xjh3-6g23 by
upgrading to github.com/jackc/pgx/v5. This is necessary as v4 is not
longer maitained.

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2026-04-02 13:58:05 -04:00
Vault Automation
51c873051a
Fix occasional error within pki.TestParseCertificate/full_non_CA_cert/full_non_CA_cert_fields (#13399) (#13429)
* Fix occasional error within pki.TestParseCertificate/full_non_CA_cert/full_non_CA_cert_fields

* Drop length matching in regex and parse hex comparing as big int against certificate

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2026-03-26 13:32:07 -07:00
Vault Automation
f7a1a4e825
Fix TestPki_MultipleOUs failing on slow machines (#13390) (#13435)
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2026-03-26 17:56:19 +00:00
Vault Automation
a6f04b6f46
Add parsed fields from integration certificate issuance response to t… (#12790) (#12944)
* Add parsed fields from integration certificate issuance response to the response audit logs.

* Add changelog.

* Return signature error-fix.

* Fix nil-error.

* Pull-Request Review Updates.

* EST and CMPv2 audit logging tests, and noopAudit setup for SCEP testing.

* Fix Audit Tests.

* Fix serial-number parsing in template parser.

* Go mod tidy

* Circular dependency issue.

* Fix test to allow parsing serial_number

Co-authored-by: Kit Haines <khaines@mit.edu>
2026-03-26 12:00:16 -04:00
Vault Automation
767e99a875
pki/acme: add redirect test for acme http-01 challenge (#13091) (#13095)
Co-authored-by: mickael-hc <86245626+mickael-hc@users.noreply.github.com>
2026-03-18 09:04:20 -04:00
Vault Automation
645d8238d3
Backport update go version 1.26.1 into ce/main (#13099)
* update go version to 1.26.1 (#13061)

---------

Co-authored-by: Maithy Ton <github@maithyton.com>
2026-03-17 17:02:43 -07:00
Vault Automation
3b25846e75
Update ldaputil to allow plugins to perform their own schema validation (#12897) (#12995)
Co-authored-by: vinay-gopalan <86625824+vinay-gopalan@users.noreply.github.com>
2026-03-16 09:10:29 -07:00
Vault Automation
0aae8acb20
Add IP range filtering for ACME challenge validation. (#13010) (#13036)
* Add IP range filtering for ACME challenge validation.

 * Add challenge_permitted_ip_ranges and challenge_excluded_ip_ranges API fields
 * Add PermittedIPRanges and ExcludedIPRanges fields to acmeConfigEntry
 * Implement CIDR/IP validation with precedence: excluded > permitted > default

* Add changelog entry.

Co-authored-by: Victor Rodriguez Rizo <vrizo@hashicorp.com>
2026-03-16 15:52:41 +00:00
Vault Automation
4f71c2cde0
Copy pki/acme: reject unsafe validation targets during challenge verification into main (#12959) (#12963)
* Copy https://github.com/hashicorp/vault/pull/31828 into main



* pki/acme: reject unsafe validation targets

reject loopback, link-local, unspecified, multicast, and other
non-global-unicast targets before HTTP-01 and TLS-ALPN-01 validation
connections are attempted.

the shared dial helper now filters both direct IP literals and DNS
resolution results, and regression tests cover loopback-via-DNS for
both validators plus direct loopback literals.

* changelog: add entry for ACME validation hardening PR

* pki/acme: allow configured validation targets

* pki/acme: add docs for validation tests

---------

Co-authored-by: 1seal <security@1seal.org>
2026-03-12 21:44:36 +00:00
Vault Automation
d34cb72e68
Add counting for SSH certs and OTPs (#12368) (#12755)
* add cert counting for ssh

* add system view and fix errors

* add otp counting and change units for certs

* add storage tests

* fix census errors

* run make fmt

* use incrementer and change storage to match rfc

* run make fmt

* fix interface and remove parameter

* fix errors

* Update builtin/logical/ssh/path_creds_create.go



* remove error check

* add ssh counts to billing endpoint

* fix error

* add test case

* add ssh metric to test

* add get functions and tests

* fix format

* create function for ssh metrics

* refactoring and add test cases

* replace test check

* add ssh to billing overview test

---------

Co-authored-by: Rachel Culpepper <84159930+rculpepper@users.noreply.github.com>
Co-authored-by: Victor Rodriguez Rizo <vrizo@hashicorp.com>
2026-03-11 10:30:48 -04:00
Vault Automation
8b3ebfc1fe
add deprecated comments (#12791) (#12898)
Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>
2026-03-10 13:38:33 -07:00
Vault Automation
b72907dcdf
PKI: Properly limit the max_path_length argument on sign-intermediate to a parent's max_path_length (#12623) (#12819)
* Properly limit the max_path_length argument to a parent's max_path_length

* add cl

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2026-03-09 13:38:13 +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
45c2c94f90
Allow "glob" style wildcards in DNS names when issuing PKI certs (#12674) (#12704)
* Allow "glob" style wildcards in DNS names when issuing PKI certs.

Change the regex we use to validate hostnames to allow wildcards in the first
"label" of the hostname to be not just "*" by itself, but to be in any position.

Remove unused duplicated regexes from cert_util.go.

Add unit tests.

Co-authored-by: Victor Rodriguez Rizo <vrizo@hashicorp.com>
2026-03-04 15:48:48 +00:00
Vault Automation
d160737ced
[VAULT-42862] upgrade cloudflare/circl => v1.6.3 to partially resolve CVE-2026-1229 (#12567) (#12651)
Upgrade `cloudflare/circl` to v1.6.3 to resolve CVE-2026-1229. We had
several transient dependencies that depend on various versions of
`circl` that also needed to be updated in order to resolve the latest
version everywhere.

- github.com/ProtonMail/go-crypto v1.2.0 => v1.3.0
- github.com/google/go-github v17 => v83/v83.0.0
- github.com/google/go-github/v81 => v83/v83.0.0

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2026-03-03 10:31:03 -07:00
Vault Automation
17e72d8904
Ignore Basic Constraint Extentions in CSRs for sign-intermediate (#12603) (#12606)
* Ignore Basic Constraint Extentions in CSRs for sign-intermediate

* add cl

* PR feedback

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2026-02-27 19:57:54 +00:00
Vault Automation
e8dc7c908e
Fix cert tests failing due to expired cert in test fixtures (#12564) (#12570)
Also fix panic when vault is sealed

Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
2026-02-26 19:22:37 +00:00
Vault Automation
67fb5f3eda
Backport VAULT-41675: Transit observations, key management into ce/main (#12380)
* VAULT-41675: Transit observations, key management (#12100)

* start transit implementation

* all observations and tests

* add comments

* cleanup

* Fix broken build (#12384)

---------

Co-authored-by: miagilepner <mia.epner@hashicorp.com>
Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
2026-02-18 15:19:18 +01:00
Vault Automation
daa03407c0
fix: panic on malformed protected field in verifyEabPayload (#12260) (#12365)
* fix: panic on malformed protected field in veryfyEabPayload

* clear comments

* missed a }

* add changelog

* Update changelog/12260.txt



* rename 12260.txt to _12260.txt

* address lint issue

---------

Co-authored-by: Deniz Onur Duzgun <59659739+dduzgun-security@users.noreply.github.com>
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2026-02-16 17:02:21 +00:00
Vault Automation
65597dd37c
Backport Renaming to generalize pki certificate counts into ce/main (#12327)
* no-op commit

* Renaming to generalize pki certificate counts (#12304)

* renaming to generalize pki certificate counts

# Conflicts:
#	vault/replication_rpc_ent.go
#	vault/testing_util.go

* Update vault/testing_util.go

Co-authored-by: Victor Rodriguez Rizo <vrizo@hashicorp.com>

* Remove "PKI" from a few more names related to certificate count code.

---------

Co-authored-by: Victor Rodriguez Rizo <vrizo@hashicorp.com>
# Conflicts:
#	builtin/logical/pki/backend_cmpv2_ent_test.go
#	vault/activity_log_product_usage_util_ent.go
#	vault/activity_log_util_ent.go
#	vault/cert_count/cert_count_manager.go
#	vault/cert_count/cert_count_manager_test.go
#	vault/external_tests/activity_testonly/activity_testonly_ent_test.go
#	vault/logical_system_helpers_ent.go
#	vault/logical_system_pki_certificate_count_ent.go
#	vault/logical_system_pki_certificate_count_ent_test.go
#	vault/replication_paths_ent.go
#	vault/replication_rpc_ent.go
#	vault/testing_util.go

* add ce changes

---------

Co-authored-by: Rachel Culpepper <84159930+rculpepper@users.noreply.github.com>
Co-authored-by: Victor Rodriguez Rizo <vrizo@hashicorp.com>
Co-authored-by: rculpepper <rculpepper@hashicorp.com>
2026-02-13 11:00:48 -05:00
Vault Automation
9cfcfec78a
Count duration adjusted certificate counts for billing (#12286) (#12310)
* Change PkiCertificateCountManager.GetCounts() to return a CertCount.

* Add PkiDurationAdjustedCerts field to CertCount.

Add a new field to CertCount to keep track of "duration adjusted" issued
certificates.

Add an x509.Certificate argument to CertCountIncrementer.AddIssuedCertificate.
In the implementation, use the certificate's NotBefore and NotAfter fields to
calculate the validity duration for the certificate, and use that to compute the
duration adjusted units.

* Add the issued certificate to calls to AddIssuedCertificate.

* Add PkiDurationAdjustedCerts when forwarding counts.

Add pki_duration_adjusted_certificate_count to IncrementPkiCount proto.

Update replicationServiceHandler.IncrementPkiCertCountRequest to take into
account the new field.

* Run make proto.

* Update testingPkiCertificateCounter to make assertions on time adjusted counts.

* PR review: Don't use NotAfter.Sub(NotBefore), since time.Duration is max 290 years.

* PR review: Move DurationAdjustedCertificateCount to logical.pki/test_helpers.

Add Bob generated unit tests for logical.durationAdjustedCertificateCount.

* Run make fmt.

Co-authored-by: Victor Rodriguez Rizo <vrizo@hashicorp.com>
2026-02-13 09:41:37 -05:00
Vault Automation
9839d40b10
Backport rotationMgr: enable RM to send rotation information to plugins on registration/rotation operations into ce/main (#12308)
* rotation-manager: enable RM to send rotation information to plugins on registration/rotation operations (#11810)

* initial commit for sending NVR to plugins

* add changelog

* add NVR to plugin fields, add RotationInfo to GRPC request handler

* fix tests

* ensure consistent formats on times and ttls

* add translation to allow grpc data transfer

* fix tests and rename fields

* fix missed field renames in tests

* make all methods net-new for backwards compatibility

* update mock plugin and add oss stub back

* remove method with no usages

* Address wrapper comments

* Rebuild proto

* Nil check around SetRotationInfo, return n/a for no last_vault_rotation

* Fix error to match other instances

* Update fields.go

* Return nil if unset for next/last vault rotation times

---------

Co-authored-by: robmonte <17119716+robmonte@users.noreply.github.com>

* Fix return type in stub method

---------

Co-authored-by: vinay-gopalan <86625824+vinay-gopalan@users.noreply.github.com>
Co-authored-by: robmonte <17119716+robmonte@users.noreply.github.com>
2026-02-12 18:25:47 -06:00