git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: ACLs for GIT

From
Sitaram Chamarty <sitaramc@gmail.com>
Date
May 17, 2011, 12:08 UTC
Message-ID
<BANLkTimPbQe7DGmR0VvDkU3=ZNjcAu7axw@mail.gmail.com>
In-Reply-To
<BANLkTi=9vp+ibVa3tQzXbZSeYATKwmF60Q@mail.gmail.com>
On Tue, May 17, 2011 at 7:19 AM, Shawn Pearce <spearce@spearce.org> wrote:
> On Mon, May 16, 2011 at 18:32, Sitaram Chamarty <sitaramc@gmail.com> wrote:
Show 7 quoted lines
>> PS: Gitolite does have unreleased code to do this but it's a hack with
>> several limitations.  Gitolite makes a temp "clone -l", deletes all
>> refs from it that the user has no access to, then redirects the
>> git-upload-pack to that repo instead ;-)
>
> Cute hack. Doesn't prevent the evil client from making an indirect
> reference to something you shouldn't have. :-)

You mean he constructs a commit that references a SHA he should not be having, pushes that to the branch he is allowed to read/write, then pulls it down again to now really get that commit?

Yeah, I started writing a hook that looks at `rev-list oldsha..newsha`, and for each commit run `git branch --contains SHA` and make sure it either (a) is totally new to the repo, ie no ref contains this commit or (b) at least one of the refs that contains this commit is allowed for this user.

I haven't had time to do that though. Also, if there has been a rewind/force-push and the attacker knows the now unreachable SHA, this would not catch it (it'd look like a totally new commit). That's a hard one.

Having two repos is still the best plan ;-)
Previous: Shawn PearceNext: Shawn Pearce
Message 12 of 15 in “ACLs for GIT”
  1. Martin L ResnickMay 15, 2011
  2. Magnus BäckMay 15, 2011
  3. Martin L ResnickMay 16, 2011
  4. Richard PetersonMay 16, 2011
  5. Phil HordMay 16, 2011
  6. Martin L ResnickMay 16, 2011
  7. Jakub NarebskiMay 16, 2011
  8. R. Tyler CroyMay 15, 2011
  9. Martin L ResnickMay 16, 2011
  10. Sitaram ChamartyMay 17, 2011
  11. Shawn PearceMay 17, 2011
  12. Sitaram ChamartyMay 17, 2011
  13. Shawn PearceMay 17, 2011
  14. Sitaram ChamartyMay 17, 2011
  15. Marc WeberMay 15, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.