Commit Graph
2086 Commits
Author SHA1 Message Date
Jim 9dde83aea7 feature (byow): classify status msg data (#2181)
Classifying the data allows it to appropriately included in
audit events
2022-06-14 12:09:02 -04:00
Jeff MitchellandJim 7c139d28b2 Have hclog payloads use json tags (#2171)
* Have hclog payloads use `json` tags

Previously a global setting for the `structs` lib was causing the `json`
tag to be used, but this could have side effects from other packages, or
could be affected by other packages' behavior. This behavior was removed
earlier but it means this format call no longer uses `json` tags; this
behavior reverts it.

It also normalizes using mapstructure in a few other places.

* Update some tests

* Fix incorrect op const

* Fix more tests

* refactor (events): tell filter to use json tags (fix related tests)

Explicitly tell the filter to use the "json" tags so we don't have to
re-tag everything with a mapstructure tag via bexpr.WithTagName("json")

Update docs

Co-authored-by: Jim <jlambert@hashicorp.com>
2022-06-13 19:02:11 -04:00
Haotian 40ba275759 feat(worker): add 'initial_upstreams' field to worker config to prepare to replace 'controllers' field. Update worker config description on website. 2022-06-13 15:45:03 -07:00
Todd 4b526538af Make server_id in job_run type text since it is nullable. (#2177) 2022-06-13 12:55:05 -07:00
Irena Rindos 15138b897e Merge pull request #2168 from hashicorp/irindos-upstreams-fixes
fix context for worker upstreams
2022-06-13 08:58:22 -04:00
irenarindos ee0ecc9991 fix context for worker upstreams 2022-06-13 08:44:50 -04:00
Jeff Mitchell 8a131ef4f7 Fix missing guardrail for worker kms auth population (#2172)
* Fix missing guardrail for worker kms auth population
2022-06-11 16:13:15 -04:00
Jeff Mitchell 82b4e29d78 Properly fix (for now) the job limit 2022-06-11 11:04:40 -05:00
Jeff Mitchell cb190c0ea1 Disable session jobs for now so other jobs work right 2022-06-11 08:52:05 -05:00
Jeff Mitchell 2d274c3742 Fix merge brokenness 2022-06-10 19:20:16 -04:00
Jeff Mitchell 5d3facf561 Merge remote-tracking branch 'origin/main' into llb-byow 2022-06-10 19:05:27 -04:00
Louis Ruch c4285b29cc fix(target): Correctly return egress credentials assocaited with target (#2167) 2022-06-10 12:26:19 -07:00
Johan Brandhorst-Satzkorn a2477420da chore: Clarify event file sink doc (#2162)
Updated examples to show the common use case of
specifying a directory path and file name for
a file sink. This should hopefully prevent users
from making the mistake of putting a full path
for the file_name field and seeing an error like:

[ERROR] unable to send event: operation="event.(Eventer).retrySend"
  warning=
  | 1 error occurred:
  | 	* mkdir : no such file or directory
  |
2022-06-10 13:30:05 -04:00
Irena Rindos f7dbf2a532 Merge pull request #2163 from hashicorp/irindos-clusterid-upstreams
feat(worker): Map cluster ID in config to upstream address
2022-06-10 10:17:51 -04:00
Irena Rindos adf019f216 Merge pull request #2146 from hashicorp/irindos-cluster-workerkeyid
feature(worker): add workerKeyId to status
2022-06-10 09:59:58 -04:00
Jeff Mitchell 5a7291131f Make current key update on rotation 2022-06-10 09:33:09 -04:00
irenarindos 16d95262a6 feature(worker): add workerKeyId to status 2022-06-10 09:31:22 -04:00
Jeff Mitchell b84001c07d Add CLI for workers (#2164) 2022-06-10 09:05:43 -04:00
irenarindos 3792fec48b fixup! feat(worker): Map cluster ID in config to upstream address 2022-06-09 16:42:56 -04:00
irenarindos 256498d40f fixup! feat(worker): Map cluster ID in config to upstream address 2022-06-09 16:39:20 -04:00
Jeff Mitchell 5b978d7fa7 Adjust parameter naming (#2161)
* Adjust parameter naming for some worker resource fields

* Add eventing listener to event when authentication is successful from a downstream worker
2022-06-09 16:27:17 -04:00
Timothy Messier 59a91555bf Merge pull request #2160 from hashicorp/llb-scale-testing
perf(session): Improve list response time

Notable changes include:

- Change to not include terminated sessions by default. Use the new
  `include_terminated=true` query parameter to return terminated
  sessions.
- Remove connections from list response. Connection information is still
  returned for a read of an individual session.
- Creates a periodic job that will delete terminated sessions.
2022-06-09 16:19:02 -04:00
Timothy Messier 9075ea1b61 chore(changelog): Add notes about these session changes 2022-06-09 20:11:28 +00:00
irenarindos 3aa7d11419 feat(worker): Map cluster ID in config to upstream address 2022-06-09 16:04:13 -04:00
Timothy Messier e156e88f3e chore: Update UI version to use new query param for sessions listing 2022-06-09 19:28:04 +00:00
Timothy Messier e79714e93f feat(session): Add include_termianted option to list endpoint 2022-06-09 19:28:04 +00:00
Timothy Messier d741034829 perf(session): Change list behavior around terminated sessions
It was determined that it is a more common use case for users to request
non-terminated sessions (i.e. sessions in `pending`, `active`, or
`canceling` when requesting sessions. Notably, end users would need
non-terminated sessions to:

- Establish a new connection to a session.
- Terminate a session

So now by default a list request to `/v1/sessions` will *not* include
terminated sessions.

To still enable use cases where terminated sessions are needed, this
adds a new query parameter to include the terminated session:
`/v1/sessions?include_terminated=true`.

Note that this query parameter is considered experimental and subject to
change.
2022-06-09 19:28:04 +00:00
Timothy Messier 32070678dc perf(session): Remove connections from session list endpoint
Including the nested connection information in the session list response
had a negative impact on performance as it created a significant
multiplier on the number of rows that needed to be fetched from the
database.

It was also determined that this information was used by neither the
admin ui nor the desktop client.

Note that nested connection information can still be retrieved via a
read request for a specific session.
2022-06-09 19:28:04 +00:00
Timothy Messier 5b0abe2e27 feat(session): Add migration to delete terminated sessions
There is a new periodic job that will delete terminated sessions that
are older than one hour. However, since until now terminated sessions
were not deleted, the first time the job runs there could be a large
number of sessions that need deleted. This could have a negative impact
on a running cluster. To mitigate the operational risk, this adds a
migration to perform an initial delete while the cluster is offline.
2022-06-09 19:28:04 +00:00
Timothy Messier f9eab71a4a feat(session): Add periodic job to delete terminated sessions 2022-06-09 19:28:04 +00:00
Timothy Messier de2421cc25 feat(session): Add repository method to delete terminated sessions
This will delete sessions that have been in the termianted state for
longer than the given threshold.
2022-06-09 19:28:03 +00:00
Timothy Messier a4d0e3c7f8 refact(session): Rename files with job to use a prefix
This makes it so jobs will all be naturally grouped together in file
listing.
2022-06-09 19:28:03 +00:00
Jeff Mitchell 7c4f495c25 Add workers SDK API bits (#2159) 2022-06-09 14:30:33 -04:00
Johan Brandhorst-Satzkorn 8fdc07d5a5 test: Use tparse to simplify test failure analysis (#2149)
The tparse library adds a nice summary of the test output,
which should hopefully make it easier to find errors in the tests
2022-06-09 13:02:55 -04:00
Johan Brandhorst-Satzkorn e7273d65c2 Bump Go version to v1.18.3 (#2158)
* chore: Bump Go version

Go 1.18.3 has some security patches over 1.18.1.

See https://go.dev/doc/devel/release#go1.18.minor

* Fix formatting

This was missed in a recent PR
2022-06-09 11:43:39 -04:00
Jeff Mitchell d6362f9e5e Restrict anonymous user capabilities (#2156) 2022-06-09 11:30:01 -04:00
Jim f6c4e3c896 feature (worker): add worker events around authentication (#2157) 2022-06-09 11:28:12 -04:00
Irena Rindos d357a583ed Merge pull request #2152 from hashicorp/irindos-print-workerauth-at-startup
feat(worker): save workerAuth request to a file
2022-06-09 10:56:51 -04:00
irenarindos 594e6e82b5 feat(worker): save workerAuth request to a file 2022-06-09 10:40:30 -04:00
Gabriel SantosandJohan Brandhorst-Satzkorn 3521c21cd5 fix: Refuse to start if max_open_connections is below 5 (#2097)
* server refuses to start if max_open_connections is below 5

* suggested changes - Update internal/db/db.go

Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>

Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
2022-06-09 10:13:55 -04:00
Jim 37cc61e4c9 feature (worker): Add audit data classification to CreateWorker(...) api (#2153) 2022-06-09 06:43:58 -04:00
Jeff Mitchell 9736b79d4e Remove temporary node authorization functions (#2147) 2022-06-07 14:56:04 -04:00
Jeff Mitchell d1b3b2441f Add node rotation (#2142) 2022-06-07 14:26:33 -04:00
Todd 1e3c941be1 Add active session count to the worker (#2145) 2022-06-07 11:21:39 -07:00
Jim 0425384b49 feature (events): add TestWithoutEventing(t) (#2137) 2022-06-07 12:23:01 -04:00
Jim fdf43fc4fe feature (worker): add CreateWorker(...) service (aka API) (#2143) 2022-06-07 11:50:30 -04:00
Todd 0f7e1ee7fa Fix canonical tags not getting assigned in the api resource. (#2144) 2022-06-06 16:50:22 -07:00
Jeff Mitchell aa0afd325a Remove 'ephemeral' from KMS auth method bits (#2141) 2022-06-06 14:52:47 -04:00
Irena Rindos cc232b743e Merge pull request #2130 from hashicorp/irindos-rotate-roots
feature(WorkerAuth): Create RotateRoots domain and job
2022-06-06 14:50:21 -04:00
irenarindos 78150d88d9 feature(WorkerAuth): Create RotateRoots domain and job 2022-06-06 14:35:53 -04:00