On Tuesday, June 26, 2012 at 09:08 EDT,
Gavin Hamill <
g...@acentral.co.uk> wrote:
> I'm fairly green to DVCS, having come from an SVN sysadmin background.
> Our organisation would like to implement Git as its VCS but has the
> typical enterprise concerns regarding access control and audit trail.
>
> We started with gitolite, but I believe Gerrit is better suited to our
> needs, GUI ACL and SSH key management being the main reasons - we
> don't yet have a requirement for code review.
>
> However, on the topic of audit trail the waters are rather more
> murky..
>
> Since one can set user.email and
user.name to anything, I'm thinking
> of a hook (pre-receive ?) to verify the user.email used in the
> Author/Committer field against our company directory. The SSH key
> used for the push should map to a username I can look up in the LDAP
> directory and match that the LDAP 'mail' attribute matches the
> user.email from Git, right?
Gerrit already does this for you. Via ACLs you can select which users
should be allowed to forge their author email or their committer email.
For practical reasons you'll probably want the author email to be
forgeable (and it's the default), but regular users typically don't
need the ability to forge the committer email.
http://gerrit-documentation.googlecode.com/svn/Documentation/2.4/access-control.html#category_forge_author
> This is OK as far as the simple centralised workflow goes; it will
> break when Author != Committer for Integration-Manager workflow,
> cherry-picking, etc. but that's OK - team projects enjoy their own
> level of policing at the social + business level.
Right.
> So, new code going into the repo can be watched but I'm curious if a
> sane logging format can be enforced for read operations like cloning?
>
> Much of this is within Git itself rather than Gerrit, but if Gerrit is
> providing the ssh daemon then there might be an opportunity to dive a
> bit deeper...
The sshd_log logfile logs the following information for clone/fetch
operations:
[2012-06-26 09:32:18,807 -0400] 6cea5c08 baeck a/1000000 LOGIN FROM <client IP address>
[2012-06-26 09:32:19,718 -0400] 6cea5c08 baeck a/1000000 'git-upload-pack '\''/test'\''' 237ms 647ms 0
[2012-06-26 09:32:19,756 -0400] 6cea5c08 baeck a/1000000 LOGOUT
So, you get the SSH username, client IP address, which repository, and
some timing information whose exact interpretation has escaped me.
--
Magnus Bäck
ba...@google.com