Commit Graph

1902 Commits

Author SHA1 Message Date
John-Michael Faircloth
91f2b9f91d remove deprecated centrify auth method (#27130)
* remove deprecated centrify auth method

* changelog
2024-05-20 17:49:47 +00: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
Violet Hynes
b16b94a72a VAULT-25341 Address issue where having no permissions to renew caused auto-auth to attempt to renew with no backoff (#26844)
* VAULT-25341 Address issue where having no permissions to renew caused Agent and Proxy auth to attempt to renew with no backoff

* Fiddle with go.mod changes that shouldn't have happened

* VAULT-25341 small cleanup and extra test

* VAULT-25341 backoff only in error case

* VAULT-25341 godocs

* VAULT-25342 changelog

* Update command/agent_test.go

Co-authored-by: divyaac <divya.chandrasekaran@hashicorp.com>

* VAULT-25341 rename file audit

---------

Co-authored-by: divyaac <divya.chandrasekaran@hashicorp.com>
2024-05-09 11:12:42 -04:00
Steven Clark
259cfbf618 Add missing delegated_auth_accessors config field to /sys/mounts/<path> response (#26876)
* Add missing delegated_auth_accessors config field to /sys/mounts/<path> response

 - The field hadn't been properly populated in the JSON struct being returned
   through the API response, but had been properly set in the stored structs
   in the backend.
 - Add missing update to the command tune docs for the -delegated-auth-accessors
   option that existed
 - Add -delegated-auth-accessors to the secret enable vault command along with
   a docs update

* Add cl

* Fix documentation, using a comma separated list does not work

* Apply suggestions from code review

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

* Drop plural on doc update

---------

Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>
2024-05-08 19:58:46 +00:00
Violet Hynes
f2b4ca4def VAULT-24736 CE changes for static secret capability behaviour toggle (#26744) 2024-05-03 14:12:19 -04:00
Mike Palmiotto
fdc330e622 Add inmem_transactional storage option for tests (#26780)
This PR adds inmem_transactional to the map of available physical
backends for TestServerCommand. This is harmless, as tests need to opt
into the backend.

This is required to test AOP configuration on enterprise.
2024-05-02 12:43:55 +00:00
Josh Black
75b0418d51 Add ACME client counts to vault operator usage (#26525)
* Add ACME client counts to vault operator usage

* add changelog

* remove a few errors
2024-04-29 08:51:37 -07:00
Violet Hynes
514d6d7111 VAULT-25987 Fully deflake self-healing tests (#26646) 2024-04-25 11:08:22 -04:00
Violet Hynes
fa61a060b4 VAULT-25987 de-flake Test_NoAutoAuthSelfHealing_BadPolicy (#26547)
* VAULT-25987 de-flake Test_NoAutoAuthSelfHealing_BadPolicy

* Send token to outputchannel too

* Remove initial sink checks
2024-04-19 15:11:30 -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
Peter Wilson
17c6cd1a2e fix race test (#26500) 2024-04-18 17:43:07 +00: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
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
Theron Voran
6df779f1ba agent: allow setting auto-auth and vault.namespace separately (#26427)
The new vault.namespace config option seems to always be overridden by
the auto-auth namespace, so add an extra check to allow them to be set
separately.

---------

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-04-15 21:05:38 +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
Peter Wilson
1dc07efb41 Agent: helper func tweak (#26394)
* tweaked makeTempFile

* removed defer removes for makeTempFile .. files
2024-04-12 18:36:43 +00:00
Violet Hynes
204c748ce7 VAULT-23742 Fix issue with use_auto_auth_token being always on (#26391)
* VAULT-23742 Fix issue with use_auto_auth_token being always on

* Test improvements from review
2024-04-12 13:51:53 -04: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
divyaac
e5fc11227d Fix TestProxy_Cache_EventSystemUpdatesCacheKVV2 (#26352)
* Fix TestProxy_Cache_EventSystemUpdatesCacheKVV2

* Edited tests, and added a new bool

* Edited tests

* Edited comment

* Rename argument in handler method

---------

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-04-11 10:17:04 -04:00
Peter Wilson
fc7b3232e3 Update Test_NoAutoAuthSelfHealing_BadPolicy (#26323) 2024-04-09 20:02:58 +00:00
divyaac
fcef8adfb0 Auto Auth Healing for Proxy (#26307)
* Auto Auth Healing for Proxy

* Edited changelog

* Fix failing tests and small comment change

* Readded check because proxy cache is initialized with inmem sink
2024-04-09 12:35:39 -07:00
Violet Hynes
c858c286cb Attempt to address TestAutoAuthSelfHealing_TokenFileAuth_SinkOutput flakiness (#26318)
* Attempt to address TestAutoAuthSelfHealing_TokenFileAuth_SinkOutput flakiness

* Address test flakiness
2024-04-09 10:08:15 -04: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
Peter Wilson
5c6b8f7b3e Agent: Improve TestAutoAuthSelfHealing_TokenFileAuth_SinkOutput (#26286)
* Improve TestAutoAuthSelfHealing_TokenFileAuth_SinkOutput to make it more robust in race test

* Tweak the sensitivity on waiting for template re-renders after triggering
2024-04-05 14:21:44 +01:00
Jason O'Donnell
39499e6fba cli: fixed HOME not set error (#26243)
* cli: fixed HOME not set error

* changelog

* changelog but better

* Slightly better error handling
2024-04-02 18:24:40 -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
divyaac
6cac3b3bf5 Agent Auto Auth Self Healing for Templates (#26172)
* Agent Auto Auth Self Healing for Templates

* Added changelog

* Edited go.sum

* Edit changelog wording
2024-03-27 10:06:45 -07:00
Violet Hynes
2a33300003 VAULT-20403 fix incorrectly deferred resource closure in debug command (#26167)
* VAULT-20403 fix incorrectly deferred resource closure in debug command

* VAULT-20403 changelog
2024-03-27 11:15:17 -04:00
Peter Wilson
54e19c50d5 Audit: remove any race to read headers (#26155)
* adjust code to prevent any data race in reading audited headers

* header tests

* Comment improvement

* make fmt 'fix' for unrelated file
2024-03-26 09:22:13 -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
Tom Proctor
02b6f8ec9b Add test data file to fix ent-only unit test (#25782) 2024-03-05 13:27:26 +00:00
Violet Hynes
1c0d71a58e Fix lock issue for Agent and Proxy (#25771) 2024-03-04 19:48:46 +00:00
Tom Proctor
9ed00822ea Move CLI token helper to api module (#25744)
* Move command/config + command/token to api/cliconfig + api/tokenhelper
* Remove unused functions and unused import
* Simplify and inline function copied from SDK
* Delete unused duplicated/forwarding config implementation from command package
* Delete unused code, unexport API surface that's only used internally to the package
* Fix up license headers
* Add changelog
* Tweak .gitignore to track hcl files in testdata/ folders
2024-03-04 18:29:20 +00:00
miagilepner
e3d8a4d202 VAULT-24556: add secret syncs to vault operator usage output (#25751)
* add secret syncs to vault operator usage

* changelog

* unexport

* add godoc for test and remove t.Run invocation

* move test to separate package

* update comment
2024-03-04 12:48:52 +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
Violet Hynes
fbfe661a08 VAULT-24386 better erroring for Proxy static secret caching for CE (#25661) 2024-02-27 10:47:31 -05:00
Kevin Schoonover
19aeaa57a6 add support for 'LeaseRenewalThreshold' in vault agent (#25212)
* add support for 'LeaseRenewalThreshold' in vault agent

* allow LeaseRenewalThreshold to be nil

* address review comments

* Add changelog

---------

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-02-26 15:49:31 -05:00
Violet Hynes
ccc2e1b391 VAULT-24386 CE change portion of moving proxy static secret caching to enterprise (#25641) 2024-02-26 19:41:27 +00:00
Christopher Swenson
1fff35052b Don't load SQS events backend by default (for now) (#25522)
This is not going to be enabled in 1.16, so we can
remove it from the default list of backends.

This removes about 600 KB of dead code from the
binary.

We can add this back in when the rest of the
event plugin endpoints are merged.
2024-02-21 10:20:44 -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
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
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
Violet Hynes
a1cb18b2c2 VAULT-528 Fix Vault Agent being unable to render secrets with delete_version_after set. (#25387)
* VAULT-528 add test reproducing the failure that should pass after the fix

* VAULT-528 Upgrade consul-template to version with the fix

* VAULT-528 changelog
2024-02-13 14:49:35 -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