62 Commits

Author SHA1 Message Date
hashicorp-copywrite[bot]
166b3723ad [COMPLIANCE] Add/Update Copyright Headers 2026-05-11 04:50:47 +00:00
Vault Automation
8b448ab7af
Backport Delete cluster.Start for NewTestCluster clusters, and deprecate and clean up cluster.Cleanup for NewTestCluster clusters into ce/main (#14105)
* Delete cluster.Start for NewTestCluster clusters, and deprecate and clean up cluster.Cleanup for NewTestCluster clusters (#14014)

* progress

* more progress

* missed cleanup

* fix mistakes

* cleanup

* fix docker cleanup

* various fixes

* further fixes

* further cleanup

* the cleanup will continue until morale improves

* two morE

* more fixes

* how did I miss that

* new test cleanup

* update

* cleanup, attempt small de-flake

* fix and extra cleanup

* some docker cleanup

* newlines

* some testwaitactives

* CE changes

---------

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2026-04-21 09:33:14 -04:00
Vault Automation
e018b0c436
Implement PKIPublicCA config parsing and handling (#12363) (#13368)
* Update config.go

* added validation and parsing

* tests

* move pki external config structs and validation into separate file

* update copywrite

* update configuration

* updates

* Moved tests to pki_external_config.go, comments, refactoring

* refactor

* add tests

* linter fix

* Consolidate to table tests

* consolidate to table tests

* remove APIVersion from PKIExternalCA

* added comments for explaining each struct

* Added ParsePKIExternalCA Test

* Update tests

* Added remaining constraints

* Added destination.template field

* changes

* Added validateListenerAddr

* refactor

* more comments

* changes

* Check for duplicates across blocks

* Make RSA bits a required field

* moved template to the top level

* added comment for test explanation

* move template to the top level

* Move pki config into pkiexternalca directory

* fix linting error

* move pkiconfig back into config folder

* fix failing unit tests

* added comments

* update to preserve order of templatePKIExternalCARefs

* Added comment descriptions for each struct member

* update to include warning

* bring in warning logger from upstream into the pki config parser

* Set default umask to 077

* added comments to each field in agent config

* execute tests in parallel

* combine tests into Validate

* Use assertion error func for tests

* assert error strings

* Removed warning for now

* removed normalization on values during validation

* added tests to ensure that user values are not overridden

* remove testparse

* Update command/agent/config/config.go



* change improvement to feature in changelog

* updated to add line number in error

* Added _ent suffix to files

* Implement CA manager for ACME-based workflows (#12827)

* Implement CA manager for ACME-based workflows

* refactor tests into table tests

* update with suggestions

* format

* fix challenge cleanup

* make fmt

* update with suggestions

* add _ent + build flags

* Add a runtime component for pkiexternalca (#12838)

* Implement CA manager for ACME-based workflows

* Add a runtime component for pkiexternalca

* make fmt

* refactor tests into table tests

* update with suggestions

* format

* fix challenge cleanup

* make fmt

* update with suggestions

* update with suggestions

* add _ent + build flags

* fix linters

* delete duplicate files

* fix changelog

* rename test files

* fix linter

* try to bypass false positive linter err

* fix

* Rename file

* fix linter

* fix linter

* remove go:build enterprise commends from _ent files

* update order statuses to use kebab case + fix scanner failures

* add missing order status

* Template Integration For pki_external_ca resources (#13069)

* Implement CA manager for ACME-based workflows

* Add a runtime component for pkiexternalca

* make fmt

* refactor tests into table tests

* update with suggestions

* initial commit

* fix test failure

* changes

* remove logger check

* remove redundant config by name check

* convert to table tests

* added comments

* updates

* Fix tests

* fix nil pointer issue

* move changes to _ent files

* remove ce duplicate files

* updates

* update template.go

* added changelog.txt

* create template_pem_ent_test.go

* added comment explanation

* update ca_manager_ent.go

* update changelog

* separate ce stubs into server_ce.go and common code into server.go

* Moved helper functions to bottom of test file. Added godocs.

* Make pkiExternalCA name required in template

* remove go:build enterprise commends from _ent files

* rename to template_pem_ent

* include ent tag in server_ent.go

* remove enterprise tag comment from server_ent.go

* create pki_external_config_ce.go

* update template_pem_ent_integration_test.go

* rename integration test

---------




---------

Co-authored-by: Jaired Jawed <jaired.jawed@hashicorp.com>
Co-authored-by: Ben Ash <32777270+benashz@users.noreply.github.com>
Co-authored-by: Zlaticanin <60530402+Zlaticanin@users.noreply.github.com>
Co-authored-by: Milena Zlaticanin <Milena.Zlaticanin@ibm.com>
2026-03-25 09:43:27 -04:00
Vault Automation
1f883d8d59
agent: Retry transient lookup-self errors (#11842) (#11860)
Co-authored-by: Mike Palmiotto <mpalmi@ibm.com>
2026-01-21 11:35:08 -05:00
Vault Automation
0c6c13dd38
license: update headers to IBM Corp. (#10229) (#10233)
* license: update headers to IBM Corp.
* `make proto`
* update offset because source file changed

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-10-21 15:20:20 -06:00
Vault Automation
8a3e640186
VAULT-37037 Use vault_index from events for Vault Proxy static secret cache (#9165) (#9311)
* VAULT-37037 Use vault_index from events for Vault Proxy static secret cache

* changelog

* Add sleep

* Clone, not modify, client

* whoops

* move the retries

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2025-09-15 08:55:38 -07:00
Steven Clark
9456671f04
Prepare code base for Go 1.24 update. (#29412)
* Fix "t.Fatal from a non-test goroutine" errors in cache_test.go

 - t.Fatal(f) should not be called within a Go routine based on it's documentation and only from the main test's thread.
 - In 1.24 this seems to cause build failures

* Address all "non-constant format string errors" from go vet

 - Within 1.24 these now cause test builds to fail

…" from go vet
2025-01-27 14:34:07 -05:00
Nick Cabatoff
13c445bd45
Websocket lib has moved, see https://coder.com/blog/websocket. (#29386) 2025-01-22 19:30:03 +00:00
Josh Black
2269cc3f7c
remove hashicorp-forge/bbolt and replace with official beta release (#28916)
* remove hashicorp-forge/bbolt and replace with official beta release

* get rid of redundant method

* go mod tidy

* make proto
2024-11-18 11:18:50 -08:00
miagilepner
4439ee8798
Fix Windows chown error (#28748)
* noop for windows chown

* changelog
2024-10-22 14:57:26 +02:00
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
Jason Joo
a5caf4e1cb
fix: cert auth method watches cert file change and NewCreds() notification (#28126)
Signed-off-by: Jason Joo <hblzxsj@gmail.com>
2024-10-02 13:41:55 -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
dbecbcec18
VAULT-27384 Fix faulty assignments and unchecked errors (#27810)
* VAULT-27384 Fix faulty assignments and unchecked errors

* Another missed error

* Small refactor
2024-07-22 16:53:02 -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
3959722892
VAULT-28192 fix Agent and Proxy consuming large amounts of CPU for auto-auth self-healing (#27518)
* VAULT-28192 fix Agent and Proxy consuming large amounts of CPU for auto-auth self-healing

* Changelog

* Update changelog

* drain incoming if we get invalid token

---------

Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>
2024-06-19 10:23:51 -04:00
Seena Fallah
5c275e7d88
agent: allow changing file ownership in file sink (#27123)
* agent: allow changing file ownership in file sink

Allow changing the ownership of the token file in file sink.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>

* Consistency: id -> ID

* Add changelog

* Remove empty line in changelog

* agent: add godoc for TestFileSinkMode_Ownership

Signed-off-by: Seena Fallah <seenafallah@gmail.com>

---------

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-05-30 15:11:37 -04:00
markafarrell
476b0d57c9
Add vault.agent.authenticated metric (#26570)
* add vault.agent.authenticated metric

fix metric name

* Update command/agentproxyshared/auth/auth.go

---------

Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-05-28 12:28:24 -04:00
Violet Hynes
b16b94a72a
VAULT-25341 Address issue where having no permissions to renew caused auto-auth to attempt to renew with no backoff (#26844)
* VAULT-25341 Address issue where having no permissions to renew caused Agent and Proxy auth to attempt to renew with no backoff

* Fiddle with go.mod changes that shouldn't have happened

* VAULT-25341 small cleanup and extra test

* VAULT-25341 backoff only in error case

* VAULT-25341 godocs

* VAULT-25342 changelog

* Update command/agent_test.go

Co-authored-by: divyaac <divya.chandrasekaran@hashicorp.com>

* VAULT-25341 rename file audit

---------

Co-authored-by: divyaac <divya.chandrasekaran@hashicorp.com>
2024-05-09 11:12:42 -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
divyaac
6cac3b3bf5
Agent Auto Auth Self Healing for Templates (#26172)
* Agent Auto Auth Self Healing for Templates

* Added changelog

* Edited go.sum

* Edit changelog wording
2024-03-27 10:06:45 -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
divyaac
3132592c19
Added exponential backoff (#25497)
* Applied Patch

* Added changelog

* Edited changelog

* Added constants to be shared

* Edited changelog verbage

* Removed copy and paste error

* Moved the constants

* Fixed static checks
2024-02-20 11:42:59 -08: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
Kit Haines
fb71d7f3c8
make-fmt (#24940) 2024-01-18 20:00:00 +00:00
Christopher Swenson
52d9d43a1c
Refactor auto-auth backoff to helper package. (#24668)
I have an upcoming PR for event notifications that needs similar
exponential backoff logic, and I prefer the API and logic in the
auto-auth exponential backoff rather than that of
github.com/cenkalti/backoff/v3.

This does have a small behavior change: the auto-auth min backoff
will now be randomly reduced by up to 25% on the first call. This is
a desirable property to avoid thundering herd problems, where a bunch
of agents won't all try have the same retry timeout.
2024-01-04 10:26:41 -08: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
Steven Clark
ade75bcf00
Update licensing across various source files (#24672) 2024-01-04 12:59:46 -05:00
Violet Hynes
75d0581464
VAULT-8790 Ensure time.NewTicker never gets called with a negative value (#24402)
* Ensure time.NewTicker never gets called with a negative value

* Remove naughty newline

* VAULT-8790 review feedback
2024-01-03 15:34:41 -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