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:

  1. doc/administration/operations/gitlab_sshd.md

    • New ## Configure SSH algorithms section after ## Enable gitlab-sshd, with Linux package and Helm chart tabs for kex_algorithms, macs, and public_key_algorithms.
    • A scope note stating the settings apply only when gitlab-sshd is enabled, and only to the port it listens on. The enablement instructions on this same page run gitlab-sshd on 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-rsa from public_key_algorithms also rejects RSA SSH certificates, because ssh-rsa-cert-v01@openssh.com uses ssh-rsa as its underlying algorithm, and this page advertises instance-level SSH certificate authentication.
    • ### Default algorithms explains that unset settings fall back to the defaults of the golang.org/x/crypto/ssh version GitLab Shell is built against, rather than listing algorithms that go stale on every dependency bump.
    • ### Host key algorithms documents that these are derived from the loaded host keys and are not settable, so ssh-rsa stays advertised even after it is removed from public_key_algorithms.
    • New bullet in the "considerations" list stating that /etc/ssh/sshd_config does not apply.
  2. doc/security/hardening_operating_system_recommendations.md

    • Clarifies that the sshd_config example 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 when gitlab-sshd handles Git SSH.
  3. 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.

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-sha512 is implemented but not in the default set, so it has to be listed explicitly to be offered.
  • curve25519-sha256@libssh.org and kex-strict-s-v00@openssh.com both appear in scans without being configured. Both are now documented, because they otherwise look like a configuration that failed to apply.
  • With ciphers left unset, the offered ciphers contain no SHA-1 algorithm at all, which is why the ciphers line 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_algorithms is validated per connection rather than at startup, so a typo passes gitlab-ctl reconfigure and 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 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.md and 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-sshd algorithm 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/crypto v0.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

Edited by Niklas Janz

Merge request reports

Loading
Loading