Commit Graph

2799 Commits

Author SHA1 Message Date
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
Victor Rodriguez
31fc51c68f Perform validation when issuing or signing certificates. (#28921)
Add environment variable VAULT_DISABLE_ISSUING_VERIFICATION.

Setting VAULT_DISABLE_ISSUING_VERIFICATION=true will disable the cert
issuance/signing verification.
2024-11-27 13:23:07 +00:00
kpcraig
71c2121317 Okta Dep Update (#28121)
Update okta to use v5 sdk instead of v2
---------

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
2024-11-26 15:33:45 -05:00
JMGoldsmith
b9d0b7aeb4 VAULT-31525 Remove lowercasing of RADIUS auth. (#28884)
* remove strings package, add test case, remove lowercasing of username

* adding changelog

* Update changelog/28884.txt

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

---------

Co-authored-by: John-Michael Faircloth <fairclothjm@users.noreply.github.com>
2024-11-22 10:25:25 +01:00
Rachel Culpepper
a0ceaf6772 Add ml-dsa key type and stubs (#28961)
* add ml-dsa key type and stubs

* add in sdk changes

* ent breakout

* fix private key func and run go mod tidy

* change function name

* tidy go.mod

---------

Co-authored-by: Scott G. Miller <smiller@hashicorp.com>
2024-11-20 15:57:00 -06:00
JMGoldsmith
3f62ae702b VAULT-31594 Add debug level logging to the LDAP auth library (#28881)
* initial commit of debug  error handling

* adding changelog
2024-11-18 12:48:59 +01:00
divyaac
52ba156d47 Fix protoc issue (#28928) 2024-11-15 19:33:48 +00:00
Steven Clark
95a16dbafe PKI: Add a new leaf_not_after_behavior value to force erroring in all circumstances (#28907)
* PKI: Add a new leaf_not_after_behavior value to force erroring in all circumstances

 - We introduce a new value called `always_enforce_err` for the existing
   leaf_not_after_behavior on a PKI issuer. The new value will force we
   error out all requests that have a TTL beyond the issuer's NotAfter value.

 - This will apply to leaf certificates issued through the API as did err,
   but now to CA issuance and ACME requests for which we previously changed
   the err configuration to truncate.

* Add cl

* Update UI test

* Fix changelog type
2024-11-15 11:59:54 -05:00
Steven Clark
0adf2664b6 secrets/ssh: Return the allow_empty_principals field in read api (#28901)
* secrets/ssh: Return the allow_empty_principals field in read api

 - Return the new field in the read response api and add a test case
   that will catch these errors in the future of adding a field to
   the ssh role and not returning it in the read api response

* Add cl
2024-11-13 12:49:51 -05:00
Steven Clark
68413ad058 Pull versioned golang images in Zlint testsuite to avoid pulling with latest (#28855)
* Pull versioned golang images in Zlint testsuite to avoid pulling with latest

 - Leverage the versioned golang images which should be more static avoiding
   issues we somtimes encounter pulling latest images from our docker mirror.
 - We use the golang runtime version to avoid having to update this test
   continuously.

* Fallback to latest if the version tag isn't a release tag
2024-11-07 14:04:45 -05:00
Steven Clark
2e4a30f914 Fail sign/verify apis when Ed25519ph/ctx arguments are provided on CE (#28838) 2024-11-06 12:23:14 -05:00
Steven Clark
752bb08664 Transit: fix race in the key update api (#28839)
- The key update API would release the lock a little too early
   after it persisted the update so the reference could be updated
   when it was preparing the response to the caller across updates
   and/or key rotations
 - The storage updates were okay, just the response back to the caller
   of the update might see a mixture of different updates
2024-11-05 14:41:09 -05:00
Victor Rodriguez
c855f6e982 Fix bug setting PKI issuer enable_aia_url_templating to be set to false (#28832)
Fix bug setting PKI issuer enable_aia_url_templating to be set to false.
2024-11-04 20:51:01 +00:00
Victor Rodriguez
d99ade20be Add PKI issuer config fields to enable check disablement parameters (#28826)
Add PKI issuer config fields to enable check disablement parameters.

Add the following new configuration fields for issuers:
  * allow_disable_critical_extension_checks
  * allow_disable_path_length_checks
  * allow_disable_name_checks
  * allow_disable_name_constraint_checks
2024-11-04 11:46:55 -05:00
miagilepner
10bd15f956 VAULT-30877: Repopulate AWS static creds queue in initialize (#28775)
* populate rotation queue in initialize

* docs, changelog

* add t.Helper()
2024-11-04 09:32:14 -06:00
Steven Clark
e489631e87 Transit: Allow ENT only arguments for sign/verify. Add docs for new Ed25519 signature types (#28821) 2024-11-01 12:57:52 -04:00
Steven Clark
bce085bd3f Fix issue building urls with IPv6 IPs for ACME http-01 challenges (#28718)
* Fix ACME http-01 challenges for IPv6 IPs

 - We weren't properly encapsulating the IPv6 IP within the url provided
   to the http client with [].

* Add cl

* Cleanup a test println
2024-10-16 14:26:44 -04:00
Rachel Culpepper
9795c05d97 add error info to internal error (#28714) 2024-10-15 17:16:57 +00:00
Scott Miller
a0af792437 Adds ACME specific error types to errors returned by challenge validation functions. (#28678)
* wip

* Change test expectation

* changelog

* remove ultimately unnecessary changes

* adjust unit test again
2024-10-15 17:13:13 +00:00
Scott Miller
004dfc49f8 Add a max_crl_size parameter to CRL config (#28654)
* wip

* Unit test the CRL limit, wire up config

* Bigger error

* API docs

* wording

* max_crl_entries, + ignore 0 or < -1 values to the config endpoint

* changelog

* rename field in docs

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

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

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

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

---------

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2024-10-09 21:38:55 +00:00
Scott Miller
3c0656e4c4 Update marcellanz/transit_pkcs1v15 RSA encryption support (#25486)
* [transit-pkcs1v15] transit support for the pkcs1v15 padding scheme – without UI tests (yet).

* [transit-pkcs1v15] renamed padding_scheme parameter in transit documentation.

* [transit-pkcs1v15] add changelog file.

* [transit-pkcs1v15] remove the algorithm path as padding_scheme is chosen by parameter.

* Update ui/app/templates/components/transit-key-action/datakey.hbs

Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>

* Update ui/app/templates/components/transit-key-action/datakey.hbs

Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>

* Update ui/app/templates/components/transit-key-action/datakey.hbs

Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>

* Update website/content/api-docs/secret/transit.mdx

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

* Update website/content/api-docs/secret/transit.mdx

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

* Update website/content/api-docs/secret/transit.mdx

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

* Add warnings to PKCS1v1.5 usage

* Update transit

* Update transit, including separating encrypt/decrypt paddings for rewrap

* Clean up factory use in the presence of padding

* address review feedback

* remove defaults

* lint

* more lint

* Some fixes for UI issues

 - Fix padding scheme dropdown console error by adding values
   to the transit-key-actions.hbs
 - Populate both padding scheme drop down menus within rewrap,
   not just the one padding_scheme
 - Do not submit a padding_scheme value through POST for non-rsa keys

* Fix Transit rewrap API to use decrypt_padding_scheme, encrypt_padding_scheme

 - Map the appropriate API fields for the RSA padding scheme to the
   batch items within the rewrap API
 - Add the ability to create RSA keys within the encrypt API endpoint
 - Add test case for rewrap api that leverages the padding_scheme fields

* Fix code linting issues

* simply padding scheme enum

* Apply suggestions from code review

Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>

* Fix padding_scheme processing on data key api

 - The data key api was using the incorrect parameter name for
   the padding scheme
 - Enforce that padding_scheme is only used on RSA keys, we
   are punting on supporting it for managed keys at the moment.

* Add tests for parsePaddingSchemeArg

* Add missing copywrite headers

* Some small UI fixes

* Add missing param to datakey in api-docs

* Do not send padding_scheme for non-RSA key types within UI

* add UI tests for transit key actions form

---------

Co-authored-by: Marcel Lanz <marcellanz@n-1.ch>
Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>
Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>
Co-authored-by: Steve Clark <steven.clark@hashicorp.com>
Co-authored-by: claire bontempo <cbontempo@hashicorp.com>
2024-10-09 09:30:14 -05:00
Ryan Cragun
b6145bc3bb protobuf: rebuild protos with protobuf 1.35.1 (main) (#28617)
* protobuf: rebuild protos with protobuf 1.35.1
* protobuf: unpin protoc-gen-go-grpc on main

Signed-off-by: Ryan Cragun <me@ryan.ec>
2024-10-07 14:54:51 -06:00
Steven Clark
0687353788 Cleanup some duplication in the PKI tidy response field definitions (#28614) 2024-10-07 16:20:57 -04:00
Guillermo Barroso
aeca0cdee6 secrets/aws: add sts_region parameter to root config (#22726)
* Set region parameter to be used for STS only on AWS secrets engine

* Add changelog

* Fix formatting

* region fix when not setting iam_endpoint or sts_endpoint

* Add 'sts_region' parameter for AWS secrets engine.

* Update TestBackend_PathConfigRoot for aws secrets

* Update changelog entry

---------

Co-authored-by: Robert <17119716+robmonte@users.noreply.github.com>
2024-10-04 18:33:09 +00:00
Steven Clark
7efc1af5d0 Do not acquire a read lock twice on tidyStatusLock during tidy-status api call. (#28556) 2024-10-02 08:58:05 -04:00
Steven Clark
32d09a72f8 Update PKI tests to leverage the tidy-status test helper (#28531)
- I have a suspicion the for loop with the timer can be infinite loops
   in certain circumstances. Instead leverage the normal test helpers
   for fetching tidy status
2024-10-01 14:22:15 -04:00
Steven Clark
2db2a9fb5d PKI: Track last time auto tidy was run across restarts (#28488)
* Track the last PKI auto-tidy time ran for use across nodes

 - If the interval time for auto-tidy is longer then say a regularly
   scheduled restart of Vault, auto-tidy is never run. This is due to
   the time of the last run of tidy is only kept in memory and
   initialized on startup to the current time
 - Store the last run of any tidy, to maintain previous behavior, to
   a cluster local file, which is read in/initialized upon a mount
   initialization.

* Add auto-tidy configuration fields for backing off at startup

* Add new auto-tidy fields to UI

* Update api docs for auto-tidy

* Add cl

* Update field description text

* Apply Claire's suggestions from code review

Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>

* Implementing PR feedback from the UI team

* remove explicit defaults and types so we retrieve from backend, decouple enabling auto tidy from duration, move params to auto settings section

---------

Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>
Co-authored-by: claire bontempo <cbontempo@hashicorp.com>
2024-09-26 09:47:11 -04:00
Luis (LT) Carbonell
b861d8b03f Fix Issue with Lost Timezone in Metadata for Database Secret Engines (#28509)
* Set cron schedule location after pulling from storage

* Add changelog
2024-09-25 18:40:50 -04:00
Kit Haines
5da8750a93 Split the Key_Usage Field into separate fields (#28500)
* Split the Key_Usage Field into separate fields - one for the Cert
Endpoints (Sign-intermediate/Generate Root) the other for the CSR
Endpoint (intermediate generate).  These have different defaults,
and descriptions.

* Fix schema test.
2024-09-24 15:35:24 -04:00
Scott Miller
12f03b073a Make reception of an empty valid principals configurable based on a role flag. (#28466)
* Make reception of an empty valid principals configurable based on a role flag.

Adds allow_empty_principals, which if true allows valid_principals on credential generation calls
to be empty.

* changelog

* Allow empty principals on unrelated unit test

* whitespace
2024-09-23 17:20:11 -05:00
Luis (LT) Carbonell
7c1a83422b Improve Error Handling for Missing Credentials in AppRole and UserPass (#28441)
* Return invalid credentials for missing login parameters (400 vs 500)

* Add changelog

* Update test
2024-09-23 10:55:20 -04:00
Rachel Culpepper
978b3aee52 add ce changes and documentation for tidying cmpv2 nonce store (#28362)
* add ce changes and documentation for tidying cmpv2 nonce store

* add build tag

* fix test failures

* fix backend test
2024-09-12 11:32:51 -05:00
JMGoldsmith
cc38383732 VAULT-30694 Adding a check for nil values returned by the queue (#28330)
* adding a check for nil values returned by the queue

* adding changelog

* changing to be more idiomatic

* fixing error message to be a bit more clear

* reverting change to error handling

* Update builtin/logical/aws/path_static_roles.go

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

---------

Co-authored-by: John-Michael Faircloth <fairclothjm@users.noreply.github.com>
2024-09-12 17:26:46 +02:00
Scott Miller
cda20e39b1 Ferry ocsp_ca_certificates over the OCSP ValidationConf (#28309)
* Ferry ocsp_ca_certificates over the OCSP ValidationConf

* changelog

* First check issuer, then check extraCAS

* Use the correct cert when the signature validation from issuer succeeds

* Validate via extraCas in the cert missing case as well

* dedupe logic

* remove CA test
2024-09-11 09:57:27 -05:00
Steven Clark
789f9b7821 Add missing revocation storage lock on RevokeCert refactoring (#28259)
* Add missing revocation storage lock on RevokeCert refactoring

* Refactor internal PKI revocation API

 - Process the odd logical.Response/error returns internally to make
   the returns better consumable from other users.
 - Leverage the GetConfigWithUpdate to fetch the current CRL config, otherwise we can use older or nil configs.
2024-09-03 17:18:30 -04:00
Kit Haines
edf6851eb4 Key Usage Enablement for Ent-Feature CMPv2 (#28237)
* Key Usage Enablement for Ent-Feature CMPv2
2024-08-30 17:05:20 +00:00
vinay-gopalan
b6015de314 add oss check on tests (#28226) 2024-08-29 20:05:54 +00:00
vinay-gopalan
ec9b675f70 Add OSS stub functions for Self-Managed Static Roles (#28199) 2024-08-29 10:01:01 -07:00
Scott Miller
747b395da5 Revocation RevokerFactory interface, CE changes (#28203) 2024-08-27 21:35:11 +00:00
Steven Clark
5d4ea2f4fa Add retry logic to building zlint test container (#28167)
- Sometimes we are failing to pull the zlint tagged version from
   GitHub when building up the test containers. Add a simple retry
   around the container building step to see if this resolves the
   issue.
2024-08-23 08:33:21 -04:00
davidadeleon
fe44e55943 VAULT-29784: Skip connection verification on DB config read (#28139)
* skip connection verification on config read

* ensure appropriate default on config update call that results in a creation

* changelog

* leave verify_connection in config read response

* update test to handle output of verify_connection parameter

* fix remaining tests
2024-08-21 16:43:37 -04:00
kpcraig
dc81de7ec8 Easy go-jose updates (the codeless[ish] ones) (#28140) 2024-08-21 14:25:07 -04:00