Skip to content

Add PROXY support to gitlab-shell container

Stan Hu requested to merge sh-test-openssh-proxy-patch into master

What does this MR do?

This commit adds a new container, gitlab-shell-libproxyproto, that supports the PROXY protocol (https://developers.cloudflare.com/spectrum/proxy-protocol) via libproxyproto (https://github.com/msantos/libproxyproto). This allows the SSH server to get the real client IP instead of the IP of the load balancer.

By default, the PROXY protocol is not enforced. This can be enabled in the Helm Chart via this config:

gitlab:
    gitlab-shell:
      enabled: true
      image: 
        repository: registry.gitlab.com/gitlab-org/build/cng/gitlab-shell-libproxyproto
        tag: main
        pullPolicy: Always
      extraEnv:
        LIBPROXYPROTO_MUST_USE_PROTOCOL_HEADER: 1

Debugging can be enabled via LIBPROXYPROTO_DEBUG: 1.

Related issues

Epic: gitlab-com/gl-infra&425 (closed)

Related issue: gitlab-org/gitlab#271673 (closed)

Checklist

See Definition of done.

For anything in this list which will not be completed, please provide a reason in the MR discussion

Required

  • Merge Request Title, and Description are up to date, accurate, and descriptive
  • MR targeting the appropriate branch
  • MR has a green pipeline on GitLab.com

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes
  • Documentation created/updated
  • Integration tests added to GitLab QA
  • The impact any change in container size has should be evaluated
Edited by Stan Hu

Merge request reports