Subject: Re: Repository Security

From: Andy Parkins <[email-masked]>
Date: Tue, 23 Jan 2007 15:00:33 +0000

On Tuesday 2007 January 23 13:23, Andre Masella wrote:

> Okay, say one regular developer wants share his changes with another
> developer. He either has to mail patches, create an SSH account, or set up
> one of git-daemon or WebDAV. And most of those require knowing the
> workstation name which is inconvienient. I would rather have each user able
> to push to a branch with their name on it on a central server.

So: developer1 is allowed to make changes to central's branch br/developer1, 
say.  How is the central server going to be sure that it is developer1 
connecting?  Probably a username and password.  In which case you have a user 
account - which is what you would have with ssh.  The difference would be 
that with ssh you would have full access to all the authentication and 
authorisation mechanisms of a standard UNIX system; LDAP, NIS, timed-logins, 
etc.  If git were to implement authorisation itself then it would need all 
these modules writing again.

I don't know if this would work with git, but once you had real users, you 
could simply do
 $ mkdir refs/heads/dev1
 $ chown dev1.developers refs/heads/dev1
 $ chmod 755 refs/heads/dev1
 $ chmod u+s refs/heads/dev1
And then only dev1 would be able to write references in refs/heads/dev1.

(The above is untested in git; but with a bit more work I'm sure it could be 
made to operate)

git has a marvellous property that it won't change objects in the object 
database - it will only add new objects.  That makes it more difficult to do 
actual harm over the git-protocol.  For my few users, who already had 
accounts, and are part of a group, I simply made a group-writeable SGID 
directory for git repositories, created the repositories, set the config and 
left them to it.  With reflogs turned on, there is no damage they can do that 
can't be undone.

Andy

-- 
Dr Andy Parkins, M Eng (hons), MIEE
[email-masked]