Commit Graph

696 Commits

Author SHA1 Message Date
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
Mike Palmiotto
d4a046820d AOP: Add NeverDrop request priority (enterprise) (#26745)
This PR introduces the CE plumbing for a new high WritePriority, meant
to bypass rejection from the AOP write controller. We attach this
priority to any request on a sudo path, such that administrators can
still perform necessary operations during an overload.
2024-05-01 15:45:34 -04:00
Mike Palmiotto
c5fac98d2d AOP: Force reject header (enterprise) (#26702)
This PR introduces the CE plumbing for a new HTTP header, called
X-Vault-AOP-Force-Reject, which will force any associated request to
reject storage writes as if Vault were overloaded.

This flag is intended to test end-to-end functionality of write
rejection in Vault. This is specifically useful for testing 503 -
Service Unavailable HTTP response codes during load shedding.
2024-05-01 14:11:24 -04:00
Ryan Cragun
5d763ac052 proto: rebuild with the latest protoc-gen-go (#26698)
Signed-off-by: Ryan Cragun <me@ryan.ec>
2024-04-30 13:05:49 -06:00
Paul Banks
c839854483 Overload error support for Adaptive Overload Protection (Enterprise) (#26688)
* Overload error support for Enterprise

* Remove TODO comment
2024-04-29 22:11:23 +01:00
miagilepner
46cd5bbf32 VAULT-24582: Refactor precomputed query worker to support ACME regeneration (#26364)
* refactor and add tests

* fix write options

* forgot that this endpoint was testonly

* refactor the refactor

* fix test failures and rename variable
2024-04-29 14:28:37 +02:00
Violet Hynes
b896dc1610 VAULT-24437 Address OpenAPI endpoint ignoring redact_version listener parameter (#26607)
* VAULT-24437 Address OpenAPI endpoint ignoring redact_version listener parameter

* VAULT-24437 changelog

* VAULT-24437 changelog mistake
2024-04-24 12:16:55 -04:00
Rachel Culpepper
d2aad917bb vault-24958: add cmac key types for import and export (#26610)
* add cmac key types to export

* set rsa public key and add cmac key types for wrapping

* add cmac types to import and export

* add cmac export key type

* fix import key type

* add cmac to policy import

* add enterprise checks

* fix imports
2024-04-24 08:13:19 -05:00
Steven Clark
ff500ca1c3 Add Transit CMAC stubs in CE (#26552) 2024-04-22 13:19:04 -04:00
Rachel Culpepper
9ebcbf6a0c vault-24597: add key types and key creation for CMAC (#25967)
* add key types for cmac for transit key creation

* add test for key creation

* fix test logic and add cases

* fix logic for hmac

* add go doc

* fix key size and add check for HMAC key
2024-04-19 09:39:59 -05:00
Violet Hynes
85ed817034 VAULT-20405 chunk decompression to prevent loading full decompressed data into memory at once (#26464)
* VAULT-20405 chunk decompression to prevent loading full decompressed data into memory at once

* Add changelog
2024-04-18 10:13:56 -04:00
Christopher Swenson
961bf20bdb Use enumer to generate String() methods for most enums (#25705)
We have many hand-written String() methods (and similar) for enums.
These require more maintenance and are more error-prone than using
automatically generated methods. In addition, the auto-generated
versions can be more efficient.

Here, we switch to using https://github.com/loggerhead/enumer, itself
a fork of https://github.com/diegostamigni/enumer, no longer maintained,
and a fork of the mostly standard tool
https://pkg.go.dev/golang.org/x/tools/cmd/stringer.
We use this fork of enumer for Go 1.20+ compatibility and because
we require the `-transform` flag to be able to generate
constants that match our current code base.

Some enums were not targeted for this change:
2024-04-17 11:14:14 -07:00
John-Michael Faircloth
1ee302dfcd plugin/wif: support external plugins (#26384)
* plugin/wif: support external plugins

* changelog
2024-04-12 21:16:26 +00:00
John-Michael Faircloth
b01edee904 sdk: prepare for release (#26348)
* sdk: prepare for release

* remove toolchain
2024-04-11 09:50:58 -05:00
Peter Wilson
3dc16db87e VAULT-24798: audit - improve error messages (#26312)
* audit: remove 'op' from error messages and do some clean up

* Allow early error checking to be concerned with vault/Core vs. audit
2024-04-11 09:09:32 +01:00
Luis (LT) Carbonell
751ebeb065 add deadlock detection in barrier and sealwrap (#26198)
* add deadlock detection in barrier and sealwrap
2024-04-09 14:56:57 +00:00
John-Michael Faircloth
7d575bf979 auth/ldap: fix login errors (#26200)
* auth/ldap: fix login errors

This fixes 2 ldap auth login errors

* Missing entity alias attribute value
  * Vault relies on case insensitive user attribute keys for mapping user
    attributes to entity alias metadata. This sets the appropriate
    configs in the cap library.

* ldap group search anonymous bind regression
  * Anonymous group searches can be rejected by some LDAP servers if
    they contain a userDN. This sets the configs in the cap library to
    specify unauthenticated binds for anonymous group searches should
    exclude a DN.

Closes https://github.com/hashicorp/vault/issues/26171
Closes https://github.com/hashicorp/vault/issues/26183

* changelog

* go mod tidy

* go get cap/ldap@latest and go mod tidy
2024-03-28 13:45:43 -05:00
Paul Banks
c605d1a846 Plumbing to support mount table path registration (#26176) 2024-03-27 13:25:31 +00:00
Violet Hynes
da00addcb6 VAULT-20396 Add limit of 100,000 to string templates (#26110)
* VAULT-20396 Add size limit to sdk string templates

* VAULT-20396 wording changes

* VAULT-20396 changelog
2024-03-25 10:04:12 -04:00
BiKangNing
f8ad26c89f chore: fix function names (#26087)
Signed-off-by: depthlending <bikangning@outlook.com>
Co-authored-by: Chris Capurso <1036769+ccapurso@users.noreply.github.com>
2024-03-22 12:43:01 -04:00
Steven Clark
2fe676e75b Validate OCSP response is signed by expected issuer (#26091)
* Validate OCSP response is signed by expected issuer and serial number matches request

 - There was a bug in the OCSP response signature logic, it properly
   verified but kept around the ocspRes object around so we ignored
   the errors found and passed the response object back up the stack.
 - Now extract the verification logic into a dedicated function, if
   it returns an error, blank the ocspRes response as we can't trust it.
 - Address an issue that the OCSP requests from multiple servers were
   clobbering each others responses as the index loop variable was not
   properly captured.
 - Add a missing validation that the response was for the serial number
    we requested

* Add cl
2024-03-22 09:28:02 -04:00
Paul Banks
3a2a922b26 Raft config refactor for mount entry size limit (#25992)
* CE parts for mount-namespace entry limit

* Remove redundant code from refactor

* Add doc comment note about ent-only use of interface

* Add CHANGELOG
2024-03-19 17:28:23 +00:00
Steven Clark
6fca34eace Proceed with cert auth login attempts if ocsp_fail_open is true and servers are unreachable (#25982) 2024-03-19 10:39:37 -04:00
Steven Clark
5785191067 Support OCSP responses without NextUpdate field set (#25912)
* Support OCSP responses without a NextUpdate value set

 - Validate that the ThisUpdate value is
   properly prior to our current time and
   if NextUpdate is set that, ThisUpdate is
   before NextUpdate.
 - If we don't have a value for NextUpdate just compare against ThisUpdate.

* Add ocsp_this_update_max_ttl support to cert auth

 - Allow configuring a maximum TTL of the OCSP response based on the
   ThisUpdate time like OpenSSL does
 - Add test to validate that we don't cache OCSP responses with no NextUpdate

* Add cl

* Add missing ` in docs

* Rename ocsp_this_update_max_ttl to ocsp_this_update_max_age

* Missed a few TTL references

* Fix error message
2024-03-18 18:12:37 -04:00
Steven Clark
94d42235cf Address OCSP client caching issue (#25986)
* Address OCSP client caching issue

 - The OCSP cache built into the client that is used by cert-auth
   would cache the responses but when pulling out a cached value the
   response wasn't validating properly and was then thrown away.

 - The issue was around a confusion of the client's internal status
   vs the Go SDK OCSP status integer values.

 - Add a test that validates the cache is now used

* Add cl

* Fix PKI test failing now due to the OCSP cache working

 - Remove the previous lookup before revocation as now the OCSP
   cache works so we don't see the new revocation as we are actually
   leveraging the cache
2024-03-18 19:11:14 +00:00
dependabot[bot]
7834f45197 Bump github.com/jackc/pgx/v4 from 4.18.1 to 4.18.2 in /sdk (#25888)
* Bump github.com/jackc/pgx/v4 from 4.18.1 to 4.18.2 in /sdk

Bumps [github.com/jackc/pgx/v4](https://github.com/jackc/pgx) from 4.18.1 to 4.18.2.
- [Changelog](https://github.com/jackc/pgx/blob/v4.18.2/CHANGELOG.md)
- [Commits](https://github.com/jackc/pgx/compare/v4.18.1...v4.18.2)

---
updated-dependencies:
- dependency-name: github.com/jackc/pgx/v4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* go mod tidy

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Peter Wilson <peter.wilson@hashicorp.com>
2024-03-15 18:04:40 +00:00
dependabot[bot]
674f7b4fc9 Bump github.com/jackc/pgproto3/v2 from 2.3.2 to 2.3.3 in /sdk (#25962)
* Bump github.com/jackc/pgproto3/v2 from 2.3.2 to 2.3.3 in /sdk

Bumps [github.com/jackc/pgproto3/v2](https://github.com/jackc/pgproto3) from 2.3.2 to 2.3.3.
- [Commits](https://github.com/jackc/pgproto3/compare/v2.3.2...v2.3.3)

---
updated-dependencies:
- dependency-name: github.com/jackc/pgproto3/v2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* go mod tidy

* go mod tidy

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Peter Wilson <peter.wilson@hashicorp.com>
2024-03-15 16:29:20 +00:00
divyaac
74abae6f01 Added Invalid Token Error Message that will be returned for bad tokens (#25953)
Edited changelog

Added dummy policy to CE file to make tests pass

Added changelog
2024-03-14 11:15:20 -07:00
suchsoon
f86e3d4a68 remove repetitive words (#25860)
Signed-off-by: suchsoon <silverjadebeauty@gmail.com>
2024-03-13 18:44:54 +00:00
dependabot[bot]
47abad7fde Bump github.com/opencontainers/runc from 1.1.6 to 1.1.12 in /sdk (#25158)
Bumps [github.com/opencontainers/runc](https://github.com/opencontainers/runc) from 1.1.6 to 1.1.12.
- [Release notes](https://github.com/opencontainers/runc/releases)
- [Changelog](https://github.com/opencontainers/runc/blob/v1.1.12/CHANGELOG.md)
- [Commits](https://github.com/opencontainers/runc/compare/v1.1.6...v1.1.12)

---
updated-dependencies:
- dependency-name: github.com/opencontainers/runc
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mickael-hc <86245626+mickael-hc@users.noreply.github.com>
Co-authored-by: Chris Capurso <1036769+ccapurso@users.noreply.github.com>
2024-03-12 09:51:44 -04:00
Rachel Culpepper
a1d72f2426 Vault-22903: add option to disable TLS in test clusters (#25764)
* add option to disable TLS in test clusters

* add nil check

* change nil check

* fix cluster_addr
2024-03-11 11:59:36 -05:00
Ryan Cragun
981aeabab0 lint: fix proto delta and simports (#25825)
Signed-off-by: Ryan Cragun <me@ryan.ec>
2024-03-07 18:10:51 +00:00
divyaac
c467620740 Redacted Information With Valid Token (#25735) 2024-03-01 13:20:31 -05:00
Marc Boudreau
c37978395f fix VAULT-24372 (#25639)
* fix VAULT-24372

* use redaction settings in context to redact values in sys/leader

* add tests to check redaction in GetLeaderStatus and GetSealStatus

* add ENT badge to sys/config/ui/custom-messages api-docs page in ToC

* remove unrelated change to website ToC
2024-02-28 14:34:55 -05:00
Mike Palmiotto
b54ac98a0b Move Request Limiter to enterprise (#25615) 2024-02-27 16:24:06 -05:00
Austin Gebauer
df57ff46ff Add stubs for plugin WIF (#25657)
* Add stubs for plugin wif

* add header to sdk file

* drop changelog to move it

* fix test
2024-02-27 12:10:43 -08:00
divyaac
3132592c19 Added exponential backoff (#25497)
* Applied Patch

* Added changelog

* Edited changelog

* Added constants to be shared

* Edited changelog verbage

* Removed copy and paste error

* Moved the constants

* Fixed static checks
2024-02-20 11:42:59 -08:00
Nick Cabatoff
b5cbc8b986 Add replication.SetCorePerf to create a ReplicationSet using NewTestCluster (#25381) 2024-02-16 09:00:47 -05:00
Hamid Ghaf
a4be0c940c vault-23135 - fix modify storage keys ending with .temp causes overwr… (#25395)
* vault-23135 - fix modify storage keys ending with .temp causes overwriting

* CL

* use t.TempDir
2024-02-15 17:34:37 +00:00
Josh Black
fa13dbd381 add gosimport to make fmt and run it (#25383)
* add gosimport to make fmt and run it

* move installation to tools.sh

* correct weird spacing issue

* Update Makefile

Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>

* fix a weird issue

---------

Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
2024-02-13 14:07:02 -08:00
Nick Cabatoff
1b8606d9ec Minor improvements to test cluster libraries (#25329)
Add WaitForMatchingMerkleRootsClients and Clients to sdk testcluster.  Fix internal TestCluster.SetRootToken, which wasn't updating the builtin clients' token.
2024-02-09 09:45:43 -05:00
Nick Cabatoff
53f0622af5 Add some helpers to the sdk for working with namespaces. (#25270) 2024-02-09 09:24:08 -05:00
Christopher Swenson
8f6dfaaf67 Interface for event subscription plugins; SQS plugin (#24352)
Initial version of an internal plugin interface for event subscription plugins,
and an AWS SQS plugin as an example.

Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
2024-02-05 13:17:07 -08:00
Christopher Swenson
55d2dfb3d0 database: Emit event notifications (#24718)
Including for failures to write credentials and failure to rotate.
2024-02-05 10:30:00 -08:00