-
Notifications
You must be signed in to change notification settings - Fork 313
Allow admins full ssh access #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This feature allows anyone who is an admin in gitlab normal SSH access, including starting a tty session; in effect causing gitlab-shell to become transparent to admins. I wrote this so capistrano will continue to work without major kludges (like sudo). If GitLab isn't running, then gitlab-shell will deny access to admins (unfortunately). This feature requires a new GitLab internal api call, "admin", to check if a given SSH key belongs to an unblocked admin. When I made these changes, I also replaced `system()` calls with `Kernel::exec()` because there is no need to keep the ruby process around once we've authenticated the user.
This commit requires GitLab pull request #3219 to work. |
@randx commented on Gitlab #3219:
Then may I suggest that a config.yml option be added to turn this feature on? The problem I'm trying to solve is that the instructions to deploy GitLab 5.0 have the user put the GitLab web account and gitlab-shell both in the This breaks capistrano as soon as you run You can tell capistrano to use sudo over to a different user, but not all the commands in capistrano have their Let me think about this and see if I can come up with an alternative way to specify people who can get full SSH access. |
I think we should deploy from user different from git. Allowing ssh access to admins is potential security issue i cannot allow. I hope you understand. |
@randx -- I don't think you can run gitlab-shell and gitlabhq from different user accounts. Not without setting the setuid bits on gitlab-shell commands and some other really tricky Unix admin setups. |
I am not talking about running gitlabhq and gitlab-shell from different users. They must run from same user |
@randx -- I haven't had success with that in capistrano. I used something like this in my
This had two problems:
|
Oh, and the third issue is that |
In this case capistrano is not actually what we need. So I'll remove capistrano examples from GitLab. |
Yeah, capistrano's default deploy mechanisms don't seem like they can handle the case of logging in with one user and switching via sudo to another on every command. The bug I mentioned above was just for things meant to sudo to root, not to an arbitrary user. I suppose you could set up a 'deploy' user who has their shell set to 'sudo -i -u git' but that seems like asking for trouble. |
@randx what do you propose then? If gitlab-shell knew about users, then you could add user-ids to the |
Okay, how is this for a proposal:
Pros:
Cons:
Alternative:
|
I dont like any alternative of providing full ssh access to git user at all. It should be only git commands |
So my suggestion still the same - use other sudo user for deploy. |
That's not very friendly to people who want to deploy via capistrano. By requiring some settings in the What's wrong with letting people opt-in to this? People who don't want to let anyone have full ssh access can just not use this feature. People who want it (for example, for capistrano installs) can turn it on. |
@docwhat I'm sorry that some tools does not work well with our software. |
thank you for discussion but I'm closing this one |
Okay. One more try... How about a list of public SSH keys that are allowed full access. They can be either dropped in a directory or put in the If a With that configuration, even if all gitlab accounts are compromised, no unauthorized users can get full ssh access since they won't have the private SSH keys. The worst that can be done is that public keys can be deleted from gitlab which would lock the full-access users out of the Does that address your concern? |
Heck. It doesn't even need to do anything on |
You could use a command="sudo -i -u git" in the .ssh/authorized_keys of the deploy user. You would not need to hack capistrano this way. Unless I'm missing something? |
@PierrePaul The problem is that you can't use sudo for |
If you don't need ssh access for a service, you can still login via "ssh user@host -o PubkeyAuthentication=no". |
@westberliner True enough. But in the case I was trying to do I need ssh access. The sshd is set, by our security policy, to reject password logins. I don't even know if the account has a password. |
This feature allows anyone who is an admin in gitlab normal SSH
access, including starting a tty session; in effect causing
gitlab-shell to become transparent to admins.
I wrote this so capistrano will continue to work without major
kludges (like sudo).
If GitLab isn't running, then gitlab-shell will deny access
to admins (unfortunately).
This feature requires a new GitLab internal api call, "admin", to
check if a given SSH key belongs to an unblocked admin.
When I made these changes, I also replaced
system()
calls withKernel::exec()
because there is no need to keep the ruby processaround once we've authenticated the user.