Commit Graph

36 Commits

Author SHA1 Message Date
Violet Hynes
210da8f705
Fix data race around static secret capability manager (#28653)
* Fix data race around static secret capability manager

* Actually, clone the map
2024-10-09 15:43:49 -04:00
Violet Hynes
6d66990cb6
Fix static secret caching race condition (#28494)
* Fix static ssecret caching data race

* Fix static ssecret caching data race

* Changelog
2024-09-24 14:08:48 -04:00
akshya96
06fac16a1e
Add maximum request duration (timeouts) for all requests except actual monitor and events requests (#28230)
* fix paths for sys/monitor and sys/events

* add changelog

* add changelog

* Update http/handler.go

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>

* added some modifications to check for timeout

---------

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-08-30 11:00:12 -07:00
Violet Hynes
bc7923ad29
VAULT-30219 Bug fix for race condition (#28228) 2024-08-30 09:45:58 -04:00
Violet Hynes
a5262e08bb
VAULT-30219 CE changes for versioned secret fix (#28207)
* VAULT-30219 CE changes for versioned secret fix

* Changelog
2024-08-28 11:29:06 -04:00
Brian Howe
cbc06c0856
ensure response is not nil before sanitizing (#27923)
Co-authored-by: akshya96 <87045294+akshya96@users.noreply.github.com>
2024-08-12 12:48:48 -07:00
idnandre
e26c246cbb
chore: fix deprecated ioutil readall (#27823)
Signed-off-by: idnandre <andre@idntimes.com>
2024-07-30 09:18:24 -04:00
Violet Hynes
b689fc62f1
VAULT-29198 CE side changes for Proxy update forwarding (#27891)
* VAULT-29198 CE side changes for Proxy update forwarding

* VAULT-29198 changelog
2024-07-29 12:58:55 -04:00
Violet Hynes
b9c892f8aa
VAULT-28656 CE changes for Proxy bug (#27730)
* VAULT-28656 CE changes for Proxy bug

* VAULT-28656 changelog

* VAULT-28656 rename changelog
2024-07-10 09:38:51 -04:00
idnandre
b833d4714d
chore: fix deprecated ioutil nopcloser (#27650)
Signed-off-by: idnandre <andre@idntimes.com>
2024-07-03 13:38:34 -04:00
Violet Hynes
f2b4ca4def
VAULT-24736 CE changes for static secret capability behaviour toggle (#26744) 2024-05-03 14:12:19 -04: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
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
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
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
fbfe661a08
VAULT-24386 better erroring for Proxy static secret caching for CE (#25661) 2024-02-27 10:47: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
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
1cb960d0f7
Fix data race with readable paths in our tests (#25127)
* Fix data race with readable paths in our tests

* Actually fix the issue
2024-01-30 14:33:06 +00:00
Violet Hynes
a649d2b9a9
VAULT-17292 CE portion of changes (#24667)
* VAULT-17292 CE portion of changes

* VAULT-17292 docs

* VAULT-17292 changelog
2024-01-04 13:01:38 -05:00
Violet Hynes
879f9c9bfd
Fix flaky restore test (#24490) 2023-12-12 10:27:26 -05:00
Violet Hynes
ef3021f1a4
Fix bug in static secret caching where no token is present in a request to Proxy (#24287) 2023-11-29 09:35:59 -05:00
Nick Cabatoff
1bf366ccdc
Use our fork of bbolt to improve freelist performance (#24010) 2023-11-21 10:08:18 -05:00
Violet Hynes
91ab8a5178
Add a sleep to give the event system time to start (#24141) 2023-11-15 10:33:27 -05:00
Violet Hynes
3e054cbd4c
VAULT-19239 Add capability to disable dynamic secret caching for Vault Proxy (#23801)
* VAULT-19239 create disable static secret caching config

* VAULT-19239 missed file

* VAULT-19239 didn't finish a log line

* VAULT-19239 adjust test to use new option

* Fix typo

Co-authored-by: Kuba Wieczorek <kuba.wieczorek@hashicorp.com>

---------

Co-authored-by: Kuba Wieczorek <kuba.wieczorek@hashicorp.com>
2023-11-15 09:11:10 -05:00
Violet Hynes
d7403d2790
VAULT-19275 Add pre-event stream static secret update mechanism (#23719)
* VAULT-19275 Add pre-event stream static secret update mechanism

* VAULT-19275 fix multierror append

* VAULT-19275 review updates
2023-11-09 13:56:29 -05:00
Violet Hynes
fd2c737c51
Fix lifetime watcher user agent reporting Vault Agent for Vault Proxy requests (#23944) 2023-11-03 10:24:43 -04:00
Violet Hynes
363557d045
VAULT-19232 Add static secret capability manager to Vault Proxy (#23677)
* VAULT-19232 static secret capability manager so far

* VAULT-19232 mostly finish renewal job logic

* VAULT-19232 some clean up, tests, etc

* VAULT-19232 integrate capability manager with proxy, add E2E test

* VAULT-19232 boltdb stuff

* VAULT-19232 finishing touches

* VAULT-19232 typo

* VAULT-19232 add capabilities index cachememdb tests

* Remove erroneous "the"

Co-authored-by: Kuba Wieczorek <kuba.wieczorek@hashicorp.com>

---------

Co-authored-by: Kuba Wieczorek <kuba.wieczorek@hashicorp.com>
2023-10-25 16:43:24 -04:00
Violet Hynes
d88c06ecaa
VAULT-19255 - Add event based static secret cache updater to Vault Proxy (#23560)
* VAULT-19255 first pass at structure for event updater

* VAULT-19255 some more work, committign before rebase

* VAULT-19255 Mostly finish event updating scaffolding

* VAULT-19255 some additional coverage, clean-up, etc

* VAULT-19255 some clean-up

* VAULT-19255 fix tests

* VAULT-19255 more WIP event system integration

* VAULT-19255 More WIP

* VAULT-19255 more discovery

* VAULT-19255 add new test, some clean up

* VAULT-19255 fix bug, extra clean-up

* VAULT-19255 fix bugs, and clean up

* VAULT-19255 clean imports, add more godocs

* VAULT-19255 add config for test

* VAULT-19255 typo

* VAULT-19255 don't do the kv refactor in this PR

* VAULT-19255 update docs

* VAULT-19255 PR feedback

* VAULT-19255 More specific error messages
2023-10-16 10:14:36 -04:00
Violet Hynes
1e132479f0
VAULT-19233 Second part of caching static secrets work (#23177)
* VAULT-19237 Add mount_type to secret response

* VAULT-19237 changelog

* VAULT-19237 make MountType generic

* VAULT-19237 clean up comment

* VAULT-19237 update changelog

* VAULT-19237 update test, remove mounttype from wrapped responses

* VAULT-19237 fix a lot of tests

* VAULT-19237 standby test

* ensure -log-level is added to core config (#23017)

* Feature/document tls servername (#22714)

* Add Raft TLS Helm examples

Co-authored-by: Pascal Reeb <pascal.reeb@adfinis.com>
---------

* Clean up unused CRL entries when issuer is removed (#23007)

* Clean up unused CRL entries when issuer is removed

When a issuer is removed, the space utilized by its CRL was not freed,
both from the CRL config mapping issuer IDs to CRL IDs and from the
CRL storage entry. We thus implement a two step cleanup, wherein
orphaned CRL IDs are removed from the config and any remaining full
CRL entries are removed from disk.

This relates to a Consul<->Vault interop issue (#22980), wherein Consul
creates a new issuer on every leadership election, causing this config
to grow. Deleting issuers manually does not entirely solve this problem
as the config does not fully reclaim space used in this entry.

Notably, an observation that when deleting issuers, the CRL was rebuilt
on secondary clusters (due to the invalidation not caring about type of
the operation); for consistency and to clean up the unified CRLs, we
also need to run the rebuild on the active primary cluster that deleted
the issuer as well.

This approach does allow cleanup on existing impacted clusters by simply
rebuilding the CRL.

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>

* Add test case on CRL removal

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

* Add changelog entry

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

---------

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>

* UI: Handle control group error on SSH (#23025)

* Handle control group error on SSH

* Add changelog

* Fix enterprise failure of TestCRLIssuerRemoval (#23038)

This fixes the enterprise failure of the test
 ```
  === FAIL: builtin/logical/pki TestCRLIssuerRemoval (0.00s)
     crl_test.go:1456:
         	Error Trace:	/home/runner/actions-runner/_work/vault-enterprise/vault-enterprise/builtin/logical/pki/crl_test.go:1456
         	Error:      	Received unexpected error:
         	            	Global, cross-cluster revocation queue cannot be enabled when auto rebuilding is disabled as the local cluster may not have the certificate entry!
         	Test:       	TestCRLIssuerRemoval
         	Messages:   	failed enabling unified CRLs on enterprise

 ```

* fix LDAP auto auth changelog (#23027)

* VAULT-19233 First part of caching static secrets work

* VAULT-19233 update godoc

* VAULT-19233 invalidate cache on non-GET

* VAULT-19233 add locking to proxy cache writes

* VAULT-19233 add caching of capabilities map, and some additional test coverage

* VAULT-19233 Additional testing

* VAULT-19233 namespaces for cache ids

* VAULT-19233 cache-clear testing and implementation

* VAULT-19233 adjust format, add more tests

* VAULT-19233 some more docs

* VAULT-19233 Add RLock holding for map access

* VAULT-19233 PR comments

* VAULT-19233 Different table for capabilities indexes

* VAULT-19233 keep unique for request path

* VAULT-19233 passthrough for non-v1 requests

* VAULT-19233 some renames/PR comment updates

* VAULT-19233 remove type from capabilities index

* VAULT-19233 remove obsolete capabilities

* VAULT-19233 remove erroneous capabilities

* VAULT-19233 woops, missed a test

* VAULT-19233 typo

* VAULT-19233 add custom error for cachememdb

* VAULT-19233 fix cachememdb test

---------

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
Co-authored-by: Chris Capurso <1036769+ccapurso@users.noreply.github.com>
Co-authored-by: Andreas Gruhler <andreas.gruhler@adfinis.com>
Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
Co-authored-by: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com>
2023-10-06 14:44:43 -04:00
Violet Hynes
54c84decfd
VAULT-19233 First part of caching static secrets work (#23054)
* VAULT-19233 First part of caching static secrets work

* VAULT-19233 update godoc

* VAULT-19233 invalidate cache on non-GET

* VAULT-19233 add locking to proxy cache writes

* VAULT-19233 update locking, future-proof

* VAULT-19233 fix mutex

* VAULT-19233 Use ParseSecret
2023-09-22 10:57:38 -04:00
hashicorp-copywrite[bot]
0b12cdcfd1
[COMPLIANCE] License changes (#22290)
* Adding explicit MPL license for sub-package.

This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository.

* Adding explicit MPL license for sub-package.

This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository.

* Updating the license from MPL to Business Source License.

Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at https://hashi.co/bsl-blog, FAQ at www.hashicorp.com/licensing-faq, and details of the license at www.hashicorp.com/bsl.

* add missing license headers

* Update copyright file headers to BUS-1.1

* Fix test that expected exact offset on hcl file

---------

Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
Co-authored-by: Sarah Thompson <sthompson@hashicorp.com>
Co-authored-by: Brian Kassouf <bkassouf@hashicorp.com>
2023-08-10 18:14:03 -07:00
Ville Vesilehto
eefd4529e9
chore: avoid unnecessary byte/string conversion calls (#21854)
* chore: avoid unnecessary conversion calls

* add changelog entry

---------

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2023-08-08 17:50:54 +00:00
Nick Cabatoff
c14c2cf6bd
Stop passing in loggers to clusters explicitly (#21999) 2023-07-24 10:51:02 -04:00
Violet Hynes
3d7d8f4965
VAULT-15547 Agent/proxy decoupling, take two (#20634)
* VAULT-15547 Additional tests, refactoring, for proxy split

* VAULT-15547 Additional tests, refactoring, for proxy split

* VAULT-15547 Import reorganization

* VAULT-15547 Some missed updates for PersistConfig

* VAULT-15547 address comments

* VAULT-15547 address comments
2023-05-19 13:17:48 -04:00
Violet Hynes
6b4b0f7aaf
VAULT-15547 First pass at agent/proxy decoupling (#20548)
* VAULT-15547 First pass at agent/proxy decoupling

* VAULT-15547 Fix some imports

* VAULT-15547 cases instead of string.Title

* VAULT-15547 changelog

* VAULT-15547 Fix some imports

* VAULT-15547 some more dependency updates

* VAULT-15547 More dependency paths

* VAULT-15547 godocs for tests

* VAULT-15547 godocs for tests

* VAULT-15547 test package updates

* VAULT-15547 test packages

* VAULT-15547 add proxy to test packages

* VAULT-15547 gitignore

* VAULT-15547 address comments

* VAULT-15547 Some typos and small fixes
2023-05-17 09:38:34 -04:00