Commit Graph

18722 Commits

Author SHA1 Message Date
Marc Boudreau
b468950dc5 VAULT-21157: Reduce Technical Debt (#24345)
* refactor (standardUnsealStrategy).unseal to reduce tech debt

* fix coding error that cause panic in runSetupFunctionsForUnseal

* split runSetupFunctionsForUnseal into 2 funcs to facilitate testing

* add go docs for functions

* fix compile errors from merge commit
2023-12-12 19:42:02 -05:00
Rachel Culpepper
9eca3ebde1 Vault-21960: Add docker tests for reloading seal configuration on SIGHUP (#24312)
* 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

* add sighup tests and separate out docker utilities

* add test case

* fix typo

* remove build tag

* fix imports

* refactoring to make functions more general and avoid conflicts

* add utility funcs

* separate out config copy into function

* fix error message

* fix error messages
2023-12-12 21:26:00 +00:00
Violet Hynes
879f9c9bfd Fix flaky restore test (#24490) 2023-12-12 10:27:26 -05:00
Scott Miller
13e0a45525 Fix race in the tryDecrypt waitgroup (#24484) 2023-12-11 21:36:53 +00:00
Violet Hynes
8ab891c962 Fix templating mention in Proxy docs (#24483) 2023-12-11 16:31:40 -05:00
Ryan Cragun
d6bfe428f3 enos: don't include consul_version in autopilot (#24461)
Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-12-11 14:26:19 -07:00
Ryan Cragun
efda1c6d4e enos: always test from the same branch as the revision (#24462)
Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-12-11 14:26:10 -07:00
Scott Miller
980691c129 Use a waitgroup and actually consume all discarded results (#24473) 2023-12-11 18:49:37 +00:00
Marc Boudreau
79b1912287 VAULT-21607: Provide Management Endpoints for Vault UI Custom Messages (#24263)
* Implement custom-message management endpoints in a namespace aware manner

* completion of non-enterprise version of custom-messages

* clean up of error handling and fixing a nil pointer error

* rename UICustomMessagesEntry to UICustomMessageEntry

* add unit tests to cover new functions in UIConfig related to custom messages

* unit tests for all custom message handling

* add missing header comments for new files

* add changelog file

* fix test setup error that led to unexpected failure

* change return type from slice of pointers to struct to slice of struct and add godocs to every function

* add Internal suffix to internal methods for the UIConfig struct

* add validation for start and end times of custom messages

* improvements based on review feedback

* explore new approach for custom messages

* introduce new error to force HTTP 404 when referencing non-existant UI custom message

* remove changelog entry until feature is complete

* implement CRUD endpoints using single storage entry per namespace

* add mutex to protect operations that read the storage entry and write it back

* add copyright header comment to new files

* fix failing tests due to change in target function behaviour in order to return 404 error when mandated

* feedback from review plus some improvements on my own as well

* define constants for recognized message types and replace hardcoded strings occurrences with new constants

* incorporate feedback comment

* beef up testing with non-root namespaces in putEntry and getEntryForNamespace

* renaming CreateMessage to AddMessage in uicustommessages.Manager and uicustommessages.Entry

* adding missing copyright header comments
2023-12-11 13:31:42 -05: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
Nick Cabatoff
28ce9c5a4c Make testCluster_Forwarding more tolerant of timing issues (#24451) 2023-12-11 15:35:03 +00:00
miagilepner
2db1941fd8 Docs updates about redirection and metrics (#24445)
* docs updates

* remove comma
2023-12-11 15:49:38 +01:00
Lucy Davinhart || Strawb System
1dfce2a271 docs: clarified the MS SQL EKM provider's authentication behavior, and the implications for AppRole configuration (#24437) 2023-12-11 08:54:09 +00:00
brendanelmes
10f7011ca3 docs: fixes (#24094) (#24115)
Co-authored-by: Yoko Hyakuna <yoko@hashicorp.com>
2023-12-08 14:19:57 -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
VAL
b5e9f3f32c add changelog for 1.15.4, 1.14.8, 1.13.12 (#24452) 2023-12-08 13:07:12 -08:00
Ryan Cragun
a087f7b267 [QT-627] enos: add pkcs11 seal testing with softhsm (#24349)
Add support for testing `+ent.hsm` and `+ent.hsm.fips1402` Vault editions
with `pkcs11` seal types utilizing a shared `softhsm` token. Softhsm2 is
a software HSM that will load seal keys from a local disk via pkcs11.
The pkcs11 seal implementation is fairly complex as we have to create a
one or more shared tokens with various keys and distribute them to all
nodes in the cluster before starting Vault. We also have to ensure that
each sets labels are unique.

We also make a few quality of life updates by utilizing globals for
variants that don't often change and update base versions for various
scenarios.

* Add `seal_pkcs11` module for creating a `pkcs11` seal key using
  `softhsm2` as our backing implementation.
* Require the latest enos provider to gain access to the `enos_user`
  resource to ensure correct ownership and permissions of the
  `softhsm2` data directory and files.
* Add `pkcs11` seal to all scenarios that support configuring a seal
  type.
* Extract system package installation out of the `vault_cluster` module
  and into its own `install_package` module that we can reuse.
* Fix a bug when using the local builder variant that mangled the path.
  This likely slipped in during the migration to auto-version bumping.
* Fix an issue where restarting Vault nodes with a socket seal would
  fail because a seal socket sync wasn't available on all nodes. Now we
  start the socket listener on all nodes to ensure any node can become
  primary and "audit" to the socket listner.
* Remove unused attributes from some verify modules.
* Go back to using cheaper AWS regions.
* Use globals for variants.
* Update initial vault version for `upgrade` and `autopilot` scenarios.
* Update the consul versions for all scenarios that support a consul
  storage backend.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-12-08 14:00:45 -07:00
Mike Palmiotto
309294a25c enterprise: Default Lease Count Quota (#24382)
This commit introduces the plumbing for Default Lease Count Quotas on
new installs of Vault Enterprise.
2023-12-08 15:09:52 -05:00
Jordan Reimer
3684e898c5 removes ui_copywrite from pre-commit hook (#24448) 2023-12-08 10:45:30 -07:00
Angel Garbarino
77178c2b15 Handle show and edit views for old KV urls (#24339)
* redirect for deshow/details view

* test coverage

* not found test fix

* changelog

* test fixes and amend for create route with no secret

* handle router with no secret

* add more coverage

* Update 24339.txt

* Update secret-edit.js

* Update secret-edit.js

* restructure conditional because list-directory will never be a thing in this view

* Update secret-edit.js

* remove show for directory. that doesn't exists

* blah fix test

* fix conditional

* remove meep
2023-12-08 10:23:44 -07:00
miagilepner
978945022d VAULT-22569: Handle nil node info when retrieving HA peers (#24441)
* add nil check

* changelog

* clarify changelog
2023-12-08 17:34:24 +01:00
Austin Gebauer
ba386a3389 docs: adds domain to OIDC Google Workspace integration (#24433) 2023-12-08 08:23:01 -08:00
Peter Wilson
c0bbede1e2 Bump go-eventlogger to v0.2.8 (#24442) 2023-12-08 14:43:34 +00:00
Steven Clark
2662bc520a Rename seal rewrap stub file (#24438) 2023-12-08 14:06:37 +00:00
miagilepner
5a3c19d821 move stopPartialSealRewrapping out (#24436)
* move stopPartialSealRewrapping out

* copyright

* add go generate

* switch back autopilot timing values

* skip test
2023-12-08 14:34:32 +01:00
Ben Ash
ff4489b5af Update docs for VSO v0.4.2 (#24425) 2023-12-07 20:55:53 -05:00
claire bontempo
416d8bde5d UI: Create enable input component (#24427)
* enable input component

* add more stars

* update css comments

* Update ui/app/styles/helper-classes/flexbox-and-grid.scss

* make attrOptions optional

* add subtext to textfile

* add docLink arg to form field textfile

* update form field test

* add test

* add comment

* update jsdoc

* remove unused class

* Update ui/tests/integration/components/enable-input-test.js

Co-authored-by: Jordan Reimer <zofskeez@gmail.com>

---------

Co-authored-by: Jordan Reimer <zofskeez@gmail.com>
2023-12-07 15:25:55 -08:00
Scott Miller
571b3cca47 Make sure stopCh is closed first (#24430)
* Reverse order of defers to minimize race between sending and closing

* Make this more explicit
2023-12-07 22:12:46 +00:00
Nick Cabatoff
5472c21552 Make leaderCheckInterval configurable. (#24372) 2023-12-07 21:35:37 +00:00
Scott Miller
e678d2ed4e use a stop chan to prevent sends on the closed result channel (#24428)
* use a stop chan to prevent sends on the closed result channel

* these need to be defers, since there are early returns in the for/select stmt
2023-12-07 15:31:52 -06:00
Mike Palmiotto
9cc3bd6558 quotas: Move storage updates into quotas package (#24381)
This commit moves quota storage updates into the storage package to
facilitate testing. As a part of the change, we create a new
`ManagerFlags` struct to make Setup invocations a bit more ergnomic.
2023-12-07 16:13:24 -05:00
Angel Garbarino
85acabb8ac Add directory paths to KV capabilities checks (#24404)
* add getter to metadata model

* add changelog and data model fix

* add test coverage

* add nested create coverage

* Update 24404.txt

* remove from data model

* return to how it was
2023-12-07 12:48:09 -07:00
Scott Miller
a2c263bf12 Fix two potential channel hangs in access.tryDecrypt (#24418)
* Fix two potential channel hangs in access.tryDecrypt

* could also live here
2023-12-07 12:17:24 -06:00
Scott Miller
889cca71fa Add stub for stopping partial wrap monitoring to CE (#24420)
* Add stub for stopping partial wrap monitoring to CE

* Add call
2023-12-07 12:16:11 -06:00
Steven Clark
8963ae495d PKI: Refactor storage of certificates into a common method (#24415)
- Move the copy/pasted code to store certificates into a
   common method within the PKI plugin
2023-12-07 11:51:51 -05:00
Austin Gebauer
766d5ed5f0 docs: adds saml to client count entity table (#24414) 2023-12-07 08:33:26 -08:00
Peter Wilson
cd8cc4ed96 updated setup/teardown audit code and ordering within broker registration (#24394)
* updated setup/teardown audit code and ordering within broker registration

* enable/disable audit: handle errors when attempting to register/deregister with the audit broker

* fix TestCore_MountTable_UpgradeToTyped

* missing context

* reinstated the missing Info log line, removed unrequired checks
2023-12-07 14:26:58 +00:00
Steven Clark
cbf6dc2c4f PKI refactoring to start breaking apart monolith into sub-packages (#24406)
* PKI refactoring to start breaking apart monolith into sub-packages

 - This was broken down by commit within enterprise for ease of review
   but would be too difficult to bring back individual commits back
   to the CE repository. (they would be squashed anyways)
 - This change was created by exporting a patch of the enterprise PR
   and applying it to CE repository

* Fix TestBackend_OID_SANs to not be rely on map ordering
2023-12-07 09:22:53 -05: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
miagilepner
959d548ac6 Add PATCH to CORS allowed request methods (#24373)
* add PATCH to cors request methods

* changelog
2023-12-07 11:27:35 +01: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
claire bontempo
94ca1ebaab add a tags to breadcrumb test selectors (#24410) 2023-12-06 20:51:44 +00:00
Meggie
2aaeb55a4d Clarify Vault versions, some upgrade guidance (#24396)
* Creating a Vault version explainer

The explainer is a partial that can be used on multiple pages. It gives an overview of our policies and version format and offers some recommendations about staying current.

* Apostrophe typo

Not saying I got all the typos, but got one anyway.

* Add a note about the very rare 4th digit

* Conform to subtitle best practices

Co-authored-by: Yoko Hyakuna <yoko@hashicorp.com>

---------

Co-authored-by: Yoko Hyakuna <yoko@hashicorp.com>
2023-12-06 15:36:48 -05:00
Austin Gebauer
1484253e0b identity/oidc: lazily generate default key (#24332)
* identity/oidc: lazily generate default key

* invalidate the key cache on lazy generation

* consistent error messages

* change key rotation test to check exact counts and add comments

* adds comments on ensureDefaultKey and lazyGenerateDefaultKey

* adds comment on holding write lock
2023-12-06 12:04:11 -08:00
claire bontempo
3403203471 UI: HDS adoption replace Breadcrumbs (#24387)
* upgrade to 3.1.0

* VAULT-22471 upgrade to latest version

* fix other selectors

* fix pki tests

* fix copy dropdown

* generated breadcrumbs

* mfa crumbs

* oidc crumbs

* identity crumbs

* use hds crumbs in page::breadcrumbs file

* rename selectors to be consistent

* remaining oidc

* update empty state link style to match hds

* repl empty state

* rep empty state 2

* policy and secret error template

* replace yielded KeyValueHeader elements directly with HDS breadcrumbs

* remove yield from KeyValueHeader

* use key value header in secret header

* update pki header

* kmip breadcrumbs

* replace key-value-header classes

* ssh sign

* replace key value with breadcrumbs

* update selectors part 1

* add a tags

* policy tests

* add crumb index back

* add current route to generated item

* another round of test updates

* remove root link test selector

* secrets/secrete test

* add changelog

* trailing icon

* delete breadcrumb css

* consistently change to sentence case

* titlsecase!
2023-12-06 10:56:01 -08:00
Ikko Eltociear Ashimine
5bb1451f94 Fix typo in seal.go (#24392)
succesful -> successful
2023-12-06 08:48:32 -05:00
Peter Wilson
7e37f7690d update testing 'initCores' to enable audit after all unsealing and before enabling KV (#24395) 2023-12-06 12:39:06 +00:00
claire bontempo
8f69e49592 UI: HDS Adoption upgrade to design-system-components: 3.3.0 and ember-flight-icons: 4.0.4 (#24366)
* upgrade to 3.1.0

* VAULT-22471 upgrade to latest version

* fix other selectors

* fix pki tests

* fix copy dropdown

* rename selectors to be consistent
2023-12-05 13:49:36 -08:00
Chelsea Shaw
588dd73fe0 UI: handle reduced disclosure on replication endpoints (#24379)
* add replicationRedacted attribute to cluster model

* disallow access to replication pages if repl endpoints are redacted

* hide replicatio nav item

* Hide replication card on dashboard
2023-12-05 14:31:29 -06:00
Steven Clark
a41852379b Document and augment tests that PKI accepts 8192 bit RSA keys (#24364)
- Noticed that our documentation was out of date, we allow 8192
   bit RSA keys to be used as an argument to the various PKI
   issuer/key creation APIs.
 - Augument some unit tests to verify this continues to work
2023-12-05 15:26:03 -05:00