716 Commits

Author SHA1 Message Date
Vault Automation
0c6c13dd38
license: update headers to IBM Corp. (#10229) (#10233)
* license: update headers to IBM Corp.
* `make proto`
* update offset because source file changed

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-10-21 15:20:20 -06:00
Vault Automation
5d05b1d023
VAULT-35084, VAULT-36948, VAULT-36952: Small tasks left over from the recovery work (#10083) (#10101)
* small tasks left over from the recovery work

* changelog

* fix test

Co-authored-by: miagilepner <mia.epner@hashicorp.com>
2025-10-14 09:36:20 +00:00
Vault Automation
0adb749a82
Check rate limits before doing json limits checking (#9688) (#9775)
* update the order of the requests handlers

* switch back to maxrequestsize, prevent the error by restricting the buffer size

* add test

Co-authored-by: miagilepner <mia.epner@hashicorp.com>
2025-10-02 09:30:31 +00:00
Vault Automation
b19e74c29a
JSON limits covering new use cases and MaxTokens (#9406) (#9596)
Co-authored-by: Bianca <48203644+biazmoreira@users.noreply.github.com>
2025-09-24 07:13:21 +00:00
Vault Automation
a70bc7c3cf
Backport Fix cert auth role quotas into ce/main (#9246) 2025-09-10 16:55:10 +00:00
Vault Automation
417175772c
Copy Support RFC-9440 colon-wrapped Base64 for forwarded client certs into main (#9085) (#9087)
* Add support for RFC 9440/8941 structured headers in client certificate handling

* Add changelog

---------

Co-authored-by: Huseyin Unal <23301714+husunal@users.noreply.github.com>
2025-09-09 09:55:40 -04:00
Vault Automation
e40eca1286
VAULT-39294: Deprecate recover_snapshot_id query param and use a header instead (#8834) (#9042)
* deprecate snapshot query params, use a header instead

* keep read query param, but deprecate recover one

* fix test

* remove list change

* add changelog

* rename header, allow request method

* update changelog

Co-authored-by: miagilepner <mia.epner@hashicorp.com>
2025-09-01 15:28:10 +00:00
Vault Automation
9d27d4f837
VAULT-37630: Recover as a copy (#8640) (#8798)
* recover as a copy implementation

* get policy tests passing

* add helpers and testing support

* fixes

* revert a couple of changes

* more tests

* switch to query param

* correctly update source path with the namespace

* only add openapi recover source path if there's a path parameter

* add changelog

* check for no mount in path

Co-authored-by: miagilepner <mia.epner@hashicorp.com>
2025-08-21 13:53:35 +00:00
Bianca
eedc2b7426
Add limit to JSON nesting depth (#31069)
* Add limit to JSON nesting depth

* Add JSON limit check to http handler

* Add changelog
2025-08-06 14:08:01 +02:00
Scott Miller
63ba96c988
Add additional validations to the destination and properties of file audit sinks (#31211)
* Add additional validations to the destination and properties of file audit sinks

* changelog

* docs

* Revert "docs"

This reverts commit c2e8f7608ede78adf96726100013a45831712e13.
2025-07-08 13:33:26 -05:00
miagilepner
318f858213
VAULT-36229: Nonce for rekey cancellations (#30794)
* require nonce for rekey

* update doc

* add changelog

* Apply suggestions from code review

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

* Apply suggestions from code review

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

---------

Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>
2025-06-05 19:55:41 +02:00
Violet Hynes
38cc11c91d
CE Changes for VAULT-36172 (#30761)
* CE Changes for VAULT-36172

* fixture
2025-05-27 13:15:15 -04:00
Michael Blaum
630babd594
Add enterprise configuration to optionally remove irrevocable leases (#30683)
* add automatic irrevocable lease removal features

* cleanup

* pull out ent changes

* strip out more stuff

* quiet CI screaming

* fix another test

* remove cl

* update irrevocable lease removal timing logic

* whoops
2025-05-20 20:13:14 +00:00
Bruno Oliveira de Souza
348d56150d
VAULT-35628: evaluate entity-based and collective group_by RLQ modes (#30633)
* implement rate limit evaluation

* fix CE code

* remove ent field from stub

* fix linter

* get stubmaker to stop complaining
2025-05-20 15:39:13 -03:00
Kuba Wieczorek
36403f597d
Add API paths for loaded snap (#30690) 2025-05-20 19:19:40 +01:00
miagilepner
7b3f80db77
VAULT-35081: Extract query parameters for snapshot read/recover (#30567)
* add query params

* build logical request from params

* add godoc

* be more precise with requires snapshot condition
2025-05-12 15:21:37 +00:00
Violet Hynes
664dfbe838
VAULT-35384 Add new telemetry metrics for HTTP response status codes (#30354)
* VAULT-35384 Add new telemetry metrics for HTTP status codes

* VAULT-35384 Add new telemetry metrics for HTTP status codes

* Changelog

* Changelog

* Typo

* Missed metrics

* VAULT-35384 sys/health
2025-05-06 10:15:19 -04:00
Violet Hynes
1690c59701
VAULT-35396 CE changes (#30496)
* VAULT-35396 CE changes

* test fix

* Consts

* More config
2025-05-05 11:42:34 -04:00
miagilepner
49eda90dcd
VAULT-191: Validate X-Forwarded-For IP (#29774)
* validate the IPs in x-forwarded-for header

* switch to only checking one IP

* remove newline

* changelog
2025-03-04 10:40:07 +01:00
Ryan Cragun
58a49e6ce0
VAULT-33758: IPv6 address conformance for proxy and agent (#29517)
This is a follow-up to our initial work[0] to address RFC-5952 §4 conformance for IPv6 addresses in Vault. The initial pass focused on the vault server configuration and start-up routines. This follow-up focuses on Agent and Proxy, with a few minor improvements for server.

The approach generally mirrors the server implementation but also adds support for normalization with CLI configuration overrides.

One aspect we do not normalize currently is Agent/Proxy client creation to the Vault server with credentials taken from environment variables, as it would require larger changes to the `api` module. In practice this ought to be fine for the majority of cases.

[0]: https://github.com/hashicorp/vault/pull/29228
2025-02-27 15:57:46 -07:00
Nick Cabatoff
38c3e15e1e
Add support for reloading raft config (#29485) 2025-02-05 15:08:46 +00:00
Theron Voran
6a87419ab0
CE changes for VAULT-33018 (#29470) 2025-01-31 11:11:44 -08:00
miagilepner
73bf3ebc7c
VAULT-31755: Add removed and HA health to the sys/health endpoint (#28991)
* logic

* actually got test working

* heartbeat health test

* fix healthy definition and add changelog

* fix test condition

* actually fix test condition

* Update vault/testing.go

Co-authored-by: Kuba Wieczorek <kuba.wieczorek@hashicorp.com>

* close body

---------

Co-authored-by: Kuba Wieczorek <kuba.wieczorek@hashicorp.com>
2024-12-04 11:09:10 +01:00
Bruno Oliveira de Souza
a2c467cc22
VAULT-31409: trace postUnseal function (#28895)
* initial implementation of unseal trace

* close file if we fail to start the trace

didn't bother to check the error from traceFile.Close()

* use reloadable config instead of env var

* license

* remove leftover

* allow setting custom dir and remove new package

* bring back StartDebugTrace

after talking to Kuba it sounds like it's a good idea to try to move stuff out of core, so even if there's no immediate need for a generic debug trace function it's still fair to add it

* track postUnseal instead of unsealInternal

also some usability improvements from manual testing

* address PR comments

* address security review

there were concerns about using the /tmp directory because of permissions, or having a default dir at all, so now it's required to set a dir in order to generate the traces.

* add unit tests to StartDebugTrace

* move back to default dir

* document new parameters

* add tiny integration test

* avoid column in trace filename

sounds like it might be forbidden in Windows and possibly cause problems in some MacOS applications.

* address PR feedback

* add go doc to test

CI was complaining about missing comments on the new test function. It feels a bit silly to require this of tests but whatever XD

* fix tests
2024-11-26 15:04:34 -03:00
miagilepner
dce93e3d6c
VAULT-31749: Interceptors to reject requests from removed Raft nodes (#28875)
* initial interceptors

* tests and request handling

* remove comment

* test comments

* changelog

* pr fixes

* reuse existing method

* fix test
2024-11-18 10:18:32 +01:00
Kuba Wieczorek
d211f47d9e
[VAULT-31754] Check removed status in sys/unseal and error out if the node has been removed from the cluster (#28909) 2024-11-14 13:23:30 +00:00
Chris Capurso
458de6d118
only strip v1 prefix from path if present (#28669)
* only strip v1 prefix from path if present

* add changelog entry

* adjust changelog
2024-10-10 12:25:14 -04:00
akshya96
06fac16a1e
Add maximum request duration (timeouts) for all requests except actual monitor and events requests (#28230)
* fix paths for sys/monitor and sys/events

* add changelog

* add changelog

* Update http/handler.go

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>

* added some modifications to check for timeout

---------

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-08-30 11:00:12 -07:00
Peter Wilson
c555503f39
Audit: Test fixes and improvements (#27934)
* update tests/fix tests
2024-08-01 13:57:04 +00:00
idnandre
e26c246cbb
chore: fix deprecated ioutil readall (#27823)
Signed-off-by: idnandre <andre@idntimes.com>
2024-07-30 09:18:24 -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
idnandre
b833d4714d
chore: fix deprecated ioutil nopcloser (#27650)
Signed-off-by: idnandre <andre@idntimes.com>
2024-07-03 13:38:34 -04:00
miagilepner
9e299c2896
VAULT-28255: Fix namespaced redirects (#27660)
* handle namespaced events redirects

* full test:

* changelog

* lint
2024-07-03 10:08:39 +02:00
Bianca Moreira
b3a4392a06
Add additional trace logging in raw forwarding (#27255) 2024-05-30 09:40:49 +02:00
Mike Palmiotto
080780b497
Add a TraceID for forwarded request tracing (#26939) 2024-05-10 17:04:01 +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
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
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
Peter Wilson
8bee54c89d
VAULT-24452: audit refactor (#26460)
* Refactor audit code into audit package
* remove builtin/audit
* removed unrequired files
2024-04-18 08:25:04 +01:00
Peter Wilson
38a78697c2
move noop audit to audit package (#26448) 2024-04-16 19:09:11 +01:00
Nick Cabatoff
2560beea8e
CE part of https://github.com/hashicorp/vault-enterprise/pull/4269 (#26406) 2024-04-15 20:08:57 +00:00
Jason N
e9cb557ef1
Add support for forwarded Tls-Client-Cert (#17272)
* Add support for x_forwarded_for_client_cert_header

* add changelog entry

* add tests for a badly and properly formatted certs

* both conditions should be true

* handle case where r.TLS is nil

* prepend client_certs to PeerCertificates list

* Add support for x_forwarded_for_client_cert_header

* add changelog entry

* add tests for a badly and properly formatted certs

* both conditions should be true

* handle case where r.TLS is nil

* prepend client_certs to PeerCertificates list

* add option for decoders to handle different proxies

* Add support for x_forwarded_for_client_cert_header

* add changelog entry

* add tests for a badly and properly formatted certs

* both conditions should be true

* handle case where r.TLS is nil

* prepend client_certs to PeerCertificates list

* add option for decoders to handle different proxies

* fix tests

* fix typo

---------

Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
Co-authored-by: Scott Miller <smiller@hashicorp.com>
Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-04-05 11:22:46 -05: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
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
Christopher Swenson
ae9ec39d44
events: Now enterprise-only (#25640)
This removes the WebSockets endpoint for events
(which will be moved to the Enterprise repo) and
disables tests that rely on it unless they are
running in Enterprise.

It also updates documentation to document that
events are only available in Vault Enterprise.
2024-02-26 20:19:35 +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
Steven Clark
3cd74cef9c
Forward EST .well-known requests on performance replicas (#25304)
- CE fix for properly forwarding the EST .well-known requests to
   performance replicas internally instead of redirecting through
   http headers
2024-02-08 16:33:53 -05:00