Commit Graph

429 Commits

Author SHA1 Message Date
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
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
Luis (LT) Carbonell
2d46c8d1fd
Add clarifying message (#28535) 2024-09-30 15:48:55 +00: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
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
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
Mike Palmiotto
93682b0547
Prepare CE changes for [census.Agent] SetMetadata (#27577) 2024-06-25 10:41:56 -04: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
bf82dfeac8
lowercase first letter of error message (#27513) 2024-06-17 09:50:48 +00:00
Luke Clifton
3e998a431f
Add option for not mounting the KV mount in --dev (#16974)
* Add option for not mounting the KV mount in --dev

* Fix whitespace I messed up during merge conflict resolution

* Feature -> Improvement

* Fix formatting for real

---------

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-05-31 15:48:56 -04:00
Luis (LT) Carbonell
33d93652d5
Store Cluster Name in Physical Storage (#26878)
* Store Cluster Name in Physical Storage

* Add changelog
2024-05-13 14:36:29 -04:00
Mike Palmiotto
3150c321cb
AOP: Make config reloadable (enterprise) (#26907)
CE stubs to support reloadable AOP config.
2024-05-09 17:14:39 -04:00
Kevin Schoonover
c0ea7b1a35
reload service registration configuration on SIGHUP (#17598)
* add reloading service configuration

* add changelog entry

* add tests

* fix typo

* check if config.ServiceRegistration is nil before signaling

* add changes for deregistering service on nil config with failing tests

* fix tests by decreasing reconcile_timeout + setting consul agent tokens

* fix races

* add comments in test

---------

Co-authored-by: Marc Boudreau <marc.boudreau@hashicorp.com>
2024-05-09 17:13:14 -04:00
Christopher Swenson
1e36019f1c
Remove SQS plugin (#26524)
To be moved to Enterprise.

The paths and plugin itself were not activated.
2024-04-18 20:50:11 +00:00
Nick Cabatoff
2560beea8e
CE part of https://github.com/hashicorp/vault-enterprise/pull/4269 (#26406) 2024-04-15 20:08:57 +00:00
Steven Clark
bd5f61aae1
During a seal reload through SIGHUP, only write updated seal barrier on an active node (#26381)
* During a seal reload through SIGHUP, do not write updated seal barrier on non-active nodes

* Add cl
2024-04-12 08:51:44 -04:00
Victor Rodriguez
ae31138aea
Only reload seal config when enable_multiseal is set, or is being disabled (#26166)
Fix reloading of seal configuration when a node gains leadership.

Verify that the in-memory seal generation information is stale and only reload
seal configuration when that is the case.

When reloading seal configuration, only do it when enable_multiseal is currently
set to true, or the new configuration is attempting to set it to true.
2024-03-27 13:57:46 -04:00
Rachel Culpepper
f7301bc5fa
add check for enable_multiseal with sighup (#26105) 2024-03-22 11:21:32 -05:00
Victor Rodriguez
b112eb9877
Reload seals if necessary when a node gains leadership. (#26098)
As part of the process of becoming a leader node, check to see if the seal
configuration needs to be reloaded. Reloading may be necessary if the seal
generation information computed during start up is outdated. For example, a new
node that has just joined the cluster will have incorrect seal generation
information in memory, even if it has the correct seal configuration, since it
did not have access to the stored seal generation information.
2024-03-22 15:51:42 +00:00
Scott Miller
c6da02962d
Add a configuration flag for enabling multiseal (Seal HA), CE side (#25908)
* Add a configuration flag for enabling multiseal (Seal HA), CE side

* imports

* no quotes

* get rid of dep on ent config

* Abstract enableMultiSeal for a build time switch

* license headers

* wip

* gate physical seal gen fetch by a param

* docs tweak, remove core flag

* updates from the ent pr

* update stub

* update test fixtures for enable_multiseal

* use accessor

* add a test fixture for non-multiseal diagnose

* remove debugging crtuch

* Do handle phys seal gen info even if multiseal is off, in order to facilitate enable/disable safeties

* more enabled flag handling

* Accept seal gen info if we were previously disabled, and persist it

* update unit test

* Validation happens postUnseal, so this test is invalid

* Dont continue setting conf if seal loading fails during SIGHUP

* Update website/content/docs/configuration/seal/seal-ha.mdx

Thanks, that does sound much clearer

Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>

* use validation if previous gen was enabled

* unit test update

* stub SetMultisealEnabled

* bring over more changes from ent

* this was an unfix

---------

Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>
2024-03-22 14:23:05 +00:00
Mike Palmiotto
c546f597d5
remove _ from server info (#25748) 2024-03-01 11:50:11 -05:00
Jason O'Donnell
be0061509b
command/server: remove env var requirement for sigusr2 pprof output (#25391)
* command/server: remove env var requirement for sigusr2 pprof output

* changelog
2024-02-29 10:35:40 -05:00
Mike Palmiotto
b54ac98a0b
Move Request Limiter to enterprise (#25615) 2024-02-27 16:24:06 -05:00
Mike Palmiotto
7ad778541e
Disable Request Limiter by default (#25442)
This PR flips the logic for the Request Limiter, setting it to default
disabled.

We allow users to turn on the global Request Limiter, but leave the
Listener configuration as a "disable per Listener".
2024-02-16 17:50:18 -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
Scott Miller
f0e7f114a1
Avoid unnecessary rewraps, CE side (#25144)
* Avoid unnecessary rewraps, CE side

* sealRewrap is only available ENT side

* update stub

* update stub, again
2024-01-31 17:27:52 -06:00
Tom Proctor
6e111d92fe
Support setting plugin TMPDIR in config as well as env (#24978) 2024-01-30 13:10:23 +00:00
Mike Palmiotto
12f69a8ce5
Request Limiter listener config opt-out (#25098)
This commit introduces a new listener config option to allow disabling the request limiter per-listener.
2024-01-26 15:24:32 -05:00
Mike Palmiotto
5933768ca5
Request Limiter reloadable config (#25095)
This commit introduces a new reloadable stanza to the server config to allow disabling the Request Limiter.
2024-01-26 15:01:47 -05:00
claire bontempo
2c19bbe145
Consistently refer to Key Value secrets engine as KV (#24529)
* VAULT-21427 change ui references from K/V to KV

* references in docs/

* website json data

* go command errors

* replace Key/Value with Key Value

* add changelog

* update test

* update secret list header badge

* two more test updates
2023-12-14 11:28:58 -08:00
Hamid Ghaf
57b6b74283
release log gate if disable-gated-logs flag is set (#24280)
* release log gate if disable-gated-logs flag is set

* CL

* Update changelog/24280.txt

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

---------

Co-authored-by: Peter Wilson <peter.wilson@hashicorp.com>
Co-authored-by: Josh Black <raskchanky@gmail.com>
2023-12-11 08:08:48 -08:00
Victor Rodriguez
128152ee28
Update recovery mode guard to account for migrating away from Shamir (#24443)
It is not sufficient to check that function setSeal in server.go does not return
an "unwrap seal". For migrations away from a Shamir seal, NewCore constructor
sets up an unwrap seal by calling method adjustForSealMigration.

Factor out new method checkForSealMigration out of adjustForSealMigration so
that NewCore can verify that there won't be a migration when returning early due
to running in recovery mode.
2023-12-08 21:25:52 +00:00
Tom Proctor
a4180c193b
Refactor plugin catalog and plugin runtime catalog into their own package (#24403)
* Refactor plugin catalog into its own package
* Fix some unnecessarily slow tests due to accidentally running multiple plugin processes
* Clean up MakeTestPluginDir helper
* Move getBackendVersion tests to plugin catalog package
* Use corehelpers.MakeTestPlugin consistently
* Fix semgrep failure: check for nil value from logical.Storage
2023-12-07 12:36:17 +00:00
Victor Rodriguez
8a46bee768
Fix recovery mode check for seal migration configuration. (#24398)
With the introduction of the Seal High Availability feature, the presence of
multiple seals in configuration does not necessarily mean that the configuration
entails a seal migration.

Instead of checking for multiple seals, check for the presence on an "unwrap"
seal, which is only used for seal migrations.
2023-12-06 16:37:48 -05:00
Christopher Swenson
6ed8b88f5f
Switch from mitchellh/cli to hashicorp/cli (#24239)
@mitchellh suggested we fork `cli` and switch to that.

Since we primarily use the interfaces in `cli`, and the new
fork has not changed those, this is (mostly) a drop-in replacement.

A small fix will be necessary for Vault Enterprise, I believe.
2023-12-04 11:05:02 -08:00
Peter Wilson
06b9325bb9
fix -log-file so that it uses the correct name and only adds timestamps on rotation (#24297)
* fix -log-file so that it uses the correct name and only adds timestamps on rotation

* added some tests for naming/rotation

* changelog

* revert to previous way of getting created time

* remove unused stat

* comment shuffle

* Update changelog/24297.txt

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

* Update website/content/docs/agent-and-proxy/agent/index.mdx

Update 'agent' docs page

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

* Update website/content/docs/agent-and-proxy/proxy/index.mdx

Update 'proxy' docs page

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

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

Update 'server' docs page

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

* fix typos

---------

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>
2023-12-01 11:30:34 +00:00
Rachel Culpepper
638522ebac
Vault-18638: add seal reload on SIGHUP (#23571)
* reload seals on SIGHUP

* add lock in SetSeals

* move lock

* use stubmaker and change wrapper finalize call

* change finalize logic so that old seals will be finalized after new seals are configured

* add changelog

* run make fmt

* fix fmt

* fix panic when reloading seals errors out
2023-11-30 15:08:13 -06:00
Scott Miller
78d756acdb
Provide a more reasonable error message for disabled Shamir seals (#24275) 2023-11-28 18:03:24 +00:00
Scott Miller
913481fb1f
OSS fixes (#24200) 2023-11-21 10:25:01 -06:00
Divya Pola
117118e2bd
Add error checking when creating seal.Access object (#24181) 2023-11-17 19:28:24 +00:00
Hamid Ghaf
9d3617e567
Revert "Automatically track subloggers in allLoggers (#22038)" (#23986)
This reverts commit 4c8cc87794.
2023-11-03 11:08:01 -07:00
Jason O'Donnell
29d8929824
api/seal-status: fix deadlock when namespace is set on seal-status calls (#23861)
* api/seal-status: fix deadlock when namespace is set on seal-status calls

* changelog
2023-10-27 09:59:50 -04:00
Victor Rodriguez
40e9fcde49
Remove the Seal HA beta feature flag (#23820) 2023-10-27 09:13:06 -04:00
davidadeleon
8b15e7d216
Revert "Implement user lockout log (#23140)" (#23741)
This reverts commit 92fcfda8ad.
2023-10-20 11:21:18 -04:00
Nick Cabatoff
67d743e273
Step 3 of part 3 of removing ent init hooks: call stubs instead of var func hooks. (#23646) 2023-10-13 13:36:15 -04:00
John-Michael Faircloth
71067d291f
remove unused param from entEnableFourClusterDev (#23647) 2023-10-13 10:19:26 -05:00
Jason O'Donnell
7872338ec1
command/server: fix bug with sigusr2 where pprof files were not closed (#23636)
* command/server: fix bug with sigusr2 where pprof files were not closed

* changelog
2023-10-12 18:29:23 +00:00
Peter Wilson
813c786032
Listeners: Redaction only for TCP (#23592)
* redaction should only work for TCP listeners, also fix bug that allowed custom response headers for unix listeners

* fix failing test

* updates from PR feedback
2023-10-11 12:38:05 -04:00
davidadeleon
92fcfda8ad
Implement user lockout log (#23140)
* implement user lockout logger

* formatting

* make user lockout log interval configurable

* create func to get locked user count, and fix potential deadlock

* fix test

* fix test

* add changelog
2023-10-06 15:58:42 -04:00
Peter Wilson
e5432b0577
VAULT-19863: Per-listener redaction settings (#23534)
* add redaction config settings to listener

* sys seal redaction + test modification for default handler properties

* build date should be redacted by 'redact_version' too

* sys-health redaction + test fiddling

* sys-leader redaction

* added changelog

* Lots of places need ListenerConfig

* Renamed options to something more specific for now

* tests for listener config options

* changelog updated

* updates based on PR comments

* updates based on PR comments - removed unrequired test case field

* fixes for docker tests and potentially server dev mode related flags
2023-10-06 17:39:02 +01:00