From: Jakub Narebski <jnareb@gmail.com>
To: Martin L Resnick <mresnick@bbn.com>
Cc: "Magnus Bäck" <magnus.back@sonyericsson.com>, git@vger.kernel.org
Subject: Re: ACLs for GIT
Date: Mon, 16 May 2011 09:28:17 -0700 (PDT) [thread overview]
Message-ID: <m3oc32zk4a.fsf@localhost.localdomain> (raw)
In-Reply-To: <4DD1250D.50005@bbn.com>
Martin L Resnick <mresnick@bbn.com> writes:
> On 05/15/2011 04:15 PM, Magnus Bäck wrote:
>> On Sunday, May 15, 2011 at 21:24 CEST,
>> Martin L Resnick<mresnick@bbn.com> wrote:
>>
>>> Is anyone working on adding access control to GIT ?
>>>
>>> I'm looking for the Subversion equivalent of mod_authz_svn.
>>> I need to restrict read access of ITAR documents that are
>>> scattered throughout the source tree.
>>> This restriction would need to deny fetch of the ITAR
>>> documents yet allow fetch of any other files.
>>>
>>> Looking through the source code it would seem that
>>> putting a hook call in the fetch-pack code would do it.
>>
>> I doubt it would make sense to put per-file permissions in Git
>> as it doesn't version files but the complete state of a workspace.
>> Even if you manage to hack the pack code to not include certain
>> blobs when certain users ask for them, what would those users
>> do when they want to create new commits based on commits where
>> blobs are missing? Or would you send the protected blobs but
>> replace their contents? Then Git would complain about that.
>>
>> However, both Gerrit Code Review and Gitolite offer per-branch
>> permissions, so if it would be possible to put these files on
>> branches of their own these tools would help.
>
> You pointed out some hurdles I'll have to think about
> (blocked files not matching the SHA and so can't be committed).
>
> As to why I want to do this consider NSA non-export rules.
> Our application would be built with NSA encryption
> but we have foreign nationals working on the code
> and so they are not permitted to see that part.
> The makefiles look to see if the NSA encryption code file
> is there and link it in. If not a stub is used.
You have to remember that with exception of submodules, which can be
fetched or not, all operations between repositories operate on whole
tree basis. The commit in Git (i.e. a single revision) always contain
_all_ the files in repository (with exception of submodules).
ACL in e.g. Gitolite allow to refuse push if there are changes to
specified paths (per-file access control), but it wouldn't and
couldn't preent from viewing such "restricted" files.
1. What you can do is manage two unrelated branches (without common
ancestor one orphan to the other), "private" and "public". You do
public work on branches starting on public branch, and merge both to
public and private, and you do private work on branches starting at
private branch, and merge only to private. The public publishing
repository (e.g. on GitHub or repo.or.cz) would have only "public"
branch, while private clone (e.g. on intranet, or on private
repository on GitHub) would have both branches.
2. Another solution that could work is to have stubs for "restricted"
files, and in private repository use git-replace mechanism to replace
those stubs with "restricted" contents. Again in public publishing
repository you woldn't have refs/replace published, while in private
one you would have refs/replace and git would show "restricted"
contents replacing stubs. NOT TESTED!.
3. As other wrote, you can have yet another solution: use submodules.
You would put "restricted" contents in submodule, and just not make
repository that makes submodule public. What would be visible would
be only SHA-1 of contents in supermodule. This assumes that you can
disentanle files into submodules (loose connection)...
--
Jakub Narebski
Poland
ShadeHawk on #git
next prev parent reply other threads:[~2011-05-16 16:28 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-15 19:24 ACLs for GIT Martin L Resnick
2011-05-15 20:15 ` Magnus Bäck
2011-05-16 13:22 ` Martin L Resnick
2011-05-16 15:26 ` Richard Peterson
2011-05-16 15:33 ` Phil Hord
2011-05-16 15:36 ` Martin L Resnick
2011-05-16 16:28 ` Jakub Narebski [this message]
2011-05-15 20:16 ` R. Tyler Croy
2011-05-16 13:22 ` Martin L Resnick
2011-05-17 1:32 ` Sitaram Chamarty
2011-05-17 1:49 ` Shawn Pearce
2011-05-17 12:08 ` Sitaram Chamarty
2011-05-17 14:06 ` Shawn Pearce
2011-05-17 15:41 ` Sitaram Chamarty
2011-05-15 20:28 ` Marc Weber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3oc32zk4a.fsf@localhost.localdomain \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
--cc=magnus.back@sonyericsson.com \
--cc=mresnick@bbn.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).