Document gitlab-sshd SSH algorithm configuration
What does this MR do?
Documents the gitlab-sshd algorithm settings on the gitlab-sshd administration page. The settings have shipped for several releases but are only discoverable from gitlab.rb.template comments, the GitLab Shell config.yml.example file, and the chart configuration table. Nothing on docs.gitlab.com for the Linux package mentions them, which has led to the conclusion that gitlab-sshd algorithm policy is not configurable and that OpenSSH is the only option for algorithm hardening.
Changes:
-
doc/administration/operations/gitlab_sshd.md- New
## Configure SSH algorithmssection after## Enable gitlab-sshd, with Linux package and Helm chart tabs forkex_algorithms,macs, andpublic_key_algorithms. - A scope note stating the settings apply only when
gitlab-sshdis enabled, and only to the port it listens on. The enablement instructions on this same page rungitlab-sshdon port 2222 alongside OpenSSH on 22, so it is possible to harden one port and believe the instance is covered. - A client lockout warning. Excluding
ssh-rsafrompublic_key_algorithmsalso rejects RSA SSH certificates, becausessh-rsa-cert-v01@openssh.comusesssh-rsaas its underlying algorithm, and this page advertises instance-level SSH certificate authentication. ### Default algorithmsexplains that unset settings fall back to the defaults of thegolang.org/x/crypto/sshversion GitLab Shell is built against, rather than listing algorithms that go stale on every dependency bump.### Host key algorithmsdocuments that these are derived from the loaded host keys and are not settable, sossh-rsastays advertised even after it is removed frompublic_key_algorithms.- New bullet in the "considerations" list stating that
/etc/ssh/sshd_configdoes not apply.
- New
-
doc/security/hardening_operating_system_recommendations.md- Clarifies that the
sshd_configexample applies to OpenSSH. The wording is additive rather than an alternative, because the host OpenSSH daemon still serves administrative access and still needs those settings even whengitlab-sshdhandles Git SSH.
- Clarifies that the
-
doc/tutorials/install_gitlab_single_node/_index.md- The same OpenSSH hardening block appears here with no indication that it does not affect
gitlab-sshd. Adds the same clarification.
- The same OpenSSH hardening block appears here with no indication that it does not affect
No algorithm defaults are published, by design. The defaults changed in 18.3 and again in 18.4, so any list committed here would be wrong after the next x/crypto bump.
Verification
Verified against the versions that currently ship, not the ones in the original draft. GITLAB_SHELL_VERSION on master pins gitlab-shell 14.56.1, which uses golang.org/x/crypto v0.54.0 and gitlab.com/gitlab-org/labkit v1.64.2.
The example configuration was tested empirically by running the gitlab-sshd binary against a throwaway config on a spare port and reading the server KEXINIT proposal. All six key exchange algorithms, both MACs, and all eight public key algorithms take effect. This confirmed three things worth noting:
diffie-hellman-group16-sha512is implemented but not in the default set, so it has to be listed explicitly to be offered.curve25519-sha256@libssh.organdkex-strict-s-v00@openssh.comboth appear in scans without being configured. Both are now documented, because they otherwise look like a configuration that failed to apply.- With
ciphersleft unset, the offered ciphers contain no SHA-1 algorithm at all, which is why theciphersline was dropped from the example.
Linting was run locally with the versions CI pins: markdownlint-cli2 0.22.1, Vale 3.14.1, and lychee 0.24.2. All three report zero errors. The remaining Vale warnings on these files are on pre-existing lines.
Follow-up issues
Three behaviours found during verification are raised against GitLab Shell rather than documented as if intended:
- gitlab-shell#870: a mistyped algorithm list silently falls back to the permissive defaults, so a typo in a hardening list produces a weaker server than the operator started with. Linked from the docs.
- gitlab-shell#871:
public_key_algorithmsis validated per connection rather than at startup, so a typo passesgitlab-ctl reconfigureand then breaks all authentication. Linked from the docs. - gitlab-shell#872: FIPS builds filter only key exchange. This one is a question rather than a bug report, since the source comment suggests it is deliberate. The FIPS paragraph is held out of this MR until it is answered.
Related issues
- Related to #363040, which has asked for supported-algorithm tables since 2022 and is stale. This MR does not close it: that issue targets
doc/user/ssh.mdand asks for full algorithm tables, which is the approach deliberately not taken here. - Related to gitlab-shell#806, linked from the host key subsection.
- Raised through a Support ticket from a GitLab Self-Managed customer asking where the
gitlab-sshdalgorithm settings are documented:https://gitlab.zendesk.com/agent/tickets/745501(internal, GitLab team members only).
Author's checklist
- Follows the documentation process and Style Guide.
- Vale and markdownlint run locally, with the versions CI pins. Zero errors.
- Content was drafted with AI assistance and verified against version-pinned sources (gitlab-shell 14.56.1,
golang.org/x/cryptov0.54.0, labkit v1.64.2), plus an empirical test of the example configuration. Per the documentation workflow, this requires a Technical Writer review.
/cc technical writer for Create:Source Code