sameersbn / sameersbn/docker-gitlab

support gitlab's AuthorizedKeysCommand

Open
#1,558 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

wontfix
Dominant language
Shell
Stars
8.1k
Forks
2.1k
Avg merge
17h 47m
Merged PRs (30d)
7

Description

https://gitlab.com/help/administration/operations/fast_ssh_key_lookup

Changes should be limited to adding the following to /etc/ssh/sshd_config:

AuthorizedKeysCommand /home/git/gitlab-shell/bin/gitlab-shell-authorized-keys-check git %u %k
AuthorizedKeysCommandUser git

On the most basic level, setting this with GITLAB_SSH_AUTHDB=true would enable the above change, nothing more. The user would be responsible for any migration. (It should be noted that this does nothing to the current authorized_keys file, so it is an additive configuration, not destructive.)

Some users may want an easy script for migrating keys out of the database back into a keys file, but I don't think it's critical: (1) this change is really only needed by large sites; (2) making the change only adds capability, it does not restrict future capability; and (3) undoing it should be a little difficult, as it is a little internal-sensitive (https://gitlab.com/help/administration/raketasks/maintenance.md#rebuild-authorized_keys-file) and requires clearing the redis cache, etc. So automating it should not be required.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the image configures /etc/ssh/sshd_config and how the GITLAB_SSH_AUTHDB setting is handled. Add the two specified AuthorizedKeysCommand lines when enabled, then verify that existing authorized_keys behavior remains additive and that the resulting SSH configuration accepts the GitLab authorization command.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, shell
Domain
devops, infrastructure
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.