open-vault/helper
Mike Palmiotto 439e35f50f
Vault 6773/raft rejoin nonvoter (#16324)
* raft: Ensure init before setting suffrage

As reported in https://hashicorp.atlassian.net/browse/VAULT-6773:

	The /sys/storage/raft/join endpoint is intended to be unauthenticated. We rely
	on the seal to manage trust.

	It’s possible to use multiple join requests to switch nodes from voter to
	non-voter. The screenshot shows a 3 node cluster where vault_2 is the leader,
	and vault_3 and vault_4 are followers with non-voters set to false.  sent two
	requests to the raft join endpoint to have vault_3 and vault_4 join the cluster
	with non_voters:true.

This commit fixes the issue by delaying the call to SetDesiredSuffrage until after
the initialization check, preventing unauthenticated mangling of voter status.

Tested locally using
https://github.com/hashicorp/vault-tools/blob/main/users/ncabatoff/cluster/raft.sh
and the reproducer outlined in VAULT-6773.

* raft: Return join err on failure

This is necessary to correctly distinguish errors returned from the Join
workflow. Previously, errors were being masked as timeouts.

* raft: Default autopilot parameters in teststorage

Change some defaults so we don't have to pass in parameters or set them
in the originating tests. These storage types are only used in two
places:

1) Raft HA testing
2) Seal migration testing

Both consumers have been tested and pass with this change.

* changelog: Unauthn voter status change bugfix
2022-07-18 14:37:12 -04:00
..
benchhelpers Update deps for consul-template 0.29.0 (#15293) 2022-05-05 10:30:40 -07:00
builtinplugins Adding vault-plugin-secrets-kubernetes v0.1.0 (#15551) 2022-05-20 14:13:33 -07:00
constants
dhutil Remove spurious fmt.Printf calls including one of a key (#15344) 2022-05-19 12:27:02 -07:00
fairshare VAULT-4240 time.After() in a select statement can lead to memory leak (#14814) 2022-04-01 10:17:11 -04:00
flag-kv
flag-slice
forwarding VAULT-6614 Enable role based quotas for lease-count quotas (OSS) (#16157) 2022-07-05 13:02:00 -04:00
hostutil
identity VAULT-6614 Enable role based quotas for lease-count quotas (OSS) (#16157) 2022-07-05 13:02:00 -04:00
metricsutil Add database plugin metrics around connections (#16048) 2022-06-27 09:34:45 -07:00
monitor api/monitor: Adding log format to monitor command and debug (#15536) 2022-05-24 13:10:53 -04:00
namespace When tainting a route during setup, pre-calculate the namespace specific path (#15067) 2022-04-26 09:13:45 -07:00
osutil Fix nightly tests and debug (#14970) 2022-04-12 06:08:28 +05:30
parseip
pgpkeys
policies
proxyutil
random Only use additional entropy source when configured within transit and sys random (#15734) 2022-06-01 14:56:39 -04:00
storagepacker VAULT-6614 Enable role based quotas for lease-count quotas (OSS) (#16157) 2022-07-05 13:02:00 -04:00
testhelpers Vault 6773/raft rejoin nonvoter (#16324) 2022-07-18 14:37:12 -04:00
timeutil