>i have a setup a sftp-only ssh for those ldap/ad users,
>each one limited (ssh chrootdirectory) to their homedirectory
>
>
https://wiki.debian.org/LDAP/NSS
>(sssd caching though)
The meta-issues here are complicated, and with anything involving security
there are tons of trade-offs.
My personal concern here is this setup requires you to put all of
your users in the password database which exposes those users to all other
programs on that system. This kind of defeats the whole purpose of
gitolite in my mind, as gitolite is constructed so you DON'T have to do
that. In addition, because you authenticate to the ssh server as
individual users you have to perform a bunch of gyrations, usually
involving "sudo", to switch your userid to the gitolite user and that's
a lot of moving parts and crossing of authentication boundaries (you
authenticate as user "foo", THEN become root, THEN become the gitolite
user).
Now it must be said that plenty of people regard this as perfectly
acceptable, and I can understand why they feel that way. I've certainly
done plenty of weird security-related gyrations in my day. I just
feel you need to go into that with your eyes completely open as to
how this works and understand all of the implications.
>> I will note that the security on the above setup depends on a script
>> (the "gitolite-shell-force-noninteractive.sh" script) that looks
>> trivial to defeat.
>
>do you have other suggestions?
Well, the SPECIFIC concern that the above script is addressing is that
if a user gets onto that system without going through the ssh system
they could access any gitolite repo given the sudo configuration. That
script works by running the "tty" command, but that is easy to bypass.
I'm not sure there's a wonderful solution there, given that this setup
requires you to put all of your users in the password database. Yes,
you can carefully lock down ssh, but that really is putting all of your
eggs in one basket.
In terms of a larger issue, since you are using AD Kerberos authentication
is an option; I posted my configuration for that on this list a month
ago. I will be the first to admit that even though I think Kerberos is
good authentication protocol, it can be complicated to implement; again,
one of those security trade-offs.
--Ken