summaryrefslogtreecommitdiff
path: root/internal/sshd/sshd_test.go
Commit message (Collapse)AuthorAgeFilesLines
* sshd: Add ProxyAllowed setting to limit PROXY protocol IP addressesJames Fargher2022-11-231-6/+61
| | | | Changelog: added
* go: Bump major version to v14Patrick Steinhardt2022-07-051-3/+3
| | | | | | | | | | | | | While gitlab-shell currently has a major version of v14, the module path it exposes is not using that major version like it is required by the Go standard. This makes it impossible for dependents to import gitlab-shell as a dependency without using a commit as version. Fix this by changing the module path of gitlab-shell to instead be `gitlab.com/gitlab-org/gitlab-shell/v14` and adjust all imports accordingly. Changelog: fixed
* Pass original IP from PROXY requests to internal API callsAlejandro Rodríguez2022-06-301-2/+13
|
* Abort long-running unauthenticated SSH connectionsIgor Drozdov2022-05-231-0/+33
| | | | | | | | | The config option is basically a copy of LoginGraceTime OpenSSH option. If an SSH connection is hanging unauthenticated, after some period of time, the connection gets canceled. The value is configurable, the server waits for 60 seconds by default.
* Close the connection when context is canceledIgor Drozdov2022-05-231-1/+36
| | | | | | | | | | | When graceful shutdown timeout expires, the global context is canceled. All the operations dependent on it are canceled as well. Unfortunately, some of the operations doesn't respect the context. For example, SSH connection initialization. In this case, we need to manually close the connection. One of the options is to wait for ctx.Done() and close the connection
* Allow specifying formatted durations in configIgor Drozdov2022-05-191-1/+0
| | | | | - If an integer is specified, we assume that these are seconds - A duration of format "500ms", "10s", "1m", etc... accepted
* Implement ClientKeepAlive optionIgor Drozdov2022-05-121-0/+1
| | | | | | | | | | Git clients sometimes open a connection and leave it idling, like when compressing objects. Settings like timeout client in HAProxy might cause these idle connections to be terminated. Let's send the keepalive message in order to prevent a client from closing
* Make PROXY policy configurableIgor Drozdov2022-05-101-12/+94
| | | | | It would give us more flexibility when we decide to enable PROXY protocol
* Revert "Abort long-running unauthenticated SSH connections"Igor Drozdov2022-04-251-29/+0
| | | | This reverts commit 3a2c8f2c47774a35d840ec8baf54341beede5d43.
* Abort long-running unauthenticated SSH connectionsIgor Drozdov2022-03-301-0/+29
|
* 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-121-5/+37
| | | | | | This will help to prevent misconfigurations. Changelog: fixed
* Extract server config related code out of sshd.goIgor Drozdov2021-09-151-7/+9
|
* Add TestInvalidClientConfig and TestNewServerWithoutHosts for sshd.goid-sshd-testsIgor Drozdov2021-09-151-0/+16
|
* refactor: move away from ioutil (deprecated)feistel2021-08-191-3/+3
|
* Sshd: Log same correlation_id on auth keysIgor Drozdov2021-07-271-14/+106
|
* Fix formatting via make fmtStan Hu2021-07-261-4/+4
|
* Provide liveness and readiness probesIgor Drozdov2021-07-191-11/+60
| | | | | They are going to be used to determine whether a server is alive and ready to accept traffic
* Shutdown sshd gracefullyIgor Drozdov2021-07-151-0/+49
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