summaryrefslogtreecommitdiff
path: root/internal/sshd
Commit message (Collapse)AuthorAgeFilesLines
* Refactor flaky test case in sshd_testid-fix-flaky-testIgor Drozdov2021-11-151-13/+3
| | | | | - Use require.Regexp to expect ssh handshake error - Use require.Eventually to refactor verifyStatus
* Reject non-proxied connections when proxy protocol is enabled532-proxy-protocol-requireNick Thomas2021-10-122-5/+42
| | | | | | This will help to prevent misconfigurations. Changelog: fixed
* Log command invocation499-log-command-invocationNick Thomas2021-10-071-0/+7
| | | | | | | | Use reflection to log the command we are about to execute, both in gitlab-shell and gitlab-sshd. Include the environment, which has all the context we need to understand what the command is expected to do. Changelog: added
* Fix logging channel typefix-logging-channel-typeNick Thomas2021-10-061-1/+1
| | | | | | | | | | | Currently we get this in some log messages: logrus_error="can not add field \"channel_type\"" This is because we're trying to add a function, rather than the result of the function call (a string) to the `log.Fields`. Whoops! Changelog: fixed
* Add gitlab-sshd connection loggingNick Thomas2021-09-282-6/+18
|
* Add debug logging to gitlab-sshd sessionNick Thomas2021-09-282-12/+36
|
* Don't swallow an error parsing SSH_ORIGINAL_COMMANDNick Thomas2021-09-271-1/+1
|
* refactor: unify instantiation of command.Shellfeistel2021-09-202-18/+15
|
* Add context fields to loggingid-context-fieldsIgor Drozdov2021-09-153-10/+10
| | | | It adds correlation ids wherever possible
* Extract server config related code out of sshd.goIgor Drozdov2021-09-154-73/+217
|
* Unit test exit-codes for sshd/session.goid-session-test-2Igor Drozdov2021-09-151-0/+145
|
* Unit test sshd.handleEnv functionIgor Drozdov2021-09-151-0/+44
|
* Add TestInvalidClientConfig and TestNewServerWithoutHosts for sshd.goid-sshd-testsIgor Drozdov2021-09-151-0/+16
|
* refactor: rearchitect command and executable Go modulesfeistel2021-09-081-2/+2
|
* refactor: move away from ioutil (deprecated)feistel2021-08-192-5/+5
|
* Sshd: Log same correlation_id on auth keysIgor Drozdov2021-07-272-54/+151
|
* Merge branch 'sh-update-go-proxyproto' into 'main'Nick Thomas2021-07-271-1/+5
|\ | | | | | | | | Update go-proxyproto to v0.6.0 See merge request gitlab-org/gitlab-shell!499
| * Set a 90-second timeout on proxy headersStan Hu2021-07-261-9/+12
| |
* | Fix formatting via make fmtStan Hu2021-07-262-12/+11
|/
* Merge branch 'id-switch-logging-to-labkit' into 'main'Patrick Bajao2021-07-232-11/+12
|\ | | | | | | | | Switch to labkit/log for logging functionality See merge request gitlab-org/gitlab-shell!498
| * Switch to labkit/log for logging functionalityIgor Drozdov2021-07-222-11/+12
| |
* | Unit tests for internal/sshd/connection.goNick Thomas2021-07-221-5/+73
|/
* Prometheus metrics for HTTP requestsIgor Drozdov2021-07-211-39/+3
| | | | | A RoundTripper for tracking the duration of an http request is introduced
* Provide liveness and readiness probesIgor Drozdov2021-07-192-14/+109
| | | | | They are going to be used to determine whether a server is alive and ready to accept traffic
* Shutdown sshd gracefullyIgor Drozdov2021-07-152-22/+125
| | | | | | | | When interruption signal is sent, we are closing ssh listener to prevent it from accepting new connections Then after configured grace period, we cancel the context to cancel all ongoing operations
* Unit test wrong channel typeIgor Drozdov2021-06-011-4/+34
|
* Fix opentracing setup for gitlab-sshdNick Thomas2021-05-171-5/+5
| | | | | | | | | | | | | | | | | | | | Previously, opentracing (if configured) was initialized late in the gitlab-shell process's lifespan, coming just before making a gRPC call to Gitaly. By moving the opentracing initialization to be at process startup, we make it available for the whole process lifecycle, which is very useful to gitlab-sshd, as it means we'll only call tracing.Initialize() once on process startup, rather than once per SSH connection. To get this working, we need to introduce a context to gitlab-sshd. This carries the client/service name, but also carries an initial correlation ID. The main outcome of this is that all calls to the authorized_keys endpoint from a given gitlab-sshd process will now share a correlation ID. I don't have a strong opinion about this either way. Changelog: fixed
* Respect parent context for Gitaly callsNick Thomas2021-05-051-1/+2
| | | | | | | | | Without these changes, Gitaly calls would not be linked to a parent context. This means that they would have an unassociated correlationID, and Gitaly RPC calls would not be cancel()ed by parent context cancellation. Changelog: fixed
* sshd: Recover from per-session and per-connection panics511-be-safe-against-panicsNick Thomas2021-04-233-3/+71
| | | | | | Without this, a failure in a single session could take out a whole connection, or a failure in a single connection could take out the whole server.
* Extract sshd connections and sessions into their own files and structsNick Thomas2021-04-233-175/+257
|
* gitlab-sshd: Support the PROXY protocolNick Thomas2021-04-121-3/+12
|
* Merge branch '500-gitlab-sshd-acceptance-tests' into 'main'Igor Drozdov2021-03-171-0/+2
|\ | | | | | | | | gitlab-sshd: Acceptance test for the discover command See merge request gitlab-org/gitlab-shell!457
| * gitlab-sshd: Acceptance test for the discover commandNick Thomas2021-03-171-0/+2
| | | | | | | | | | With this, we can start to build confidence in making changes to gitlab-sshd.
* | chore: Refactor env introspection to rely on command initialization496-move-env-introspection-to-sshenvLucas Charles2021-03-151-4/+9
|/ | | | | | | Refactors introspection of execution environment to rely on per-connection state (`gitlab-shell`) or per request (`gitlab-sshd`) Relates to https://gitlab.com/gitlab-org/gitlab-shell/-/issues/496
* Add basic metrics to sshdbjk/monitoringBen Kochie2021-02-161-0/+48
| | | | | | | | | * Counter for how many times the max concurrent sessions limit was hit. * Histogram for duration of each SSH connection. https://gitlab.com/gitlab-org/gitlab-shell/-/issues/121 Signed-off-by: Ben Kochie <superq@gmail.com>
* RFC: Simple built-in SSH serverLorenz Brun2021-01-181-0/+214