Commit Graph

739 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
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
Andy Bao
4b456ffcec Fix OSS sealunwrapper adding extra get + put request to all storage get requests (#29050)
* fix OSS sealunwrapper adding extra get + put request to all storage requests

* Add changelog entry
2024-11-29 18:19:45 +01: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
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
akshya96
504227bd74 Storing local clients to local storage paths ce changes (#28958)
* storing local clients to local storage paths ce changes

* fix tests to be compatible with ce
2024-11-19 14:08:37 -08:00
divyaac
52ba156d47 Fix protoc issue (#28928) 2024-11-15 19:33:48 +00:00
divyaac
e21dfa6b1c Store global clients at separate storage paths (#28926) 2024-11-15 19:15:41 +00:00
Steven Clark
c3d5c1b3ec Update to Go 1.23.3 (#28920)
* Update to Go 1.23.3

 - Update to latest major version of Go 1.23.3 from 1.22.8.
 - Update github.com/sasha-s/go-deadlock to address deadlock timer
   issue we were seeing.
 - Fix one of our tests to only reset the member variable we change
   instead of the entire Opts parameter to avoid a data race during
   testing.

* Add workaround for MSSQL TLS certificate container issue
2024-11-15 13:32:09 -05: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
2e4a30f914 Fail sign/verify apis when Ed25519ph/ctx arguments are provided on CE (#28838) 2024-11-06 12:23:14 -05: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
miagilepner
41c0a3040b VAULT-31748: add removable node HA backend interface and raft implementation (#28726) 2024-10-30 18:19:49 +01:00
Theron Voran
8f1850baa3 sdk: updating to docker v27.2.1 (#28456)
Also update to vault-testing-stepwise v0.3.2
2024-10-17 14:14:35 -07: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
Scott Miller
bae00721d2 Dont add the error from validating via issuer signature if the subsequent verification from extraCas succeeds (#28597)
* Dont add the error from validating via issuer signature if the subsequent verification from extraCas succeeds

* changelog
2024-10-04 18:59:40 +00:00
Scott Miller
4515a016f7 Fix accidental debug logging in the OCSP helper client (#28450)
* Fix accidental debug logging in the OCSP helper client

* changelog
2024-09-23 18:17:11 +00: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
Theron Voran
ffb88e93ce sdk: update to docker v26.1.5 (#28269)
Updates to plugincontainer@v0.4.0 in sdk/, and
vault-testing-stepwise@v0.3.1 in root, which updates vault/sdk and
vault itself to docker v26.1.5.
2024-09-05 15:51:25 +00:00
Mike Palmiotto
6069e665c0 sdk: go mod tidy (#28290) 2024-09-05 15:24:02 +00: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
Paul Banks
bb5f658c57 Allow explicit metric registration. Fixes #11732 (#27966)
* Register ha timing metrics. Fixes #11732

* Add CHANGELOG

* Fix copywrite headers

* Relicence SDK files after move

* Update vault/ha.go
2024-08-30 14:54:57 +00:00
vinay-gopalan
ec9b675f70 Add OSS stub functions for Self-Managed Static Roles (#28199) 2024-08-29 10:01:01 -07:00
kpcraig
dc81de7ec8 Easy go-jose updates (the codeless[ish] ones) (#28140) 2024-08-21 14:25:07 -04:00
gkoutsou
255db7aab1 Add ENVs using NewTestDockerCluster (#27457)
* Add ENVs using NewTestDockerCluster

Currently NewTestDockerCluster had no means for setting any
environment variables. This makes it tricky to create test
for functionality that require thems, like having to set
AWS environment variables.

DockerClusterOptions now exposes an option to pass extra
enviroment variables to the containers, which are appended
to the existing ones.

* adding changelog

* added test case for setting env variables to containers

* fix changelog typo; env name

* Update changelog/27457.txt

Co-authored-by: akshya96 <87045294+akshya96@users.noreply.github.com>

* adding the missing copyright

---------

Co-authored-by: akshya96 <87045294+akshya96@users.noreply.github.com>
2024-08-16 13:18:47 -07:00
akshya96
9e4bc33d5e bumping versions for grpc and docker/docker (#28071)
* bumping versions for grpc and docker/docker

* go get github.com/docker/docker@v25.0.6 && go mod tidy

* updating to 25.0.6 in sdk

* updating grpc in sdk
2024-08-14 14:24:15 -07:00
John-Michael Faircloth
3fcb1a67c5 database/postgres: add inline certificate authentication fields (#28024)
* add inline cert auth to postres db plugin

* handle both sslinline and new TLS plugin fields

* refactor PrepareTestContainerWithSSL

* add tests for postgres inline TLS fields

* changelog

* revert back to errwrap since the middleware sanitizing depends on it

* enable only setting sslrootcert
2024-08-09 14:20:19 -05:00
Peter Wilson
1af9819744 add iptables (#28031) 2024-08-08 11:59:26 +00:00
John-Michael Faircloth
899ebd4aff db/postgres: add feature flag protected sslinline configuration (#27871)
* adds sslinline option to postgres conn string
* for database secrets type postgres, inspects the connection string for sslinline and generates a tlsconfig from the connection string.

* support fallback hosts

* remove broken multihost test

* bootstrap container with cert material

* overwrite pg config and set key file perms

* add feature flag check

* add tests

* add license and comments

* test all ssl modes

* add test cases for dsn (key/value) connection strings

* add fallback test cases

* fix error formatting

* add test for multi-host when using pgx native conn url parsing

---------

Co-authored-by: Branden Horiuchi <Branden.Horiuchi@blackline.com>
2024-08-01 11:43:54 -05:00
Steven Clark
7049424c16 Allow SignCert callers to override CSR signature checks (#27914)
- We are leveraging this new feature flag to ignore the CSR's
   signature as we are constructing a CSR based on the information
   from a CMPv2 message.
2024-07-30 12:20:10 -04:00
idnandre
e26c246cbb chore: fix deprecated ioutil readall (#27823)
Signed-off-by: idnandre <andre@idntimes.com>
2024-07-30 09:18:24 -04:00
Peter Wilson
815a0759f7 Update go.mod and sdk/go.mod to Go 1.22 (#27771)
* Update go.mod and sdk/go.mod to Go 1.22

* manually bump the import and re-go-mod-tidy
2024-07-15 09:24:53 +01:00
Steven Clark
054f5b182a Return the proper serial number in OCSP verification errors (#27696)
* Return the proper serial number in OCSP verification errors

 - We returned the issuer's certificate number instead of the serial
   number of the actual certificate we validated from an OCSP request.

 - The problematic serial number within the error are never shown
   currently in Vault. The only user of this library is cert-auth
   which swallows errors around revoked certificates and returns
   a boolean false instead of the actual error message.

* Add cl

* Use previously formatted serial in error msg
2024-07-09 09:03:34 -04:00
Violet Hynes
fd884ad1a0 Removal of go-testing-interface (CE changes) (#27578)
* Removal of go-testing-interface CE changes

* CE only fine

* Changelog

* Changelog
2024-07-04 11:09:41 -04:00
Violet Hynes
62e6b062f0 VAULT-28422 SDK upversion for go-retryablehttp (#27612) 2024-06-26 11:25:55 -04:00
AvivGuiser
3372a9b4db secrets/database: Add usePrivateIP field for cloudsql postgresql instances (#26828)
* add usePrivateIP params to determine if to use private ip dial option

Signed-off-by: aviv guiser <avivguiser@gmail.com>

* fix the connection_producer.go in mysql plugin

Signed-off-by: aviv guiser <avivguiser@gmail.com>

* Update sdk/database/helper/connutil/sql.go

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

---------

Signed-off-by: aviv guiser <avivguiser@gmail.com>
Signed-off-by: AvivGuiser <aviv.guiser@placer.ai>
Co-authored-by: Robert <17119716+robmonte@users.noreply.github.com>
2024-06-25 14:17:13 -05:00
Mike Palmiotto
027888be73 sdk: Bump grpc version to 1.64.0 (#27532) 2024-06-18 15:41:45 -04:00
Steven Clark
d152de025d Pin generated proto files to 1.34.2 (#27438) 2024-06-11 12:29:45 -04:00
Ryan Cragun
1c4aa5369e proto: rebuild with the latest protoc-gen-go (#27331)
Signed-off-by: Ryan Cragun <me@ryan.ec>
2024-06-03 12:02:02 -06:00
Rémi Lapeyre
f8eb0154d4 Fix case handling in policyutil.EquivalentPolicies() (#16484)
The previous logic would consider not normalize casing before comparing
the policy names which meant that a token associated to a policy with
an uppercase could not be renewed for the following auth methods:

  - AppID
  - Cert
  - GitHub
  - LDAP
  - Okta
  - Radius
  - Userpass

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-05-31 09:58:03 -04:00
Rachel Culpepper
0b02c5d56c Fix ed25519 key type in ca_util (#27093)
* fix ed25519 key type

* add changelog

* fix other case and add tests

* add other test

* add headers
2024-05-22 09:27:45 -05:00
Steven Clark
e9f9e7d7f0 Do not generate HMAC keys for CMAC keys on calls to Upgrade (#27156)
* Do not generate HMAC keys for CMAC keys on calls to Upgrade

 - Missed during the initial development of the Transit CMAC feature,
   on initial key creation we did not generate HMAC keys when the key
   type was CMAC. The call to the policy's Upgrade function though
   would treat this key as requiring an upgrade and add one back.
 - Fix this by adding an HMACSupported argument and verifying
   on upgrade for HMAC creation that the key type supports HMAC
 - Add generic test that verifies we aren't changing a key type iota
   value, string it defined and the proper operation of HMACSupported
   and CMACSupported functions

* Add warning to test variable
2024-05-21 16:12:01 +00:00
Violet Hynes
7ac5358185 VAULT-26300 update golang/net to 0.25.0 in sdk (#27041) 2024-05-15 11:30:00 -04:00
Peter Wilson
4fbe7d9665 updated protobuf dependency to v1.34.1 in main go.mod and sdk/go.mod (#27030) 2024-05-15 09:36:50 -04:00
Peter Wilson
f89531759d SDK: updated github.com/jackc/pgx/v4 dependency to 4.18.3 (#27005) 2024-05-14 14:04:52 +01:00
Violet Hynes
b5d3c213bb Update docker to v25.0.5+incompatible (#26953)
* Update docker to v26.1.2+incompatible

* go mod tidy

* Some docker updates

* Update to 25.0.5 instead

* Fix go.mod weirdness
2024-05-13 11:34:17 -04:00
Mike Palmiotto
080780b497 Add a TraceID for forwarded request tracing (#26939) 2024-05-10 17:04:01 +00:00
Mike Palmiotto
9c61738c63 Wrap overloaded errors from the WAL backend (#26928)
This PR adds the CE plumbing to expose underyling ErrOverloaded errors.
The wrapper allows the HTTP layer to correctly assign 503 status codes
in responses.
2024-05-10 09:43:39 -04:00
Mike Palmiotto
2d75711019 make proto 1.34.1 (#26856) 2024-05-07 14:33:18 +00:00