Commit Graph
21 Commits
Author SHA1 Message Date
Todd fb1ea92a30 Pass both the control and data context into handle 2023-05-31 12:18:24 +00:00
Todd feb87e717e Add Closed error code and rename recorder cache to manager 2023-05-31 12:18:14 +00:00
Todd bd2bca987d Add the first iteration of the recorder cache and wire it in 2023-05-31 12:18:09 +00:00
Jeff Mitchell 163ce184b8 KMS-PKI Workers (#3101)
This adds a new mechanism for worker authentication that uses the
third-party arbitration of the original KMS flow by leveraging
recently-added capabilities in nodeenrollment to support a registration
wrapper. This allows for workers to be registered to the system with
just a name and a matching wrapper, while at the same time allowing
these workers to be used for private Vault access and multi-hop as they
contain per-worker encryption keys and support rotation.

Nodes using this mode will generate and rotate credentials in-memory
(using another recently added nodeenrollment capability) so will have a
new set of keys on every startup. This has the side effect of ensuring
that there is never a conflict or re-use of these credentials.

Note that the normal test worker flow was using the now-deprecated KMS
method; there is still a test that uses this (explicitly) but all other
tests using test workers that did not specify a specific PKI flow now
actually use this mechanism. This means there is fairly decent test
coverage in a general sense, plus the specific tests updated/added for
this feature.

This also adds a new KMS type that can be used to have
distinct KMSes for upstream authentication vs. accepting from
downstream.
2023-03-30 16:20:28 -04:00
Jeff Mitchell b76b24a4ad Move prefixes for many packages into the globals package (#3069)
This is a prerequisite for some enhancements to grant validation
2023-03-10 15:06:39 -05:00
Johan Brandhorst-Satzkorn 3c29308673 chore: Add license headers to all files 2023-02-03 15:54:27 -08:00
Todd 87b09d5e27 Rename router to receiver for secondary connections (#2816) 2023-01-20 10:43:57 -08:00
Todd bc409bc7d4 Graceful shutdown blocks on running proxy handler connections (#2789) 2023-01-17 08:54:01 -08:00
Todd 38b74ce897 Provide a worker decryption function to proxy handlers (#2784) 2023-01-12 13:16:36 -08:00
Irena Rindos d3d1fa0b55 initial commit (#2768) 2023-01-10 08:10:54 -05:00
Irena Rindos beb97ac9f2 SSH Proxy support (#2736)
* initial commit
2023-01-09 13:43:02 -05:00
Irena Rindos a403b3904c initial commit (#2735) 2023-01-09 12:35:13 -05:00
Todd b6c0ccc1e8 Refactor proxy handler to separate connection and protocol handling (#2678) 2022-12-06 11:44:00 -08:00
Hugo f023f05c11 feat(worker): Report bytes up/down on Worker connection closure
Introduces data about bytes read and written to the connection close
payload. No changes are required in the Controller because the RPC
messages already contained the required fields. As of this commit,
bytes_up and bytes_down columns in the session_connection table are now
populated when a connection closes.

Refs: #2509
2022-10-26 17:43:05 +01:00
Hugo 1bb80624b8 feat(worker): net.Conn implementation to count Bytes Read and Written
This commit introduces a new net.Conn implementation (countingConn) that
will keep track of bytes read and written for a particular client
connection. This is then implemented into the worker code using
interface composition.

Refs: #2501
2022-10-26 17:43:04 +01:00
Louis Ruch 50490d71ae chore(targets): Improve help and errors around ssh targets (#2445) 2022-09-13 13:05:36 -07:00
Louis RuchandJeff Mitchell a17e973712 feat(credentials): Refactor credential purposes (#2260)
* feat(credentials): Refactor credential purposes

 * Application credentials have been refactored to Brokered credentials
 * Egress credentials have been refactored to Injected Application
credentials

Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
2022-07-19 15:16:24 -07:00
Todd 155c5f578b Create session manager for workers to use to interact with sessions (#2235) 2022-07-06 13:37:49 -07:00
Jeff Mitchell f5bf3b2c0c Add events on session activation and connection authz/close (#2215)
* Add events on session activation and connection authz/close

* Only send success event on actual success
2022-06-17 16:20:01 -04:00
JimandJeff Mitchell bd167da7d1 fix (worker): send workerId when authorizing session (#2207)
* fix (worker): send workerId when authorizing session

Send the workerId returned from the last success worker status
when authorizing a session.

* fixup! fix (worker): send workerId when authorizing session

* fixup! fix (worker): send workerId when authorizing session

* refactor (worker): deprecate workerId in ActivateSessionRequest

It wasn't being used anywho

* fixup! fix (worker): send workerId when authorizing session

* Update LookupSessionRequest

Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
2022-06-16 09:30:04 -04:00
Todd b58dada40d Move the server daemons into their own package (#2061)
* Move the server daemons into their own package

With this change the internal/server package now is dedicated to the server domain (workers and controllers) and not to the server daemons.
The hope is that this will make it easier to keep the daemons decoupled from the representation of the servers in the database.
2022-05-09 12:45:10 -07:00