1958 Commits

Author SHA1 Message Date
Nick Cabatoff
38c3e15e1e
Add support for reloading raft config (#29485) 2025-02-05 15:08:46 +00:00
Sai Aung Hlyan Htet
16438470f7
CLI: add an option for renew command fail on non-fullfillable request to allow command chaining (#29060)
Signed-off-by: saiaunghlyanhtet <saiaunghlyanhtet2003@gmail.com>
2025-02-04 16:04:26 -03:00
Ryan Cragun
012cd5a42a
VAULT-33008: ipv6: always display RFC-5952 §4 conformant addresses (#29228)
USGv6[0] requires implementing §4.1.1 of the NISTv6-r1 profile[1] for
IPv6-Only capabilities. This section requires that whenever Vault
displays IPv6 addresses (including CLI output, Web UI, logs, etc.) that
_all_ IPv6 addresses must conform to RFC-5952 §4 text representation
recommendations[2].

These recommendations do not prevent us from accepting RFC-4241[3] IPv6
addresses, however, whenever these same addresses are displayed they
must conform to the strict RFC-5952 §4 guidelines.

This PR implements handling of IPv6 address conformance in our
`vault server` routine. We handle conformance normalization for all
server, http_proxy, listener, seal, storage and telemetry
configuration where an input could contain an IPv6 address, whether
configured via an HCL file or via corresponding environment variables.

The approach I've taken is to handle conformance normalization at
parse time to ensure that all log output and subsequent usage
inside of Vaults various subsystems always reference a conformant
address, that way we don't need concern ourselves with conformance
later. This approach ought to be backwards compatible to prior loose
address configuration requirements, with the understanding that
going forward all IPv6 representation will be strict regardless of
what has been configured.

In many cases I've updated our various parser functions to call the
new `configutil.NormalizeAddr()` to apply conformance normalization.
Others required no changes because they rely on standard library URL
string output, which always displays IPv6 URLs in a conformant way.

Not included in this changes is any other vault exec mode other than
server. Client, operator commands, agent mode, proxy mode, etc. will
be included in subsequent changes if necessary.

[0]: https://www.nist.gov/publications/usgv6-profile
[1]: https://www.nist.gov/publications/nist-ipv6-profile
[2]: https://www.rfc-editor.org/rfc/rfc5952.html#section-4
[3]: https://www.rfc-editor.org/rfc/rfc4291

Signed-off-by: Ryan Cragun <me@ryan.ec>
2025-01-27 14:14:28 -07:00
Steven Clark
9456671f04
Prepare code base for Go 1.24 update. (#29412)
* Fix "t.Fatal from a non-test goroutine" errors in cache_test.go

 - t.Fatal(f) should not be called within a Go routine based on it's documentation and only from the main test's thread.
 - In 1.24 this seems to cause build failures

* Address all "non-constant format string errors" from go vet

 - Within 1.24 these now cause test builds to fail

…" from go vet
2025-01-27 14:34:07 -05:00
Nick Cabatoff
13c445bd45
Websocket lib has moved, see https://coder.com/blog/websocket. (#29386) 2025-01-22 19:30:03 +00:00
Thy Ton
4f14f7bfec
plugin register with artifact stubs VAULT-32686 (#29113)
* add plugin catalog's entValidate() and setInternal() oss stubs 
* create plugin register command constructor oss stub
* create EntPluginRunner oss stub
* add validateSHA256() oss stub to validate plugin catalog update input
2025-01-09 08:20:09 -08:00
divyaac
1aa49af191
Revert "Store global clients at separate storage paths (#28926)" (#29272)
This reverts commit e21dfa6b1ce1e3e9ce0705061150070db7cf7d1c.

Co-authored-by: akshya96 <87045294+akshya96@users.noreply.github.com>
2025-01-02 19:42:41 +00:00
akshya96
3c15d4b7fa
Revert "Storing local clients to local storage paths ce changes (#28958)" (#29268)
This reverts commit 504227bd74b88d905898b3c3ff3ce754211eaf14.
2025-01-02 09:17:27 -08:00
divyaac
3622e22101
Revert "Remove all references to current fragments, standbyfragments and part…" (#29267)
This reverts commit 6ed4ad08517c70918993d8712c10d7279af8b517.
2024-12-30 13:19:09 -08:00
Steven Clark
7d26c54350
Do not use static certificates for diagnose tests (#29122)
* Do not use static certificates for diagnose tests

* Fix operator command tests, move PKI CA creation code into testhelper lib

* Fix compilation error from refactoring
2024-12-09 14:03:16 +01:00
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
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
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
miagilepner
4b98fd9b1a
VAULT-31751, VAULT-31752: removed_from_cluster in vault status (#28938)
* add removed from cluster to status output

* test for command

* update docs

* changelog
2024-11-19 11:13:10 +01:00
Josh Black
2269cc3f7c
remove hashicorp-forge/bbolt and replace with official beta release (#28916)
* remove hashicorp-forge/bbolt and replace with official beta release

* get rid of redundant method

* go mod tidy

* make proto
2024-11-18 11:18:50 -08:00
divyaac
e21dfa6b1c
Store global clients at separate storage paths (#28926) 2024-11-15 19:15:41 +00:00
Scott Miller
415d260995
Support trimming trailing slashes via a mount tuneable to support CMPv2 (#28752)
* Support trimming trailing slashes via a mount tuneable to support CMPv2

* changelog/

* Perform trimming in handleLoginRequest too

* Eagerly fetch the mount entry so we only test this once

* Add a mount match function that gets path and entry

* Update vault/request_handling.go

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

* more docs

* Some patches (from ENT) didnt apply

* patch fail

* Update vault/router.go

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

* PR feedback

* dupe

* another dupe

* Add support for enabling trim_request_trailing_slashes on mount creation

* Fix read mount api returning configuration for trim_request_trailing_slashes

* Fix test assertion

* Switch enable and tune arguments to BoolPtrVal to allow end-users to specify false flag

* Add trim-request-trailing-slashes to the auth enable API and CLI

---------

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2024-10-24 10:47:17 -05:00
miagilepner
4439ee8798
Fix Windows chown error (#28748)
* noop for windows chown

* changelog
2024-10-22 14:57:26 +02:00
Violet Hynes
210da8f705
Fix data race around static secret capability manager (#28653)
* Fix data race around static secret capability manager

* Actually, clone the map
2024-10-09 15:43:49 -04:00
Josh Black
7307c56f59
-agent-address flag should have higher precedence than the env var (#28574)
* -agent-address flag should have higher precedence than the env var

* add changelog
2024-10-04 11:29:03 -07:00
Josh Black
d1355cb98f
explain how -output-curl-string works in comments to avoid confusion (#28576) 2024-10-04 11:14:21 -07:00
Mike Palmiotto
6a145af82a
CE: Remove RequestLimiter config plumbing (#28592)
This PR provides some plumbing for the enterprise counterpart PR:
hashicorp/vault-enterprise#6791
2024-10-04 13:48:16 -04:00
Jason Joo
a5caf4e1cb
fix: cert auth method watches cert file change and NewCreds() notification (#28126)
Signed-off-by: Jason Joo <hblzxsj@gmail.com>
2024-10-02 13:41:55 -04:00
Luis (LT) Carbonell
2d46c8d1fd
Add clarifying message (#28535) 2024-09-30 15:48:55 +00:00
Violet Hynes
6d66990cb6
Fix static secret caching race condition (#28494)
* Fix static ssecret caching data race

* Fix static ssecret caching data race

* Changelog
2024-09-24 14:08:48 -04:00
Luis (LT) Carbonell
352bbeb06c
VAULT-12732: Add Heap Profiling Option to Vault Server Command Line (#27033)
* Add pprof output option to CLI

* Add to docs

* Add changelog

* Update website/content/docs/commands/server.mdx

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

* some changes

* Update changelog/27033.txt

Co-authored-by: Josh Black <raskchanky@gmail.com>

---------

Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>
Co-authored-by: Josh Black <raskchanky@gmail.com>
2024-09-16 11:00:08 -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
Violet Hynes
bc7923ad29
VAULT-30219 Bug fix for race condition (#28228) 2024-08-30 09:45:58 -04:00
Violet Hynes
a5262e08bb
VAULT-30219 CE changes for versioned secret fix (#28207)
* VAULT-30219 CE changes for versioned secret fix

* Changelog
2024-08-28 11:29:06 -04:00
kpcraig
dc81de7ec8
Easy go-jose updates (the codeless[ish] ones) (#28140) 2024-08-21 14:25:07 -04:00
Violet Hynes
474bcd8f11
VAULT-29738 CE changes for client count warning (#28068)
* VAULT-29738 CE changes for client count warning

* VAULT-29738 add changelog
2024-08-14 09:31:02 -04:00
Brian Howe
cbc06c0856
ensure response is not nil before sanitizing (#27923)
Co-authored-by: akshya96 <87045294+akshya96@users.noreply.github.com>
2024-08-12 12:48:48 -07:00
aphorise
88975a6c24
Core: CLI Doc improvements to example read / write. (#19064)
* Core: CLI Doc imporvements to example read / write. Resolves #16788

* Core: CLI Doc imporvements to example read / write. Resolves #16788. Updated Changelog filename.

* Core: CLI Doc imporvements to example read / write. Resolves #16788. Updated Changelog..

* Updated read example to use token lookup instead.
2024-08-09 11:48:21 -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
Violet Hynes
b689fc62f1
VAULT-29198 CE side changes for Proxy update forwarding (#27891)
* VAULT-29198 CE side changes for Proxy update forwarding

* VAULT-29198 changelog
2024-07-29 12:58:55 -04:00
divyaac
b32231a9eb
Deprecate distinct_entities and nont_entity_tokens (#27830)
* OSS Changes

* Added changelog

* Fix build errors
2024-07-23 20:57:38 +00:00
Violet Hynes
dbecbcec18
VAULT-27384 Fix faulty assignments and unchecked errors (#27810)
* VAULT-27384 Fix faulty assignments and unchecked errors

* Another missed error

* Small refactor
2024-07-22 16:53:02 -04:00
Violet Hynes
b9c892f8aa
VAULT-28656 CE changes for Proxy bug (#27730)
* VAULT-28656 CE changes for Proxy bug

* VAULT-28656 changelog

* VAULT-28656 rename changelog
2024-07-10 09:38:51 -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
Mike Palmiotto
3229cf192b
Add CE plumbing for CensusManager reload (#27664)
This PR adds the CE plumbing and stubs for forcing agent instantiation
whenever the Vault license changes.

Resolves: VAULT-28583
Enterprise PR: hashicorp/vault-enterprise#6168
2024-07-03 13:31:56 -04:00
Peter Wilson
89276a56b2
VAULT-6803: fix listener issue if using proxy_protocol_behavior with deny_unauthorized for untrusted upstream connections (#27589)
* timeout 'testListenerConnFn' waiting on the server connection after 3 secs

* return the invalid upstream error so the library knows not to stop listening/serving

* update go-proxyproto to use fork/tag

* test that fails before library and code update, but passes afterwards
2024-06-26 07:52:13 +00:00
Mike Palmiotto
93682b0547
Prepare CE changes for [census.Agent] SetMetadata (#27577) 2024-06-25 10:41:56 -04:00
Violet Hynes
3959722892
VAULT-28192 fix Agent and Proxy consuming large amounts of CPU for auto-auth self-healing (#27518)
* VAULT-28192 fix Agent and Proxy consuming large amounts of CPU for auto-auth self-healing

* Changelog

* Update changelog

* drain incoming if we get invalid token

---------

Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>
2024-06-19 10:23:51 -04:00
Thy Ton
28c2e94382
replace global vault handlers with newVaultHandlers() (#27515) 2024-06-18 15:17:40 +00:00
Jason O'Donnell
fe1f36a1dc
Add SIGUSR2 pprof to agent and proxy (#27510)
* Add SIGUSR2 pprof to agent

* changelog

* Update command/agent.go

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

* Update command/agent.go

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

* Add to proxy, update tests

* Fix path

* Changelog

* dry

* choose one error style

---------

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-06-17 17:10:00 +00:00
Peter Wilson
b2ac030593
temp directory not used in a few places, switched to using testify require to clean up (#27512) 2024-06-17 10:53:31 +01:00
Peter Wilson
bf82dfeac8
lowercase first letter of error message (#27513) 2024-06-17 09:50:48 +00:00
Thy Ton
83111c010c
use BUILD_MINIMAL env to build minimal Vault with few storage options and plugins (#27394) 2024-06-12 16:53:49 +00:00