Commit Graph

2840 Commits

Author SHA1 Message Date
Ryan Cragun
69646127df fmt: check gosimports during pre-commit hooks (#29520)
`gosimports` is the preferred style for module imports and it is
enforced via CI. I've found that things often manage to drift so I've
taken the liberty to update our pre-commit hook to verify our imports
formatting before a change is committed.

Along with updating the formatting helper I've also run `make fmt` to
resolve any formatting drift that managed to make it into the codebase.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2025-02-27 15:56:34 -07:00
vinay-gopalan
f06f2f8188 add missing create operation for aws secrets (#29737) 2025-02-27 09:20:12 -08:00
vinay-gopalan
e8c07ec68e Small fixes on UX of Automated Root Rotation parameters (#29685) 2025-02-25 09:14:38 -08:00
John-Michael Faircloth
e2f09cb2ab database: fix reload to not fail early (#29519)
* database: fix reload to not fail early

* return logical.ErrorRresponse; add tests

* do not return noop warnings; add logs

* changelog

* use name for log; remove event doc
2025-02-20 14:53:58 +00:00
Milena Zlaticanin
6e0c771e57 Add support for cross account management of static roles in AWS Secrets (#29645)
* aws-secrets/add-cross-acc-mgmt-static-roles

* refactor

* add function pointer for tests

* delete commented out code

* update

* update comment

* update func name

* add flag

* remove docs
2025-02-14 14:13:00 -07:00
vinay-gopalan
6a9de17ac4 move logs into if block (#29634) 2025-02-13 22:56:22 +00:00
kpcraig
db0d911683 Add support code for auth/ldap root autorotation (#29535)
---------

Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>
2025-02-13 16:06:47 -05:00
Steven Clark
ce8094fb6c Add underlining support for the PKI Enterprise SCEP work (#29604) 2025-02-13 15:54:18 +00:00
vinay-gopalan
9e38a88883 Add automated root rotation support to DB Secrets (#29557) 2025-02-11 12:09:26 -08: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
vinay-gopalan
9b70487623 Automated rotate root support for AWS Auth and Secrets (#29497) 2025-02-10 18:36:44 -05:00
John-Michael Faircloth
8d0443fd48 db: honor static role TTL across restarts when skip import rotation i… (#29537)
* db: honor static role TTL across restarts when skip import rotation is enabled

* changelog
2025-02-10 15:28:19 -06:00
Kit Haines
49ecdad1ad Sign empty to cert on manual-chain update. (#29473)
* Sign empty to cert on manual-chain update.

* Add role defaults.

* Add changelog.

* More useful error message.

* Suggestions from PR Review.

* Fixes to update as well as write; test that still fails; revert code.

* Unit Test fix.

* Add go doc to TestManualChainValidation
2025-02-10 15:24:52 -05:00
Kit Haines
371ffc4bd4 Move all pki-verification calls from sdk-Verify() to pki-specific (#29342)
* Move all pki-verification calls from sdk-Verify() to pki-specific
VerifyCertifcate(...); update sdk-Verify to allow multiple chains,
but validate that at least one of those chains is valid.

* Updates to Validate on Parse PEMBlock, so that a single cert or a single key parses (test fixes).

* Add changelog.

* Make test certificate expire in a while, not at linux epoch.

* Remove duplicate code.

* Fix header file + go mod tidy.

* Updates based on review.
2025-01-29 11:05:55 -05:00
vinay-gopalan
838a38443f Update Rotation Manager OSS Stubs and SDK methods (#29401) 2025-01-28 14:24:44 -06: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
devon-mar
a401afe824 Add serial_number_source option to PKI role (#29369)
* Add `serial_number_source` option to PKI role

* Add changelog for #29369

---------

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2025-01-27 08:51:26 -05:00
John-Michael Faircloth
28b2746545 db: return success response on static role create/update (#29407) 2025-01-24 11:02:38 -08:00
Mike Palmiotto
9d80c4548f proto: bump protoc-gen-go to 1.36.3 (#29359) 2025-01-22 13:58:43 -05:00
Ryan Cragun
357b2949e3 protobuf: rebuild protos with protobuf 1.36.2 (#29318)
* protobuf: rebuild protos with protobuf 1.36.2
* format: please buf formatter

Signed-off-by: Ryan Cragun <me@ryan.ec>
2025-01-08 21:35:04 +00:00
vinay-gopalan
27bd3e9535 Add SDK helpers and Core stubs for plugins to communicate with Enterprise Rotation Manager (#29273)
Co-authored-by: Robert <17119716+robmonte@users.noreply.github.com>
Co-authored-by: John-Michael Faircloth <fairclothjm@users.noreply.github.com>
2025-01-07 22:22:45 +00:00
Michael Blaum
f18801693b Vault 27392 log ldap warning - remove from warning from response (#29134)
* log ldap warnings instead of returning them to end user

* add cl

* code review

* Update changelog/29134.txt

Co-authored-by: John-Michael Faircloth <fairclothjm@users.noreply.github.com>

* Update changelog/29134.txt

Co-authored-by: John-Michael Faircloth <fairclothjm@users.noreply.github.com>

* fix test

---------

Co-authored-by: John-Michael Faircloth <fairclothjm@users.noreply.github.com>
2025-01-07 16:51:15 -05:00
John-Michael Faircloth
c39aa51916 test: fix ce/ent diff (#29307) 2025-01-07 09:19:32 -08:00
Steven Clark
e1538468c9 PKI: Add management APIs for ACME accounts (#29173)
* Allow a Vault operator to list, read and update PKI ACME accounts

 - This allows an operator to list the ACME account key ids, read
   the ACME account getting all the various information along with
   the account's associated orders and update the ACME account's
   status to either valid or revoked

* Add tests for new ACME management APIs

* Update PKI api-docs

* Add cl

* Add missing error handling and a few more test assertions

* PR feedback

* Fix Note tags within the website

* Apply suggestions from docscode review

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

* Update website/content/api-docs/secret/pki/issuance.mdx

* Update website/content/api-docs/secret/pki/issuance.mdx

* Update website/content/api-docs/secret/pki/issuance.mdx

---------

Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>
2025-01-07 09:34:17 -05:00
John-Michael Faircloth
6110ee084f db: allow updates to self_managed_password (#29283) 2025-01-06 12:05:41 -06:00
Scott Miller
031c5d6d20 More CE changes for hybrid wireup (#29282)
* More CE changes for hybrid wireup

* remove unused func

* undo reintroduction of loss of omitempty

* Add ent hooks and handle unsupported keys correctly

* tidy import

* Fix ent encode test logic
2025-01-06 16:45:07 +00:00
Steven Clark
d3a91f74c7 Update an expired certificate within the cert-auth test fixtures (#29289)
* Update an expired certificate within the cert-auth test fixtures

* Update additional vault-diagnose tests with an expired cert using pkihelper
2025-01-06 11:11:30 -05:00
Ryan Cragun
f730d31bc6 protobuf: rebuild protos with protobuf 1.36 (#29229)
Signed-off-by: Ryan Cragun <me@ryan.ec>
2025-01-03 14:19:00 -07:00
Scott Miller
39365aa01f Simply remove any ent machinery from the export test (#29280)
* Simply remove any ent machinery from the export test

* missed
2025-01-03 18:37:53 +00:00
John-Michael Faircloth
9a830736c8 fix db test data race for queue tick interval (#29276) 2025-01-03 09:27:10 -06:00
Scott Miller
7c1d6e5e84 CE side changes to key policy engine for ML-DSA/Hybrid support (#29274)
* CE side changes to key policy engine for ML-DSA/Hybrid support

* fix ce mismatch for verify

* restore omitempty

* unnecessary

* Perform code reuse of ed25519 validation differently

* make parts of export testing ent only

* license
2025-01-03 09:46:00 -05:00
claire bontempo
91d88c3de1 Add UI support name constraints (#29263)
* add open api params

* support pki name constraints

* fix conditional

* revert helptextwsubtext

* fix typo

* add name constraints to sign intermediate form

* add changelog

* update test
2025-01-02 11:50:49 -06:00
divyaac
3622e22101 Revert "Remove all references to current fragments, standbyfragments and part…" (#29267)
This reverts commit 6ed4ad0851.
2024-12-30 13:19:09 -08:00
Victor Rodriguez
f6910bbb2e Sort CA chain into root and intermediates on VerifyCertificate. (#29255)
Sort CA chain into root and intermediates on VerifyCertificate.

In order for the Certificate.Verify method to work correctly, the certificates
in the CA chain need to be sorted into separate root and intermediate
certificate pools.

Add unit tests to verify that name constraints in both the root and intermediate
certificates are checked.
2024-12-23 19:56:41 +00:00
Victor Rodriguez
b9e949bf73 Support all fields of the name constraints extension when generating CA certificates (#29245)
Support all fields of the name constraints extension when generating CA certs.

The PKI secrets engine only provided parameter permitted_dns_domains to create
the name constraints extension when generating CA certificates.

Add the following parameters to provide full support for the extension:

  * permitted_email_addresses
  * permitted_ip_ranges
  * permitted_uri_domains
  * excluded_dns_domains
  * excluded_email_addresses
  * excluded_ip_ranges
  * excluded_uri_domains

Specifying any combination of these parameters will trigger the creation of the
name constraints extension as per RFC 5280 section 4.2.1.10.
2024-12-20 14:55:25 -05:00
Scott Miller
3754c67abf Enable seal wrapping for approle secret storage (#28703)
* Enable seal wrapping for approle secret storage

* changelog
2024-12-20 13:03:34 -06:00
Rachel Culpepper
796a565f4c fix key type for hybrid key creation tests (#29135) 2024-12-20 10:35:51 -06:00
John-Michael Faircloth
f5191bd06e db: fix skip-import-rotation/rootless integration (#29202)
* db: fix skip-import-rotation/rootless integration

* prevent setting both password and self_managed_password

* move func call and add comment
2024-12-17 11:17:02 -06:00
Mike Palmiotto
bf1741e123 make fmt (#29196) 2024-12-16 13:07:28 -05:00
John-Michael Faircloth
d411a44c18 secrets/db: enable skip auto import rotation of static roles (#29093)
* secrets/db: enable skip auto import rotation of static roles

* fix panic due to empty role name causing role to not be stored

* fix role upgrade test

* Apply suggestions from code review

Co-authored-by: vinay-gopalan <86625824+vinay-gopalan@users.noreply.github.com>
Co-authored-by: kpcraig <3031348+kpcraig@users.noreply.github.com>

* use password in favor of self_managed_password

* add deprecated to self_managed_password field

* fix bug with allowing updates to password

---------

Co-authored-by: vinay-gopalan <86625824+vinay-gopalan@users.noreply.github.com>
Co-authored-by: kpcraig <3031348+kpcraig@users.noreply.github.com>
2024-12-12 01:39:09 +00:00
Rachel Culpepper
5701c5b492 add ce changes for ecdsa hybrid (#29123) 2024-12-09 10:58:46 -06:00
Scott Miller
86ba0dbdeb Use go-secure-stdlib's RSA key generator backed by a DRBG (#29020)
* Use DRBG based RSA key generation everywhere

* switch to the conditional generator

* Use DRBG based RSA key generation everywhere

* switch to the conditional generator

* Add an ENV var to disable the DRBG in a pinch

* update go.mod

* Use DRBG based RSA key generation everywhere

* switch to the conditional generator

* Add an ENV var to disable the DRBG in a pinch

* Use DRBG based RSA key generation everywhere

* update go.mod

* fix import

* Remove rsa2 alias, remove test code

* move cryptoutil/rsa.go to sdk

* move imports too

* remove makefile change

* rsa2->rsa

* more rsa2->rsa, remove test code

* fix some overzelous search/replace

* Update to a real tag

* changelog

* copyright

* work around copyright check

* work around copyright check pt2

* bunch of dupe imports

* missing import

* wrong license

* fix go.mod conflict

* missed a spot

* dupe import
2024-12-05 15:39:16 -06:00
kpcraig
d8482b008a VAULT-32804: Add STS Fallback parameters to secrets-aws engine (#29051)
Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>

---------

Co-authored-by: Robert <17119716+robmonte@users.noreply.github.com>
Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>
2024-12-05 16:22:21 -05:00
vinay-gopalan
93f5777f6f Update DB Static role rotation logic to generate new password if retried password fails (#28989) 2024-12-03 11:29:13 -08:00
divyaac
6ed4ad0851 Remove all references to current fragments, standbyfragments and partialMonthTracker (#29066)
* Oss Changes Patch

* Remove test from oss file
2024-12-02 11:44:03 -08:00
Steven Clark
9bf3d115fc Add an option to allow cert-auth to return metadata about client cert that fails login (#29044)
* Add an option to allow cert-auth to return metadata about client certs that fail login

* Add cl

* Update SPDX header for sdk/logical/response_test.go
2024-11-29 10:22:09 -05:00
Victor Rodriguez
ba969bb14f Run make fmt. (#29053) 2024-11-28 15:27:17 +00:00
Victor Rodriguez
2d401bf91c Add hook for ENT tweaking of PKI contraints verification options. (#29048) 2024-11-27 19:59:57 +01:00
Victor Rodriguez
48cec9729d Enforce PKI issuer constraints. (#29045)
Add environment variable VAULT_DISABLE_PKI_CONSTRAINTS_VERIFICATION.

Setting VAULT_DISABLE_PKI_CONSTRAINTS_VERIFICATION=true will disable the cert
issuance/signing verification.
2024-11-27 18:34:26 +01:00
Victor Rodriguez
b2886d2a99 Revert "Perform validation when issuing or signing certificates. (#28921)" (#29041)
This reverts commit 31fc51c68f.
2024-11-27 16:22:20 +00:00