Commit Graph

18722 Commits

Author SHA1 Message Date
Jaymala
8512858583 Fix autopilot scenario failures (#21025)
* Fix autopilot scenario failures

Signed-off-by: Jaymala Sinha <jaymala@hashicorp.com>
Signed-off-by: Mike Baum <mike.baum@hashicorp.com>

* use bash instead of sh in create logs dir shell script
* ensure to only enable the file audit device in the upgrade cluster of the autopilot scenario if the variable is enabled

---------

Signed-off-by: Jaymala Sinha <jaymala@hashicorp.com>
Signed-off-by: Mike Baum <mike.baum@hashicorp.com>
Co-authored-by: Mike Baum <mike.baum@hashicorp.com>
2023-06-06 17:03:50 -04:00
kpcraig
45b9dffea1 Update aws static credential fields to match dynamic credential fields (#21017)
* prospective field name change

* doc update

* we can actually update all struct tags here
2023-06-06 14:30:39 -05:00
Matt Schultz
28bcf9a664 Add certbot renewal tests to ACME test suite. (#21020) 2023-06-06 12:51:51 -05:00
claire bontempo
8071d6e6ca rename classes and delete unused files (#21003) 2023-06-06 08:38:12 -07:00
Kit Haines
df975cf04e Add Config Test. (#20989) 2023-06-06 09:55:42 -04:00
Kit Haines
61d35391a7 Add CN-only and DNS-only tests to ACME test suite (#20996)
* Add CN-only and DNS-only tests to ACME test suite

* Future-proof check validity.

* Add IP-address check-validation.
2023-06-06 09:54:16 -04:00
Steven Clark
ddaf5038f2 Limit ACME issued certificates to a max of 90 days (#20981)
* Limit ACME issued certificates to a max of 90 days

 - If the normal NotAfter date that is calculated from the mount/issuer/role TTL values is greater than 90 days, override the TTL value to a 90-day value.

* Add changelog
2023-06-06 09:51:23 -04:00
Mike Baum
dbe41c4fee [QT-426] Always create the file audit directory (#20997)
* Always create the file audit directory
* Create audit file directory after unsealing the leader
2023-06-05 20:25:58 -04:00
Hamid Ghaf
f0292fa2e4 OSS part of replication sys method (#20995)
* OSS part of replication sys method

* CL
2023-06-05 14:39:40 -07:00
Marc Boudreau
4374d7633b Code Cleanup Around Audit Backends (#20933)
* clean up go compiler warnings

* remove unused field from backendEntry struct
remove function argument no longer needed

* add changelog record

* use context.Background instead of context.TODO
2023-06-05 16:53:29 -04:00
Alexander Scheel
8e576cf226 Add more tests around issuers, roles, and directories (#20991)
Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-06-05 14:58:39 -04:00
Violet Hynes
9163a237c1 VAULT-14847 Skip cetain tests on ARM (#20990) 2023-06-05 14:02:39 -04:00
Nick Cabatoff
da5d0ca498 Fix race with dead server cleanup when adding new raft nodes (#20986)
* Don't call AddPeer for a new raft cluster member until it's in raftFollowerStates, or it might get cleaned up by dead server cleanup.
2023-06-05 13:38:46 -04:00
Anton Averchenkov
be4979dfbb openapi: Fix generated types for duration strings (#20841) 2023-06-05 13:25:55 -04:00
Steven Clark
0bd356f6cd Generate ACME EAB tokens that do not start with '-' (#20945)
* Generate ACME EAB tokens that do not start with -

 - To avoid people having issues copying EAB tokens and using them on command lines when they start with - from the base64 encoded values, append a prefix.
 - Remove the key_bits data from the eab api, not really useful and now technically wrong
 - Fix up some issues with tests not running in parallel.
 - Update docs to reflect new EAB apis.

* Add ACME directory to the various EAB output APIs

* Update EAB token prefix to be divisable by 3

 - Our decoded prefix was not divisable by 3, which meant the last
   character might be tweaked by the rest of the input
2023-06-05 14:38:03 +00:00
Mike Baum
2c9a75b093 [QT-426] Ensure file audit device is only enabled if the leader is initialized. (#20974) 2023-06-03 13:50:28 -04:00
Anton Averchenkov
155003aa0c agent: Better help text for agent generate-config (#20967) 2023-06-02 21:05:14 +00:00
akshya96
8931e4790b Duplicate groups creation bug (#20964)
* fix duplicate groups creation

* add changelog
2023-06-02 14:02:09 -07:00
Steven Clark
3dbdee528a Attempt to resolve flaky test TestAcmeBasicWorkflow test (#20960)
* Attempt to resolve flaky test TestAcmeBasicWorkflow test

 - Since we can't control the challenge engine, flush the validation records it leverages prior to manually updating the authorization/challenge statuses

 ```
     path_acme_test.go:261: csr: &{[] [] [] [] 0 [] 0 0 <nil> CN=*.localdomain [] [] [] [localhost.localdomain *.localdomain] [] [] []}
     path_acme_test.go:300:
         	Error Trace:	/home/runner/actions-runner/_work/vault-enterprise/vault-enterprise/builtin/logical/pki/path_acme_test.go:300
         	Error:      	Received unexpected error:
         	            	403 urn:ietf:params:acme:error:orderNotReady: The request attempted to finalize an order that is not ready to be finalized: order is status pending, needs to be in ready state
         	Test:       	TestAcmeBasicWorkflow/role
         	Messages:   	failed finalizing order
 ```

* make fmt
2023-06-02 14:34:15 -04:00
Mike Baum
0115b5e43a [QT-426] Add support for enabling the file audit device for enos scenarios (#20552) 2023-06-02 13:07:33 -04:00
Nick Cabatoff
43d482e0d5 Stop overwriting the test results from the different families (normal, -race, -fips) (#20959) 2023-06-02 17:39:08 +01:00
Nick Cabatoff
5a987c0212 Introduce a wrapper for NewTestCluster that only supports single node (#20872) 2023-06-02 11:45:17 -04:00
Kunj Dave
bb03d11699 clarify vault upgrade instructions (#20952) 2023-06-02 15:11:48 +00:00
Yoko Hyakuna
00485c767d Automatic license utilization reporting (#20898)
* Add license utilization reporting doc

* Updated the title

* Incorporated the review feedback

* Update website/content/docs/enterprise/license/utilization-reporting.mdx

Co-authored-by: Mike Palmiotto <mike.palmiotto@hashicorp.com>

* Update website/content/docs/enterprise/license/utilization-reporting.mdx

Co-authored-by: Mike Palmiotto <mike.palmiotto@hashicorp.com>

* Fix the self reminder note

---------

Co-authored-by: Mike Palmiotto <mike.palmiotto@hashicorp.com>
2023-06-02 07:09:56 -07:00
Anton Averchenkov
bc9a39a2f1 agent: Fix bug with early exits during restarts (#20950) 2023-06-02 09:05:13 -04:00
npezzotti
f8d1d98995 docs: Fix a typo on Use Cases page (#20947)
bedhind -> behind
2023-06-02 13:23:34 +01:00
Nick Cabatoff
dc5dd71c72 Deflake TestActivityLog_MultipleFragmentsAndSegments (#20930) 2023-06-02 07:15:27 -04:00
claire bontempo
34a722195e UI: add pki/config/acme, fix pki/configcluster save bug (#20944)
* fix cluster/config actually saving doh

* add mkdown copy

* add acme config to edit form

* fix tests

* add empty state capabilities test

* add acceptance test for mixed permission save

* swap order to match form

* update copy

* make markdown changes

* fix y
2023-06-02 02:59:03 +00:00
Daniel Huckins
a5a49cde3f agent: Prevent multiple restarts of child process in supervisor mode (#20940)
* try timer

Signed-off-by: Daniel Huckins <dhuckins@users.noreply.github.com>

* add to config

Signed-off-by: Daniel Huckins <dhuckins@users.noreply.github.com>

* add test to verify behavior

* remove closer func -- it was causing a race condition

* Revert "add to config"

This reverts commit 1de6af0ff676029e290cc42a0bb2b7e6f597d1a6.

* rename variables, add comment

* comment

* comment re debounce timer

* don't skip tests

* fix comment

* formatting

* formatting

---------

Signed-off-by: Daniel Huckins <dhuckins@users.noreply.github.com>
Co-authored-by: Anton Averchenkov <anton.averchenkov@hashicorp.com>
2023-06-01 19:55:50 -04:00
claire bontempo
c2a1ce374c UI: pki only render unable to parse banner on issuer details page (#20942)
* move parsing banner to issuer details view only

* add tests

* fix test typo

* remove old test
2023-06-01 23:33:41 +00:00
Kit Haines
e63dc30507 Change from default_role to default_directory_policy (#20935)
* Change from default_role to default_directory_policy to allow future improvements.

* Helper functions

* Use the helper function and make fmt.

* Do not allow the zero-length role "".

* Semgrep doesn't like shadowing errors that are impossible to hit, so fix that.

* Add default to switch branches.

* Add/fix docs.

* Fix wrong requestedRole
2023-06-01 22:06:30 +00:00
Anton Averchenkov
8fe7076c02 agent: Allow for a 'cache' stanza in environment template configuration (#20918) 2023-06-01 19:01:55 +00:00
Anton Averchenkov
e4c19ac0af agent: Fix bug with 'cache' stanza validation (#20934) 2023-06-01 18:08:04 +00:00
Steven Clark
8dde8ae29e Fix order, authorization, challenge status when failing to validate a challenge (#20914)
* Fix ACME computed order status

* Return validation errors and status updates for authorizations

 - We now populate the error field within challenges with the error results from the challenge
 - Update the status of the challenge and authorizations to invalid when we give up on the challenge
 - Verify that only a single challenge within a given authorization can be accepted to avoid race conditions.
2023-06-01 13:33:38 -04:00
Anton Averchenkov
9be2903a34 agent: Don't restart process unless environment variables changed (#20917) 2023-06-01 10:57:45 -04:00
Steven Clark
b1c936d453 Escape the ACME eab key in the certbot command line within integration tests (#20926)
- Saw a test failure when we generated an EAB key that started with -

```
acme_test.go:249: Certbot Issue Command: [certbot certonly
--no-eff-email --email certbot.client@dadgarcorp.com --eab-kid
0246913b-4382-10fc-bf57-b05f2dad0f13 --eab-hmac-key
-Avt5q_KUWWWL8slYJn_MdmiCA-jzvif6Tpt45gQNR0 --agree-tos --no-verify-ssl
--standalone --non-interactive --server

...

certbot: error: argument --eab-hmac-key: expected one argument
```
2023-06-01 10:56:29 -04:00
Nick Cabatoff
74d39610ba Add more parallelism to raft tests. (#20924) 2023-06-01 10:53:20 -04:00
Chelsea Shaw
ffe3e1c9e9 UI: Scroll to top after PKI exported save (#20916) 2023-06-01 09:19:33 -05:00
Steven Clark
360a406a2f Remove mentions of transform from the transit key import help text (#20925)
- The transit import and import-version command line help texts
   referenced that it worked with Transform which it doesn't.
2023-06-01 10:05:14 -04:00
Nick Cabatoff
65157a6d3f New helper methods for generating readable loggable strings (#20911) 2023-06-01 13:12:16 +00:00
claire bontempo
e32cf520f4 UI: fixes pki role editing changing to default key parameter values (#20907)
* add integer-to-string helper

* rename and add test

* add role test

* finish tests

* pass options so values are only converted if the type matches

* okay lets hit it with the loose-equal instead

* add changelog
2023-05-31 15:44:22 -07:00
Jordan Reimer
0defa2a1e7 UI cluster unseal bug (#20897)
* fixes issue unsealing cloud seal type cluster

* adds changelog entry
2023-05-31 14:21:36 -06:00
Max Bowsher
e65d295c88 Fix non-deterministic ordering of 'required' field in OpenAPI spec (#20881)
* Fix non-deterministic ordering of 'required' field in OpenAPI spec

Fixes a minor annoyance I discovered whilst comparing before and after
OpenAPI specs whilst working on hashicorp/vault-client-go#180.

Sort the entries in a JSON array which has set semantics, after we
construct it by iterating a map (non-deterministic ordering).

* changelog
2023-05-31 15:10:24 -04:00
Alexander Scheel
b86f475927 Fix formatting (#20903)
Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-05-31 18:36:27 +00:00
Alexander Scheel
daf72aa427 Fix transit import/export of hmac-only keys (#20864)
* Fix export of HMAC typed keys

When initially implemented, exporting HMAC keys resulted in returning
the unused, internal HMACKey value rather than the main Key value that
is used for HMAC operations.

This is a breaking change.

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

* Consistently handle HMAC keys in keysutil

When generating HMAC-typed keys, set HMACKey = Key consistently, to
allow users of HMAC-typed keys to use them backwards compatibly.

Notably, this could discard the (unused) HMACKey field set today.

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

* Add test proving export of HMAC keys work

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>
2023-05-31 18:04:08 +00:00
Milena Zlaticanin
c02c1dad14 Update MongoDB Atlas plugin to v0.10.0 (#20882)
* Update MongoDB Atlas plugin to v0.10.0

* add changelog

* add a changelog with feature release note

* Update changelog/20882.txt

Co-authored-by: Calvin Leung Huang <1883212+calvn@users.noreply.github.com>

---------

Co-authored-by: Calvin Leung Huang <1883212+calvn@users.noreply.github.com>
2023-05-31 09:33:54 -07:00
Anton Averchenkov
8ff31f32a5 agent: Don't print errors on exit 0 in supervisor mode (#20880) 2023-05-31 16:22:16 +00:00
Anton Averchenkov
fe53c4684c agent: Don't render templates to stdout in supervisor mode (#20884) 2023-05-31 12:04:33 -04:00
Tom Proctor
657ee3107a Improve consul secrets plugin error for failed bootstrap (#20891) 2023-05-31 16:31:24 +01:00
Alexander Scheel
a18b10ecae Add tests issuing certificate and using against docker (#20890)
Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
2023-05-31 09:36:07 -04:00