Commit Graph

2429 Commits

Author SHA1 Message Date
hc-github-team-es-release-engineering
2766fa2297 [DO NOT MERGE UNTIL EOY] EOY license fixes 1.13.x (#24391) 2024-01-02 10:35:40 -08:00
hc-github-team-secure-vault-core
c029f6fb10 PKI: Do not set NextUpdate OCSP field when ocsp_expiry is 0 (#24192) (#24194)
* Do not set NextUpdate OCSP field when ocsp_expiry is 0

* Add cl

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2023-11-20 16:03:13 +00:00
hc-github-team-secure-vault-core
239ccdd259 backport of commit 87376a1f5c (#23789)
Co-authored-by: Hamid Ghaf <83242695+hghaf099@users.noreply.github.com>
2023-10-23 16:23:35 +00:00
hc-github-team-secure-vault-core
01df297336 backport of commit d0501db90f (#23744)
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2023-10-19 19:49:07 +00:00
hc-github-team-secure-vault-core
85014f9869 Fix Transit managed key fixes - OSS (#23676) (#23678)
- This is the OSS parts of the greater enterprise PR to address some
   issues with signing and encryption within Transit using managed keys.

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2023-10-16 20:31:20 +00:00
hc-github-team-secure-vault-core
c4a31dacf0 Backport of Clean up unused CRL entries when issuer is removed into release/1.13.x (#23029)
* backport of commit e2ff1f1c71 (#23030)

Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>

* backport of commit 293e8b8ac5 (#23045)

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>

* Fix call of crlBuilder.rebuild

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

---------

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2023-09-13 13:57:36 +00:00
Scott Miller
8abe3cd68b Reject supplied nonces for non-convergent encryption operations (#22852) (#22901)
* Reject supplied nonces for non-convergent encryption operations (#22852)

Backport to 1.13.x

* need http after all
2023-09-08 09:59:21 -05:00
hc-github-team-secure-vault-core
f64271918b backport of commit a70aaf24c0 (#22255)
Co-authored-by: Austin Gebauer <34121980+austingebauer@users.noreply.github.com>
2023-08-08 23:45:32 +00:00
Steven Clark
620dd76564 Address memory consumption from TestCertStorageMetrics (#22004) 2023-07-21 15:14:23 +00:00
Steven Clark
f75217ae7b Remove accidently committed merge failure file (#21858) 2023-07-14 13:34:51 +00:00
Steven Clark
98032aa8dd Add back paths to TestProperAuthing - take 2 (#21856)
- Since the backport's for the OpenAPI list haven't occurred yet, we need both the existing path and the new path for when they do get backported.
2023-07-14 13:02:20 +00:00
hc-github-team-secure-vault-core
0d4bd48079 Update TestProperAuthing test for backports (#21851)
Co-authored-by: Steve Clark <steven.clark@hashicorp.com>
2023-07-14 12:09:55 +00:00
hc-github-team-secure-vault-core
f1ad714c40 Backport of Add additional debug output to TestCertStorageMetrics into release/1.13.x (#21809)
* backport of commit 8d74143872

* Add missing strings import

---------

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2023-07-13 13:38:55 +00:00
hc-github-team-secure-vault-core
7c8408e6af backport of commit e29842e49e (#21711)
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2023-07-10 13:55:12 +00:00
hc-github-team-secure-vault-core
e109339322 backport of commit 5b41148bfc (#21487) 2023-06-28 17:51:21 +00:00
hc-github-team-secure-vault-core
1333dfd96b backport of commit 7144523b83 (#21414)
Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-06-22 17:07:47 +00:00
hc-github-team-secure-vault-core
335623929b backport of commit 15aee2e0ba (#21397)
Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-06-21 21:07:15 +00:00
Alexander Scheel
2f634f7a11 Move OCSP/PKI interop test to PKI engine (#20273) (#21291)
This prevents SDK from having a circular import on the main Vault
package.

Manual backport due to import conflicts.

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-06-15 20:26:46 +00:00
hc-github-team-secure-vault-core
5f9638050f Backport of Telemetry Metrics Configuration. into release/1.13.x (#21070)
* backport of commit 2dd4528ed8

* Add missing documentation on cert metrics (#21073)

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

---------

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
Co-authored-by: Kit Haines <khaines@mit.edu>
Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-06-13 18:55:45 +00:00
hc-github-team-secure-vault-core
d59a1ed3c4 backport of commit daf72aa427 (#20901)
Removed byok test; this is unfortunate as it was the strongest
exerciser of this, but sadly it doesn't exist in 1.13 and previous
versions.

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-05-31 19:11:18 +00:00
hc-github-team-secure-vault-core
9ef24f6487 backport of commit 0ac2fa19aa (#20707)
Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-05-22 19:00:31 +00:00
hc-github-team-secure-vault-core
5e0cc29c11 pki: add subject key identifier to read key response (#20642) (#20658)
* pki: add subject key identifier to read key response

This will be helpful for the Terraform Vault Provider to detect
migration of pre-1.11 exported keys (from CA generation) into post-1.11
Vault.

* add changelog

* Update builtin/logical/pki/path_fetch_keys.go



* check for managed key first

* Validate the SKID matches on root CAs



* Validate SKID matches on int CAs



* Fix formatting of tests



---------

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
Co-authored-by: John-Michael Faircloth <fairclothjm@users.noreply.github.com>
Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-05-19 12:20:27 +00:00
hc-github-team-secure-vault-core
b7288016b6 backport of commit db5f416476 (#20649)
Co-authored-by: Hamid Ghaf <83242695+hghaf099@users.noreply.github.com>
2023-05-18 12:42:56 +00:00
hc-github-team-secure-vault-core
05ceaaf858 backport of commit c1d83da9b3 (#20463)
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2023-05-02 15:11:46 +00:00
hc-github-team-secure-vault-core
d492ca7017 Fix reading issuer's enable_aia_url_templating value (#20354) (#20358)
* Add enable_aia_url_templating to read issuer

This field was elided from read issuer responses, though the value
otherwise persisted correctly.



* Add comprehensive test for patching issuers



* Add changelog entry



---------

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-04-26 17:52:28 +00:00
hc-github-team-secure-vault-core
d63cc54647 backport of commit 464b9de169 (#20344)
Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-04-25 16:59:09 +00:00
hc-github-team-secure-vault-core
fc1bbf436f Backport of Add Configurable LDAP Max Page Size into release/1.13.x (#20283)
* Add Configurable LDAP Max Page Size (#19032)

* Add config flag for LDAP max page size

* Add changelog

* move changelog to correct file

* cleanup

* Default to non-paged searching for with -1

* Update website/content/api-docs/auth/ldap.mdx

Co-authored-by: Austin Gebauer <34121980+austingebauer@users.noreply.github.com>

* Update website/content/docs/auth/ldap.mdx

Co-authored-by: Austin Gebauer <34121980+austingebauer@users.noreply.github.com>

* Update tests

---------

Co-authored-by: Austin Gebauer <34121980+austingebauer@users.noreply.github.com>

* remove

---------

Co-authored-by: Luis (LT) Carbonell <lt.carbonell@hashicorp.com>
Co-authored-by: Austin Gebauer <34121980+austingebauer@users.noreply.github.com>
2023-04-20 17:07:15 -05:00
hc-github-team-secure-vault-core
73f821307e Minor follow-ups to #16865 (#20220) (#20222)
* Minor follow-ups to #16865

Fix PKI issuer upgrade logic when upgrading to 1.12 or later, to
actually turn off the issuer crl-signing usage when it intended to.

Fix minor typo in docs.

* changelog

Co-authored-by: Max Bowsher <maxbowsher@gmail.com>
2023-04-18 13:24:44 +00:00
hc-github-team-secure-vault-core
8a3c372f08 sdk/ldaputil: add connection_timeout configurable (#20144) (#20148)
* sdk/ldaputil: add connection_timeout configurable

* changelog

* Update doc

* Fix test

* Change default to 30s

Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>
2023-04-17 21:18:38 +00:00
hc-github-team-secure-vault-core
d7c9d2b3d4 backport of commit 249c472b5b (#20203)
Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-04-17 17:06:31 +00:00
hc-github-team-secure-vault-core
242d8f369b backport of commit b2e1ff5b7a (#20157)
Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-04-14 18:21:00 +00:00
hc-github-team-secure-vault-core
36559a79cd backport of commit 8fa560568a (#20178)
Co-authored-by: Kyle Schochenmaier <kschoche@gmail.com>
2023-04-14 17:52:01 +00:00
hc-github-team-secure-vault-core
3d84957788 backport of commit 5f8e67d8cd (#20090)
Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-04-11 18:31:06 +00:00
hc-github-team-secure-vault-core
5eae4ca14c backport of commit ee40ffc03f (#20074)
Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-04-11 14:08:19 +00:00
hc-github-team-secure-vault-core
cf51afab56 Backport of Add tests for PKI endpoint authentication via OpenAPI into release/1.13.x (#19713)
* Split (un,)authenticated issuer fetch endpoints

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

* Allow unauthed per-issuer unified-crl access

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

* Add tests to validate endpoint authentication status

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

---------

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-03-23 16:53:14 +00:00
hc-github-team-secure-vault-core
c7e83ef3aa backport of commit 94a6dca9d6 (#19648)
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2023-03-20 21:41:13 +00:00
hc-github-team-secure-vault-core
0b01f09eed Forward PKI revocation requests received by standby nodes to active node (#19624) (#19630)
* Forward PKI revocation requests received by standby nodes to active node

 - A refactoring that occurred in 1.13 timeframe removed what was
   considered a specific check for standby nodes that wasn't required
   as a writes should be returning ErrReadOnly.
 - That sadly exposed a long standing bug where the errors from the
   storage layer were not being properly wrapped, hiding the ErrReadOnly
   coming from a write and failing the request.

* Add cl

* Add test for basic PKI operations against standby nodes

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2023-03-20 16:50:04 +00:00
hc-github-team-secure-vault-core
4285eb5c54 backport of commit 77e80a8030 (#19617)
Co-authored-by: Raymond Ho <raymonstah@gmail.com>
2023-03-17 21:22:54 +00:00
hc-github-team-secure-vault-core
a0beacda37 Backport of add nil check for secret id entry on delete via accessor into release/1.13.x (#19351)
* backport of commit 8154be65a9

* empty commit to re-run tests

---------

Co-authored-by: davidadeleon <56207066+davidadeleon@users.noreply.github.com>
2023-02-24 16:33:37 -05:00
Michael Dempsey
0bacc16233 Add default to allowed values for algorithm_signer (#17894)
* Add default to allowed values for algorithm_signer

* Add possible values for algorithm signer in ui
2023-02-09 13:03:53 -05:00
Steven Clark
afd9e82e9b Add a comment around why we are grabbing a lock to update an atomic boolean (#19087) 2023-02-09 09:12:37 -05:00
Steven Clark
05e742b4ee Revert URL encoding OCSP GET fix #18938 (#19037)
- This fix was incorrect as now the tests and program are double
   URL encoding the OCSP GET requests, so the base64 + characters
   when using Vault proper are becoming space characters.
2023-02-08 11:24:26 -05:00
miagilepner
13caa0842e VAULT-8436 remove <-time.After statements in for loops (#18818)
* replace time.After with ticker in loops

* add semgrep rule

* update to use timers

* remove stop
2023-02-06 17:49:01 +01:00
Nick Cabatoff
192baa88db Make API not depend on SDK (#18962) 2023-02-06 09:41:56 -05:00
Steven Clark
576c12e2ec Use the unified CRL on local CRL paths if UnifiedCRLOnExistingPaths is set (#18989)
* Use the unified CRL on legacy CRL paths if UnifiedCRLOnExistingPaths is set

 - If the crl configuration option unified_crl_on_existing_paths is set
   to true along with the unified_crl feature, provide the unified crl
   on the existing CRL paths.
 - Added some test helpers to help debugging, they are being used by
   the ENT test that validates this feature.

* Rename method to shouldLocalPathsUseUnified
2023-02-03 14:38:36 -05:00
Alexander Scheel
780dcf1316 Use UTC for leaf exceeding CA's notAfter (#18984)
* Use UTC for leaf exceeding CA's notAfter

When generating a leaf which exceeds the CA's validity period, Vault's
error message was confusing as the leaf would use the server's time
zone, but the CA's notAfter date would use UTC. This could cause
user confusion as the leaf's expiry might look before the latter, due
to using different time zones. E.g.:

> cannot satisfy request, as TTL would result in notAfter
> 2023-03-06T16:41:09.757694-08:00 that is beyond the expiration of
> the CA certificate at 2023-03-07T00:29:52Z

Consistently use UTC for this instead.

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

* Add changelog entry

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

---------

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-02-03 17:00:42 +00:00
Steven Clark
f030cbc847 Fix race accessing b.crls within cert auth (#18945)
* Fix race accessing b.crls within cert auth

 - Discovered by CircleCI the pathLogin, pathLoginRenew paths access
   and reloads the b.crls member variable without a lock.
 - Also discovered that pathLoginResolveRole never populated an empty
   b.crls before usage within b.verifyCredentials

* Add cl

* Misc cleanup

 - Introduce a login path wrapper instead of repeating in all the
   various login methods the crl reloading
 - Cleanup updatedConfig, never returned an error and nothing looked at
   the error returned
 - Make the test within TestCRLFetch a little less timing sensitive as
   I was able to trigger a failure due to my machine taking more than
   150ms to load the new CRL
2023-02-01 16:23:06 -05:00
Steven Clark
b5f04147cb Apply URL encoding/unencoding to OCSP Get requests (#18938)
* Apply URL encoding/unencoding to OCSP Get requests

 - Missed this during development and sadly the unit tests were written
   at a level that did not expose this issue originally, there are
   certain combinations of issuer cert + serial that lead to base64
   data containing a '/' which will lead to the OCSP handler not getting
   the full parameter.
 - Do as the spec says, this should be treated as url-encoded data.

* Add cl

* Add higher level PKI OCSP GET/POST tests

* Rename PKI ocsp files to path_ocsp to follow naming conventions

* make fmt
2023-02-01 11:03:43 -05:00
Alexander Scheel
e4766aa974 Allow cleanup ssh dynamic keys host keys (#18939)
* Add ability to clean up host keys for dynamic keys

This adds a new endpoint, tidy/dynamic-keys that removes any stale host
keys still present on the mount. This does not clean up any pending
dynamic key leases and will not remove these keys from systems with
authorized hosts entries created by Vault.

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

* Add documentation

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

* Add changelog entry

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

---------

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-02-01 15:09:16 +00:00
Steven Clark
d34a4b6a2a Refactor an ENT test helper back to OSS to wait for updated CRLs within PKI tests (#18933)
- We had two separate helpers that were very close, one only in ENT, so unify them here in OSS.
2023-02-01 08:47:26 -05:00