Commit Graph

295 Commits

Author SHA1 Message Date
Ryan Cragun
efda1c6d4e enos: always test from the same branch as the revision (#24462)
Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-12-11 14:26:10 -07:00
Tom Proctor
030bba4e68 Support rootless plugin containers (#24236)
* Pulls in github.com/go-secure-stdlib/plugincontainer@v0.3.0 which exposes a new `Config.Rootless` option to opt in to extra container configuration options that allow establishing communication with a non-root plugin within a rootless container runtime.
* Adds a new "rootless" option for plugin runtimes, so Vault needs to be explicitly told whether the container runtime on the machine is rootless or not. It defaults to false as rootless installs are not the default.
* Updates `run_config.go` to use the new option when the plugin runtime is rootless.
* Adds new `-rootless` flag to `vault plugin runtime register`, and `rootless` API option to the register API.
* Adds rootless Docker installation to CI to support tests for the new functionality.
* Minor test refactor to minimise the number of test Vault cores that need to be made for the external plugin container tests.
* Documentation for the new rootless configuration and the new (reduced) set of restrictions for plugin containers.
* As well as adding rootless support, we've decided to drop explicit support for podman for now, but there's no barrier other than support burden to adding it back again in future so it will depend on demand.
2023-11-28 14:07:07 +00:00
Nick Cabatoff
edb60b63f7 Use test package parallelism of 2 for docker/binary-based tests. (#24173) 2023-11-16 16:27:43 -05:00
Chris Capurso
9e044ea26e modify linux arm build strategy to use GOARM 6 (#24061) 2023-11-09 11:01:34 -05:00
mickael-hc
a76f71cc60 fix security-scanner: temporarily pin semgrep to 1.45.0 (#23855) 2023-10-27 07:30:04 -04:00
Ryan Cragun
a46def288f [QT-616] Add seal_ha enos scenario (#23812)
Add support for testing Vault Enterprise with HA seal support by adding
a new `seal_ha` scenario that configures more than one seal type for a
Vault cluster. We also extend existing scenarios to support testing
with or without the Seal HA code path enabled.

* Extract starting vault into a separate enos module to allow for better
  handling of complex clusters that need to be started more than once.
* Extract seal key creation into a separate module and provide it to
  target modules. This allows us to create more than one seal key and
  associate it with instances. This also allows us to forego creating
  keys when using shamir seals.
* [QT-615] Add support for configuring more that one seal type to
  `vault_cluster` module.
* [QT-616] Add `seal_ha` scenario
* [QT-625] Add `seal_ha_beta` variant to existing scenarios to test with
  both code paths.
* Unpin action-setup-terraform
* Add `kms:TagResource` to service user IAM profile

Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-10-26 15:13:30 -06:00
Nick Cabatoff
c64e0144f6 Use the same approach as we do in our other workflows: apply to PRs, and to pushes to our main and release branches. (#23785) 2023-10-23 14:27:13 +00:00
modrake
eca4b4d801 Relplat 897 copywrite fixes for mutliple licenses (#23722) 2023-10-20 08:40:43 -07:00
Violet Hynes
146653dfef VAULT-20487 update build failure slack output (#23724)
* VAULT-20487 update build failure slack output

* VAULT-20487 add new needs

* VAULT-20487 make it run on my branch

* VAULT-20487 make it run

* VAULT-20487 finalize?
2023-10-19 08:56:35 -04:00
Nick Cabatoff
5ca5dcba6f Fix missing test logs in archive (#23718)
Fix missing log files: we need to use an absolute path, since go test chdirs into the test package dir before running tests.  Move the cleanup-on-success behaviour from NewTestCluster into NewTestLogger so it applies more broadly.
2023-10-18 15:58:03 +00:00
divyaac
2716a48c78 Run ent tests for test-ui and oss changes (#23675)
* Copy changes from ent to oss

* Edited workflow to include the yarn oss command
2023-10-17 10:55:20 -07:00
Nick Cabatoff
832c78ee6e Stop running fips tests on PRs (#23664)
* Stop running fips tests on PRs: we expect fips-specific failures to be rare enough that it's not worth the cost.
* Allow PRs with the label "fips" to run fips tests.
2023-10-16 14:28:28 +00:00
Mark Collao
44043004d1 Update security-scan.yml 2023-10-11 12:26:20 -05:00
Mark Collao
525bf2f894 Update security-scan.yml 2023-10-11 11:07:54 -05:00
Hamid Ghaf
163c03f514 exclude changelog in verifying doc/ui PRs (#23601) 2023-10-11 08:18:23 -07:00
Kuba Wieczorek
83ae451df8 CI: Pre-emptively delete logs dir after cache restore in test-collect-reports (#23600) 2023-10-11 15:40:16 +01:00
Ryan Cragun
7d800b1af2 [QT-623] Pin to terraform 1.5.x (#23508)
Terraform 1.6.x seems to have some incompatiblity with the current
version fo enos and its usage of tfjson. Pin to 1.5.x until it has been
resolved.

```
│ Error: json: cannot unmarshal array into Go struct field rawState.checks of type tfjson.CheckResultStatic
│
```

Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-10-04 14:01:39 -06:00
Nick Cabatoff
9c28951e4e Set VAULT_TEST_LOG_DIR, so that users of NewTestLogger will have their logs written there instead of stdout. (#23494) 2023-10-04 10:35:21 -04:00
Ryan Cragun
9afd5e52ae [QT-602] Don't fail if scenarios cannot completely destroy infra (#23473)
Sometimes destroying resources in AWS will fail because of unexpected
dependency violations or other such nonsense. When this happens the
behavior of Vault that we wanted to verify has already been successfully
accomplished, however the required workflow will fail. This change
allows us to succeed if `enos scenario launch` completes but allows
`enos scenario destroy` to fail. We still notify our slack channel on
destroy failures so that we can investigate issues, however it won't
require a PR author to retry.

* Execute `enos scenario launch` instead of `enos scenario run` to allow
  for very occasional issues when tearing down test infrastructure.
* Improve an error message when getting secondary cluster IP addresses.
* Don't race to get secondary cluster IP addresses.
* Add secondary token to replication scenario outputs.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-10-03 13:04:55 -06:00
Kuba Wieczorek
3acfe5ea52 [VAULT-20630] CI: Use 'ref' (not 'base_ref') as a default git reference to check out code in the test-go GHA workflow (#23458) 2023-10-03 14:58:35 +01:00
Kuba Wieczorek
b300d50799 [VAULT-20630] CI: Fix the CI workflow issue where we check out base ref instead of the ref that triggered the workflow run (#23453) 2023-10-03 12:06:44 +01:00
Hamid Ghaf
375c2be624 control checking out head instead of base ref by a GH label (#22817)
* control checking out head instead of base ref by a GH label

* move checkout ref to the setup step

* adding a comment
2023-09-29 00:13:01 +00:00
Ryan Cragun
7725117846 enos: remove old initial version from upgrades (#23323)
* Remove old initial versions from the upgrade scenario as they're
  unreliable.
* Ensure that shellcheck is available on runners for linting job.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-09-27 12:24:08 -06:00
Ryan Cragun
e55d653cab actions: fix actionlint error and linting logic (#23305)
Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-09-26 16:38:49 -06:00
Ryan Cragun
391cc1157a [QT-602] Run proxy and agent test scenarios (#23176)
Update our `proxy` and `agent` scenarios to support new variants and
perform baseline verification and their scenario specific verification.
We integrate these updated scenarios into the pipeline by adding them
to artifact samples.

We've also improved the reliability of the `autopilot` and `replication`
scenarios by refactoring our IP address gathering. Previously, we'd ask
vault for the primary IP address and use some Terraform logic to determine
followers. The leader IP address gathering script was also implicitly
responsible for ensuring that a found leader was within a given group of
hosts, and thus waiting for a given cluster to have a leader, and also for
doing some arithmetic and outputting `replication` specific output data.
We've broken these responsibilities into individual modules, improved their
error messages, and fixed various races and bugs, including:
* Fix a race between creating the file audit device and installing and starting
  vault in the `replication` scenario.
* Fix how we determine our leader and follower IP addresses. We now query
  vault instead of a prior implementation that inferred the followers and sometimes
  did not allow all nodes to be an expected leader.
* Fix a bug where we'd always always fail on the first wrong condition
  in the `vault_verify_performance_replication` module.

We also performed some maintenance tasks on Enos scenarios  byupdating our
references from `oss` to `ce` to handle the naming and license changes. We
also enabled `shellcheck` linting for enos module scripts.

* Rename `oss` to `ce` for license and naming changes.
* Convert template enos scripts to scripts that take environment
  variables.
* Add `shellcheck` linting for enos module scripts.
* Add additional `backend` and `seal` support to `proxy` and `agent`
  scenarios.
* Update scenarios to include all baseline verification.
* Add `proxy` and `agent` scenarios to artifact samples.
* Remove IP address verification from the `vault_get_cluster_ips`
  modules and implement a new `vault_wait_for_leader` module.
* Determine follower IP addresses by querying vault in the
  `vault_get_cluster_ips` module.
* Move replication specific behavior out of the `vault_get_cluster_ips`
  module and into it's own `replication_data` module.
* Extend initial version support for the `upgrade` and `autopilot`
  scenarios.

We also discovered an issue with undo_logs that has been described in
the VAULT-20259. As such, we've disabled the undo_logs check until
it has been fixed.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-09-26 15:37:28 -06:00
Mark Collao
1434a235b1 add secret scanning exemptions (#23230) 2023-09-22 12:03:10 -05:00
Mark Collao
6bbdda762d chore: update security-scan.yml exclusions 2023-09-20 17:06:53 -05:00
Ryan Cragun
9a7de066a9 test: handle the edition in the release testing workflow (#22979)
This adds edition handling to the test-run-enos-scenario-matrix
workflow. Previously we'd pass the version and edition from the caller,
but that isn't an option in the release testing workflow, which only
passes the metadata version without the edition.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-09-11 21:04:48 +00:00
Ryan Cragun
8dd3fa74df release: remove concurrency groups from release testing (#22970)
The CRT orchestrator triggers the release testing workflows for all
release versions using the same main ref. Therefore, if we have
concurrency controls in place we could cancel them if more than one
release branch is executing workflows.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-09-11 19:33:49 +00:00
Tom Proctor
cfaad7f700 Conditionally install gVisor in CI (#22891) 2023-09-11 10:02:21 +01:00
Ryan Cragun
2e30ad5a93 test: don't use actions-set-product-version in release testing (#22948)
Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-09-08 16:27:20 -06:00
Nick Cabatoff
d03c08b466 Don't rerun-fails on 1.15 for now (#22927) 2023-09-08 15:05:58 -04:00
Ryan Cragun
5f1d2c56a2 [QT-506] Use enos scenario samples for testing (#22641)
Replace our prior implementation of Enos test groups with the new Enos
sampling feature. With this feature we're able to describe which
scenarios and variant combinations are valid for a given artifact and
allow enos to create a valid sample field (a matrix of all compatible
scenarios) and take an observation (select some to run) for us. This
ensures that every valid scenario and variant combination will
now be a candidate for testing in the pipeline. See QT-504[0] for further
details on the Enos sampling capabilities.

Our prior implementation only tested the amd64 and arm64 zip artifacts,
as well as the Docker container. We now include the following new artifacts
in the test matrix:
* CE Amd64 Debian package
* CE Amd64 RPM package
* CE Arm64 Debian package
* CE Arm64 RPM package

Each artifact includes a sample definition for both pre-merge/post-merge
(build) and release testing.

Changes:
* Remove the hand crafted `enos-run-matrices` ci matrix targets and replace
  them with per-artifact samples.
* Use enos sampling to generate different sample groups on all pull
  requests.
* Update the enos scenario matrices to handle HSM and FIPS packages.
* Simplify enos scenarios by using shared globals instead of
  cargo-culted locals.

Note: This will require coordination with vault-enterprise to ensure a
smooth migration to the new system. Integrating new scenarios or
modifying existing scenarios/variants should be much smoother after this
initial migration.

[0] https://github.com/hashicorp/enos/pull/102

Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-09-08 12:46:32 -06:00
Christopher Swenson
f20b6eb710 Disable gVisor in tests (for now) (#22881)
We can't use `sudo` on our self-hosted runners at the moment to do
the install and Docker reload.

So, we'll disable this for now, which should automatically cause
the gVisor-related tests to be skipped.
2023-09-08 01:15:49 +00:00
Tom Proctor
d6da79aa5f Make runsc the default plugin container runtime (#22850)
* Also makes plugin directory optional when registering container plugins
* And threads plugin runtime settings through to plugin execution config
* Add runsc to github runner for plugin container tests
2023-09-07 23:01:27 +00:00
Sarah Thompson
a9a4b0b9ff Onboard Vault to CRT version bump automation (#18311)
* adding new version bump refactoring

* address comments

* remove changes used for testing

* add the version bump event!

* fix local enos scenarios

* remove unnecessary local get_local_metadata steps from scenarios
* add version base, pre, and meta to the get_local_metadata module
* use the get_local_metadata module in the local builder for version
  metadata
* update the version verifier to always require a build date

Signed-off-by: Ryan Cragun <me@ryan.ec>

* Update to embed the base version from the VERSION file directly into version.go.
This ensures that any go tests can use the same (valid) version as CI and so can local builds and local enos runs.
We still want to be able to set a default metadata value in version_base.go as this is not something that we set in the VERSION file - we pass this in as an ldflag in CI (matters more for ENT but we want to keep these files in sync across repos).

* update comment

* fixing bad merge

* removing actions-go-build as it won't work with the latest go caching changes

* fix logic for getting version in enos-lint.yml

* fix version number

* removing unneeded module

---------

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Claire <claire@hashicorp.com>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2023-09-06 17:08:48 +01:00
Tom Proctor
d5b223424d Revert "Pin security scan's semgrep version to 1.37.0 (#22731)" (#22745)
This reverts commit 9808578086.

Previous issue fixed in returntocorp/semgrep#8604, released in 1.38.1
2023-09-01 20:32:48 +00:00
Tom Proctor
9808578086 Pin security scan's semgrep version to 1.37.0 (#22731)
hashicorp/security-scanner#504 tracks the breakage that requires us to pin pre-1.38.0 for now
2023-09-01 15:39:35 +01:00
Violet Hynes
3e0baa9864 New-line and emojify test output (#22663)
* Attempt to new-line/emojify test output

* Update emoji

* Make it always run, for testing

* Put the emojis first

* Add a space

* OSS -> CE

* Update enterprise tests also

* Test failure

* Test failures but better

* Print it even if not main :)

* Fix the comparison

* Finalize changes
2023-08-31 15:29:59 -04:00
brian shore
c31817abd0 Add GitHub workflow concurrency controls (#22610) 2023-08-30 14:39:50 -07:00
John-Michael Faircloth
8bae1c18da gha: fix plugin update check labeling (#22647) 2023-08-30 13:22:31 -07:00
Nick Cabatoff
2d2c9c2f0c Sync CE with Ent: improve slack notifications for test failures (#22656) 2023-08-30 13:57:31 -04:00
Theron Voran
66db439027 ci/plugin-update: use rest of repo name as service (#22585)
Includes everything after the 3rd position as the PLUGIN_SERVICE, so
that plugins like "vault-plugin-database-redis-elasticache" end up
with the full name in the changelog entry.
2023-08-28 11:28:25 -07:00
Nick Cabatoff
0f5a39cc91 Fix some ci inconsistencies, and logic for security scan and go test comment (#22563)
* Remove diff-oss-ci

* Eliminate another inconsistency

* Fix logic: we want to only apply the fork check on the CE repo.  On ent we want to always run the job.

---------

Co-authored-by: hc-github-team-secure-vault-core <github-team-secure-vault-core@hashicorp.com>
2023-08-25 11:44:17 -04:00
Mike Palmiotto
d06b57e6f8 Prune invalid timing files (#22549)
To prevent CI failures due to invalid timing files, make sure we prune
them before use and again before persisting.
2023-08-24 16:24:43 +00:00
Ryan Cragun
71fea81310 ci: fix test timing reports (#22537)
* Fix saving test timing reports when tests fail
* Use a different cache key for different test modes

Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-08-24 16:03:53 +00:00
Nick Cabatoff
a0217ad017 See if this fixes the disk full errors in CI (#22532)
Co-authored-by: hc-github-team-secure-vault-core <github-team-secure-vault-core@hashicorp.com>
2023-08-23 20:16:13 +00:00
Hamid Ghaf
b5e9963703 adding testonly CI test job (#22439)
* adding testonly CI test job

* small instance for testonly tests

* feedback

* shopt

* disable glob expansion

* revert back to a large instance

* fix a mistake
2023-08-18 19:49:33 +00:00
Violet Hynes
41ca6d427a Skip milestone check for community PRs (#22402) 2023-08-17 13:03:05 -04:00
Sarah Thompson
34bfdea34f update linux package license to BUSL-1.1 (#22319) 2023-08-16 11:10:55 -04:00