Commit Graph

1688 Commits

Author SHA1 Message Date
Bianca Moreira
39752b870a Add high privilege namespace (#21215) (#21647) 2023-07-07 16:03:41 +02:00
hc-github-team-secure-vault-core
a212330c7b backport of commit f12c128559 (#21347)
Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
2023-06-19 11:40:05 -04:00
Anton Averchenkov
9b308bebe4 Backport of agent: Fix bug with 'cache' stanza validation into release/1.13.x 2023-06-14 21:41:03 +00:00
Mike Palmiotto
fa4153dc1f backports for ActivityLog and Reporting 1.13.x (#21140)
* backport of commit 9f7f8d5bfa

* backport of commit e3c59773e9

* backport of commit b4fab6ac2a

* backport of commit 54904e4cd6

* backport of commit 4b6ec4079d

* backport of commit 05ba6bbddd

* backport of commit 002a59a370

* backport of commit 77f83d9fe8

* backport of commit 730d0e2821

* backport of commit 35e2c1665f

* backport of commit 810d504e4f

* backport of commit 5b23dd506f

* backport of commit 018ea84997

* backport of commit 541f18eeb7

* backport of commit b4e2751a09

* backport of commit dc5dd71c72

* backport of commit 5002489d27

---------

Co-authored-by: miagilepner <mia.epner@hashicorp.com>
Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
2023-06-14 17:07:26 -04:00
hc-github-team-secure-vault-core
1720d3172d backport of commit 0115b5e43a (#20963)
Co-authored-by: Mike Baum <mike.baum@hashicorp.com>
2023-06-02 14:17:30 -04:00
hc-github-team-secure-vault-core
9f18485744 backport of commit 360a406a2f (#20927)
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2023-06-01 14:34:06 +00:00
hc-github-team-secure-vault-core
e07a17afe8 backport of commit 1336abddfe (#20796)
Co-authored-by: Larroyo <95649169+DeLuci@users.noreply.github.com>
2023-05-25 21:05:29 +00:00
hc-github-team-secure-vault-core
99f55c11be backport of commit 00855a9e7a (#20622)
Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>
2023-05-17 12:27:03 -04:00
hc-github-team-secure-vault-core
a6c5b15390 backport of commit c93f4aa6d0 (#20543)
Co-authored-by: Hamid Ghaf <83242695+hghaf099@users.noreply.github.com>
2023-05-08 09:55:42 -07:00
hc-github-team-secure-vault-core
17e127d22b backport of commit fb9324c3c9 (#20514)
Co-authored-by: Hamid Ghaf <83242695+hghaf099@users.noreply.github.com>
2023-05-04 08:37:30 -07:00
hc-github-team-secure-vault-core
657c287221 backport of commit 9ae8f48f9b (#20420)
Co-authored-by: Peter Wilson <peter.wilson@hashicorp.com>
2023-04-28 15:50:58 +00:00
hc-github-team-secure-vault-core
cbf312bbb0 backport of commit ca702745e8 (#20175)
Co-authored-by: Chris Capurso <1036769+ccapurso@users.noreply.github.com>
Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>
2023-04-21 19:46:24 +00:00
hc-github-team-secure-vault-core
6a6444e607 backport of commit b0289d4472 (#20288)
Co-authored-by: miagilepner <mia.epner@hashicorp.com>
2023-04-21 09:48:22 +00:00
hc-github-team-secure-vault-core
758cf7531d backport of commit 98786d96c7 (#20250)
Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>
2023-04-19 13:59:40 +00:00
miagilepner
5d13255607 Revert "backport of commit b4fab6ac2a (#20117)" (#20142)
This reverts commit 57086ad4cd.
2023-04-13 14:38:31 +00:00
hc-github-team-secure-vault-core
57086ad4cd backport of commit b4fab6ac2a (#20117)
Co-authored-by: miagilepner <mia.epner@hashicorp.com>
2023-04-12 12:40:17 -04:00
Kuba Wieczorek
8fb3860e7d Update TestDebugCommand_NoConnection to work when run in an environment with working Vault (#19942) 2023-04-03 16:32:23 +00:00
Marc Boudreau
b500045c29 Backport all GHA Migration Changes to release/1.13.x Branch (#19767)
* backport all gha migration changes to release/1.13.x

* remove the .circleci directory

* remove references to circleci configuration from pre-commit hook

* remove reference to .circleci in Makefile

* port change to how gofumpt is executed in Makefile

* add gotestsum to tools/tools.go

* remove postgresql/scram package from generate-test-package-lists.sh since it didn't exist in release 1.13 or earlier

* blank out environment variables to allow test to properly function

* use go:embed to load files into test

---------

Co-authored-by: Kuba Wieczorek <kuba.wieczorek@hashicorp.com>
2023-03-30 11:00:02 -04:00
hc-github-team-secure-vault-core
dd63028d00 backport of commit 9f8d831d94 (#19492)
Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2023-03-09 10:41:40 -05:00
hc-github-team-secure-vault-core
b3dc15fe74 backport of commit ba013912b1 (#19396)
Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-02-28 15:12:36 +00:00
hc-github-team-secure-vault-core
a5edc66098 backport of commit d35be2d0de (#19375)
Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-02-27 13:52:36 -05:00
hc-github-team-secure-vault-core
c496011eed backport of commit d08bf5616d (#19347)
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2023-02-24 14:11:43 -05:00
hc-github-team-secure-vault-core
6a73f37ba4 backport of commit 20b347e3cd (#19315)
Co-authored-by: miagilepner <mia.epner@hashicorp.com>
2023-02-23 19:29:52 +01:00
hc-github-team-secure-vault-core
d21564e539 backport of commit 7d52daf715 (#19308)
Co-authored-by: Peter Wilson <peter.wilson@hashicorp.com>
2023-02-23 17:13:14 +00:00
hc-github-team-secure-vault-core
871dd067e3 backport of commit fe7eedafc3 (#19286)
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2023-02-22 14:32:18 +00:00
hc-github-team-secure-vault-core
8cad3a3426 backport of commit 1b33b99253 (#19275)
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2023-02-21 15:15:16 -05:00
hc-github-team-secure-vault-core
88e9f55199 backport of commit 9c4e65986f (#19273)
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2023-02-21 19:24:22 +00:00
hc-github-team-secure-vault-core
8ffa334946 backport of commit 4ea5c581ad (#19268)
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2023-02-21 14:18:22 +00:00
hc-github-team-secure-vault-core
e53ac2633b backport of commit 100ec9a700 (#19203)
Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-02-20 20:03:17 +00:00
hc-github-team-secure-vault-core
02bc25417a Trap errors related to vault pki list-intermediate issuer reading (#19165) (#19177)
* Rename files to match test suite and existing pattern

* Factor out issuer loading into a dedicated function

 - Add a little more checks/validation when loading the a PKI issuer
 - Factor out the issuer loading into a dedicated function
 - Leverage existing health check code to parse issuer certificates

* Read parent issuer once instead of reloading it for every child

 - Read in our parent issuer once instead of running it for every child
   we want to compare against
 - Provides clearer error message that we have failed reading from which
   path to the end user

* PR Feedback

 - Rename a variable for clarity
 - Use readIssuer in the validation of the parent issuer within
   pkiIssuer
 - Add some missing return 1 statements in error handlers that had been
   missed

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2023-02-14 09:51:12 -05:00
hc-github-team-secure-vault-core
3e4710d7ad backport of commit d08de3e78e (#19178)
Co-authored-by: Kit Haines <khaines@mit.edu>
2023-02-14 14:23:50 +00:00
Christopher Swenson
6e233e567b events: Add websockets and command (#19057)
Also updates the event receieved to include a timestamp.
Websockets support both JSON and protobuf binary formats.

This can be used by either `wscat` or the new
`vault events subscribe`:

e.g.,
```sh
$ wscat -H "X-Vault-Token: $(vault print token)" --connect ws://127.0.0.1:8200/v1/sys/events/subscribe/abc?json=true
{"event":{"id":"5c5c8c83-bf43-7da5-fe88-fc3cac814b2e", "note":"testing"}, "eventType":"abc", "timestamp":"2023-02-07T18:40:50.598408Z"}
...
```

and

```sh
$ vault events subscribe abc
{"event":{"id":"5c5c8c83-bf43-7da5-fe88-fc3cac814b2e", "note":"testing"}, "eventType":"abc", "timestamp":"2023-02-07T18:40:50.598408Z"}
...
```

Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
2023-02-09 13:18:58 -08:00
mickael-hc
2eb11c0109 update diagnose command to no longer use docker (#19102)
docker dependency should no longer be included in the binary
2023-02-09 11:59:46 -05:00
Steven Clark
e32b4dccf1 Stop using title capitalization for PKI help (#19104)
- Match the existing vault kv capitalization scheme for Synopsis help of each sub-command.
 - A few small tweaks as well to the messages text in a few cases
2023-02-09 16:40:26 +00:00
miagilepner
13caa0842e VAULT-8436 remove <-time.After statements in for loops (#18818)
* replace time.After with ticker in loops

* add semgrep rule

* update to use timers

* remove stop
2023-02-06 17:49:01 +01:00
Nick Cabatoff
192baa88db Make API not depend on SDK (#18962) 2023-02-06 09:41:56 -05:00
Scott Miller
bf58843b0a Revert #18683 (#18942)
* Revert "Don't execute the seal recovery tests on ENT. (#18841)"

This reverts commit 990d3bacc2.

* Revert "Add the ability to unseal using recovery keys via an explicit seal option. (#18683)"

This reverts commit 2ffe49aab0.
2023-02-01 13:34:53 -06:00
Violet Hynes
68dbb925b7 VAULT-13056 fix leasecache usage, add test coverage (#18922)
* VAULT-13056 fix leasecache usage, add test coverage

* VAULT-13056 remove deprecated ioutil functions

* VAULT-13056 some test clean-up

* VAULT-13056 re-add environment variable thing

* VAULT-13056 add comment for clarity
2023-02-01 11:40:20 -05:00
Nick Cabatoff
970ed07b04 Vault test cluster helper refactorings, mostly audit related (#18928)
* Move some test helper stuff from the vault package to a new helper/testhelpers/corehelpers package.  Consolidate on a single "noop audit" implementation.
2023-02-01 08:33:16 -05:00
Alexander Scheel
9042643d63 Fix command.RunCustom(...) correctly (#18904)
* Revert "Remove t.Parallel() due to initialization race (#18751)"

This reverts commit ebcd653102.

We're going to fix this properly, running initCommands exactly once.

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

* Prevent parallel testing racing in initCommands(...)

When running initCommands(...) from multiple tests, they can potentially
race, causing a panic. Test callers needing to set formatting
information must use RunCustom(...) instead of directly invoking the
test backend directly. When using t.Parallel(...) in these top-level
tests, we thus could race.

This removes the Commands global variable, making it a local variable
instead as nothing else appears to use it. We'll update Enterprise to
add in the Enterprise-specific commands to the existing list.

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

---------

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-01-31 08:18:21 -05:00
Scott Miller
cd70976945 Transit Import Key CLI functionality (#18887)
* wip

* Transit byok cli

* It works!

* changelog

* document return codes

* Update command/transit_import_key.go

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

* make fmt

---------

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2023-01-30 12:46:57 -06:00
miagilepner
097bd046e0 VAULT-12833 Update prompts for the rekey command (#18892)
* update prompts for rekey command

* cleanup additional places with unseal/recovery keys
2023-01-30 16:51:01 +00:00
Kit Haines
e8c5f2aea0 Switch ed25519 keytype to ec keytype to make the fips build happy. (#18889) 2023-01-30 09:08:25 -05:00
Kit Haines
958a1c2a18 Vault 11798 vault cli issue intermediate (#18467)
* The verify-sign command in it's cleanest existing form.

* Working state

* Updates to proper verification syntax

Co-authored-by: 'Alex Scheel' <alex.scheel@hashicorp.com>

* make fmt

* Git CI caught some stuff.

* Base functionality.

* make fmt; changelog

* pki issue command.

* Make fmt. Changelog.

* Error Handling Is Almost A Tutorial

* What I thought empty issuers response fix would be.

* Some tests

* PR-review updates.

* make fmt.

* Fix null response data for listing empty issuers causing a crash.

* Update command/pki_list_children_command.go

Fix double specifier

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

* Add test for pki_list_children.

* Fix tests.

* Update descriptions for correctness based on PR reviews.

* make fmt.

* Updates based on PR feedback.

* Allow multiple arguements (space separated)

* Remove bad merge-thing.

* White-space hell fix change.

* Tests, and return information for issue ca

* Fix make fmt error introduced here: https://github.com/hashicorp/vault/pull/18876

* Update command/pki_issue_intermediate.go

Puncutation.

Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>

* Remove smart quotes for standard quotes.

* More information as part of the help text.

* Better help text.

* Add missing "/" into error message.

---------

Co-authored-by: 'Alex Scheel' <alex.scheel@hashicorp.com>
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2023-01-27 16:41:16 -05:00
Alexander Scheel
722c1c1d7d Small cleanup pki commands (#18877)
* Reflow pki list-intermediates help text, add args

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

* Reflow pki verify-sign help text, add args

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

* Simplify boolean checks across PKI commands

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

* Clean up pki list-intermediate arg text

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

* Rename list_children->list_intermediate to align with command

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

---------

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-01-27 16:37:42 +00:00
Kit Haines
416f8bd898 Vault 11796 vault cli list intermediates (#18463)
* Base functionality.

* make fmt; changelog

* What I thought empty issuers response fix would be.

* Fix null response data for listing empty issuers causing a crash.

* Update command/pki_list_children_command.go

Fix double specifier

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

* Add test for pki_list_children.

* Fix tests.

* Update descriptions for correctness based on PR reviews.

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2023-01-27 10:34:31 -05:00
Alexander Scheel
9d17887dce Shadow globally defined var to avoid race (#18856)
* Shadow globally defined var to avoid race

output is defined in format_test.go as a global variable, which the
login_test.go tests were unknowingly using. Since these tests execute in
parallel, under the correct circumstances, they'd race to write/read
from the same variable in separate tests.

Shadow to avoid the race.

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

* Remove global output variable from tests

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-01-26 16:47:42 +00:00
Kit Haines
be967f26f6 Vault 11795 vault cli verify s ign (#18437)
* The verify-sign command in it's cleanest existing form.

* Working state

* Updates to proper verification syntax

Co-authored-by: 'Alex Scheel' <alex.scheel@hashicorp.com>

* make fmt

* Git CI caught some stuff.

* Some tests

* PR-review updates.

* make fmt.

Co-authored-by: 'Alex Scheel' <alex.scheel@hashicorp.com>
2023-01-26 10:21:13 -05:00
Peter Wilson
37b1ab12d3 Parallel migration (#18815) (#18817)
* Parallel migration (#18815)
* flagParallel sanity check
* Attempt to use ErrGroups
* Updated docs
* Allow 'start' and 'max-parallel' together
* parallel flag renamed to max-parallel
* tests for start + parallel
* Removed permit pool
* Updated docs to make it clearer that a high setting might not be honored based on storage backend setting
* System dependent max int size
* Default max-parallel 1 => 10
* Test folder/paths updated

Co-authored-by: Tomasz Pawelczak <10206601+gites@users.noreply.github.com>
Co-authored-by: Mike Palmiotto <mike.palmiotto@hashicorp.com>
2023-01-25 15:19:45 +00:00
Violet Hynes
17be1024e4 VAULT-12564 Add new token_file auto-auth method (#18740)
* VAULT-12564 Work so far on token file auto-auth

* VAULT-12564 remove lifetime watcher struct modifications

* VAULT-12564 add other config items, and clean up

* VAULT-12564 clean-up and more tests

* VAULT-12564 clean-up

* VAULT-12564 lookup-self and some clean-up

* VAULT-12564 safer client usage

* VAULT-12564 some clean-up

* VAULT-12564 changelog

* VAULT-12564 some clean-ups

* VAULT-12564 batch token warning

* VAULT-12564 remove follow_symlink reference

* VAULT-12564 Remove redundant stat, change temp file creation

* VAULT-12564 Remove ability to delete token after auth
2023-01-24 16:09:32 -05:00