Commit Graph

510 Commits

Author SHA1 Message Date
hc-github-team-secure-vault-core
d20526b09b backport of commit bcbd45b380 (#24197)
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2023-11-20 16:09:12 +00:00
hc-github-team-secure-vault-core
85014f9869 Fix Transit managed key fixes - OSS (#23676) (#23678)
- This is the OSS parts of the greater enterprise PR to address some
   issues with signing and encryption within Transit using managed keys.

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
2023-10-16 20:31:20 +00:00
Scott Miller
8abe3cd68b Reject supplied nonces for non-convergent encryption operations (#22852) (#22901)
* Reject supplied nonces for non-convergent encryption operations (#22852)

Backport to 1.13.x

* need http after all
2023-09-08 09:59:21 -05:00
hc-github-team-secure-vault-core
fa9c963140 Backport of Add worker pool for LDAP group lookup into release/1.13.x (#22703)
* Add worker pool for LDAP group lookup (#22659)

* Add worker pool for LDAP group lookup

* changelog

* Add lock

* derefAliases disappeared

* Remove deref

* fmt

---------

Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>
2023-09-01 12:25:28 +00:00
hc-github-team-secure-vault-core
37be278f41 backport of commit cccfdb088f (#22595)
Co-authored-by: Ellie <ellie.sterner@hashicorp.com>
2023-08-28 18:18:17 -05:00
Josh Black
f74ad76ad2 go mod tidy (#22508) 2023-08-22 19:59:20 +00:00
Josh Black
8e68410860 OSS changes for https://github.com/hashicorp/vault-enterprise/pull/4585 (#22501) 2023-08-22 10:27:06 -07:00
hc-github-team-secure-vault-core
b98455b2c2 backport of commit d50bd4eb05 (#22485)
Co-authored-by: Josh Black <raskchanky@gmail.com>
2023-08-21 22:19:25 +00:00
hc-github-team-secure-vault-core
4664765025 backport of commit 5374b3b046 (#22365)
Co-authored-by: Hamid Ghaf <83242695+hghaf099@users.noreply.github.com>
2023-08-16 07:16:24 -07:00
hc-github-team-secure-vault-core
2ecd2f43af backport of commit f8dd46acb8 (#22252) 2023-08-08 21:07:10 +00:00
Alexander Scheel
2f634f7a11 Move OCSP/PKI interop test to PKI engine (#20273) (#21291)
This prevents SDK from having a circular import on the main Vault
package.

Manual backport due to import conflicts.

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-06-15 20:26:46 +00:00
Mike Palmiotto
b4a9266b1f Bump protoc-gen-go to v1.29.1 (#21101) 2023-06-15 11:29:49 -04:00
hc-github-team-secure-vault-core
9a317e2101 backport of commit 58f029d608 (#21239)
Co-authored-by: Victor Rodriguez <vrizo@hashicorp.com>
2023-06-14 22:23:44 +00:00
hc-github-team-secure-vault-core
074e72c742 backport of commit 65157a6d3f (#21180)
Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
2023-06-13 17:39:21 +00:00
Josh Black
3ef4a14a9e OSS changes for fixing bug in update-primary (#21119) (#21125)
* OSS changes for fixing bug in update-primary (#21119)

* whoops
2023-06-12 18:47:08 +00:00
hc-github-team-secure-vault-core
71433b9fc7 backport of commit be4979dfbb (#21002)
Co-authored-by: Anton Averchenkov <84287187+averche@users.noreply.github.com>
2023-06-05 23:47:27 +00:00
hc-github-team-secure-vault-core
6daa1bd468 backport of commit e65d295c88 (#20905)
Co-authored-by: Max Bowsher <maxbowsher@gmail.com>
2023-05-31 19:46:49 +00:00
hc-github-team-secure-vault-core
d59a1ed3c4 backport of commit daf72aa427 (#20901)
Removed byok test; this is unfortunate as it was the strongest
exerciser of this, but sadly it doesn't exist in 1.13 and previous
versions.

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-05-31 19:11:18 +00:00
hc-github-team-secure-vault-core
5e0cc29c11 pki: add subject key identifier to read key response (#20642) (#20658)
* pki: add subject key identifier to read key response

This will be helpful for the Terraform Vault Provider to detect
migration of pre-1.11 exported keys (from CA generation) into post-1.11
Vault.

* add changelog

* Update builtin/logical/pki/path_fetch_keys.go



* check for managed key first

* Validate the SKID matches on root CAs



* Validate SKID matches on int CAs



* Fix formatting of tests



---------

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
Co-authored-by: John-Michael Faircloth <fairclothjm@users.noreply.github.com>
Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-05-19 12:20:27 +00:00
hc-github-team-secure-vault-core
b7288016b6 backport of commit db5f416476 (#20649)
Co-authored-by: Hamid Ghaf <83242695+hghaf099@users.noreply.github.com>
2023-05-18 12:42:56 +00:00
hc-github-team-secure-vault-core
107bd9e8e6 Correct Default for MaximumPageSize (#20453) (#20639)
* default max page size for config

* Add changelog

* update test int to *int

* add testing defaults

* update default to -1, i.e. dont paginate

* update test

* Add error message for invalid search

* Make 0 the default

* cleanup

* Add to known issues doc

* Update website/content/docs/upgrading/upgrade-to-1.13.x.mdx

* Update website/content/docs/upgrading/upgrade-to-1.11.x.mdx



* Update website/content/docs/upgrading/upgrade-to-1.13.x.mdx



* Update website/content/docs/upgrading/upgrade-to-1.12.x.mdx



* Add workaround to docs

* Update changelog/20453.txt



---------

Co-authored-by: Luis (LT) Carbonell <lt.carbonell@hashicorp.com>
Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>
Co-authored-by: Austin Gebauer <34121980+austingebauer@users.noreply.github.com>
2023-05-17 18:24:38 -05:00
hc-github-team-secure-vault-core
a27080bf73 backport of commit dee7fd839e (#20527)
Co-authored-by: Pratyoy Mukhopadhyay <35388175+pmmukh@users.noreply.github.com>
2023-05-05 06:39:51 -07:00
hc-github-team-secure-vault-core
740344bc05 backport of commit d51ae039b2 (#20423)
Co-authored-by: Josh Black <raskchanky@users.noreply.github.com>
2023-04-28 10:06:11 -07:00
hc-github-team-secure-vault-core
fc1bbf436f Backport of Add Configurable LDAP Max Page Size into release/1.13.x (#20283)
* Add Configurable LDAP Max Page Size (#19032)

* Add config flag for LDAP max page size

* Add changelog

* move changelog to correct file

* cleanup

* Default to non-paged searching for with -1

* Update website/content/api-docs/auth/ldap.mdx

Co-authored-by: Austin Gebauer <34121980+austingebauer@users.noreply.github.com>

* Update website/content/docs/auth/ldap.mdx

Co-authored-by: Austin Gebauer <34121980+austingebauer@users.noreply.github.com>

* Update tests

---------

Co-authored-by: Austin Gebauer <34121980+austingebauer@users.noreply.github.com>

* remove

---------

Co-authored-by: Luis (LT) Carbonell <lt.carbonell@hashicorp.com>
Co-authored-by: Austin Gebauer <34121980+austingebauer@users.noreply.github.com>
2023-04-20 17:07:15 -05:00
hc-github-team-secure-vault-core
d8cf0fe646 backport of commit d5584b614a (#20215)
Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>
2023-04-17 22:00:22 +00:00
hc-github-team-secure-vault-core
8a3c372f08 sdk/ldaputil: add connection_timeout configurable (#20144) (#20148)
* sdk/ldaputil: add connection_timeout configurable

* changelog

* Update doc

* Fix test

* Change default to 30s

Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>
2023-04-17 21:18:38 +00:00
hc-github-team-secure-vault-core
b8997a73ce backport of commit 17a2827894 (#20199)
Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-04-17 16:13:05 +00:00
hc-github-team-secure-vault-core
96b884b22f backport of commit 09d58d1858 (#19636)
Co-authored-by: Anton Averchenkov <84287187+averche@users.noreply.github.com>
2023-03-20 20:47:13 +00:00
hc-github-team-secure-vault-core
435824c26c backport of commit e6427b2b30 (#19620)
Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
2023-03-20 13:27:45 +00:00
hc-github-team-secure-vault-core
8545876076 backport of commit 3adb416da1 (#19352)
Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-02-24 13:45:19 -05:00
hc-github-team-secure-vault-core
5176a3c287 Backport of Update x/net and x/crypto/ssh into release/1.13.x (#19285)
* Update x/net and x/crypto/ssh

* go mod tidy

---------

Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
2023-02-22 17:16:04 +00:00
hc-github-team-secure-vault-core
6ae50fee93 backport of commit add3659f39 (#19242)
Co-authored-by: Scott Miller <smiller@hashicorp.com>
2023-02-17 14:44:12 -06:00
hc-github-team-secure-vault-core
c9eb3c7251 events: WS protobuf messages should be binary (#19232) (#19256)
The [WebSockets spec](https://www.rfc-editor.org/rfc/rfc6455) states
that text messages must be valid UTF-8 encoded strings, which protobuf
messages virtually never are. This now correctly sends the protobuf events
as binary messages.

We change the format to correspond to CloudEvents, as originally intended,
and remove a redundant timestamp and newline.

We also bump the eventlogger to fix a race condition that this code triggers.

Co-authored-by: Christopher Swenson <christopher.swenson@hashicorp.com>
2023-02-17 20:14:48 +00:00
hc-github-team-secure-vault-core
af665758f5 backport of commit 34b3d0406d (#19136)
Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
2023-02-10 14:22:33 -05: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
Scott Miller
91b458d8a6 Update specific wrappers to v2.0.7 (#19101)
* Update go-kms-wrapping to v2.0.7

* Update specific wrappers to v2.0.7

* Attempt to fix aead
2023-02-09 12:19:50 -06:00
Nick Cabatoff
e0d726ac22 Remove the last vestiges of sdk/version. (#19068) 2023-02-08 12:30:27 -05:00
Nick Cabatoff
192baa88db Make API not depend on SDK (#18962) 2023-02-06 09:41:56 -05:00
Christopher Swenson
80485f927b Add events sending routed from plugins (#18834)
This isn't perfect for sure, but it's solidifying and becoming a useful
base to work off.

This routes events sent from auth and secrets plugins to the main
`EventBus` in the Vault Core. Events sent from plugins are automatically
tagged with the namespace and plugin information associated with them.
2023-02-03 13:24:16 -08:00
Anton Averchenkov
6a9ca261d1 openapi: Add default values to the thing_mount_path parameters (#18935) 2023-01-31 19:37:16 -05:00
Max Bowsher
fd9cadb192 Fix multiple OpenAPI generation issues with new AST-based generator (#18554)
* Regexp metacharacter `.` should be escaped when used literally

The paths including `/.well-known/` in the Vault API could currently
technically be invoked with any random character in place of the dot.

* Replace implementation of OpenAPI path translator with regexp AST-based one

* Add changelog

* Typo fix from PR review - thanks!

Co-authored-by: Anton Averchenkov <84287187+averche@users.noreply.github.com>

* Add comment based on review feedback

* Change style of error handling as suggested in code review

* Make a further tweak to the handling of the error case

* Add more tests, testing cases which fail with the previous implementation

* Resolve issue with a test, and improve comment

---------

Co-authored-by: Anton Averchenkov <84287187+averche@users.noreply.github.com>
2023-01-31 16:27:39 -05:00
Steven Clark
6f0552c0e3 Address pki::TestAutoRebuild flakiness (#18903)
* Address pki::TestAutoRebuild flakiness

 - Wait for a CRL change before progressing to the next step after
   we change configuration. Prior to this we would be racing against
   the CRL reloading from the configuration change.
2023-01-30 21:38:38 +00:00
Matt Schultz
564357f1f9 Add some managed key build tags to support incoming enterprise feature work. (#18902) 2023-01-30 14:57:01 -06:00
Rachel Culpepper
d228e62b51 Vault-11713: Add the ability for transit to use managed keys (#18844)
* add the ability for transit to use managed keys

* add fields for rotate

* reorganize managed keys for better error messaging

* add aad for managed keys

* change encrypting key interface

* fix import error

* fix fmt errors

* move managed key rotation to a separate function

* fix fmt issue

* fix import error

* fix go.mod issue

* fix go.mod

* remove extra rotate param

* fix locking issue in rotation

* fix errors in policy tests

* move managed key params to fit existing policy functions

* fix sign and verify

* fix policy tests

* fix test error
2023-01-27 13:39:58 -06:00
Nick Cabatoff
7a0c055c2a Proposed more streamlined approach to validating schema responses. (#18865) 2023-01-27 14:34:55 -05:00
Kit Haines
b6b0713c35 Vault 9406 enablement certs need userid handling in role (#18397)
* The fields.

* UserID set, add to certificate

* Changelog.

* Fix test (set default).

* Add UserID constant to certutil, revert extension changes

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

* Add user_ids as field for leaf signing

Presumably, this isn't necessary for CAs, given that CAs probably don't
have a user ID corresponding to them.

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

* Support setting multiple user_ids in Subject

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

* Allow any User ID with sign-verbatim

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

* Add tests for User IDs in PKI

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

* Add docs about user_ids, allowed_user_ids

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

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-01-25 13:13:54 -05:00
Matt Schultz
0758a70788 Adds managed key usages for MAC generate/verify and RNG. (#18291)
* Adds managed key usages for MAC generate/verify and RNG.

* Remove MAC-related key usages from managed key in favor of sign/verify.

* Remove context from random source managed key interface.
2023-01-24 13:25:09 -06:00
Hamid Ghaf
46b9921aae Allow Token Create Requests To Be Replicated (#18689)
* Allow Token Create Requests To Be Replicated

* adding a test

* revert a test
2023-01-24 14:00:27 -05:00
Anton Averchenkov
4a6bfc9eec Add approle's remaining response schema definitions (#18772) 2023-01-24 13:12:41 -05:00
Hamid Ghaf
e18fd32946 named Login MFA methods (#18610)
* named MFA method configurations

* fix a test

* CL

* fix an issue with same config name different ID and add a test

* feedback

* feedback on test

* consistent use of passcode for all MFA methods (#18611)

* make use of passcode factor consistent for all MFA types

* improved type for MFA factors

* add method name to login CLI

* minor refactoring

* only accept MFA method name with its namespace path in the login request MFA header

* fix a bug

* fixing an ErrorOrNil return value

* more informative error message

* Apply suggestions from code review

Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>

* feedback

* test refactor a bit

* adding godoc for a test

* feedback

* remove sanitize method name

* guard a possbile nil ref

Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
2023-01-23 15:51:22 -05:00