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

Re: Git and securing a repository

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jan 3, 2008, 05:19 UTC
Message-ID
<20080103051931.GC24004@spearce.org>
In-Reply-To
<477C7BF8.2090406@advancedsl.com.ar>
Gonzalo Garramuo <ggarra@advancedsl.com.ar> wrote:
Show 16 quoted lines
> Shawn O. Pearce wrote:
> >
> >Its a distributed version control system.  All peers are equal.
> >Most security in Git is handled by only pulling from sources you
> >trust, and never allowing someone to push stuff into a repository
> >you own.
> >
> 
> Regarding that... is there a way to control the umask of a git clone 
> independent of the actual umask of the user or directories inside the 
> repository?  Ideally, on the server side?
> 
> That is, for sensitive repositories, I would like "git clone" to always 
> clone that repository with 0700 permissions, so that the silly mistake 
> of cloning a sensitive repository into a public directory and forgetting 
> to restrict its permissions can be avoided completely.
No.

For a local clone (same UNIX system) you could probably easily modify git-clone.sh to consult the config file of the source repository to obtain recommended initial permissions, or just use the source repository's directory permissions as the new clone's initial permissions. But not everyone would want that behavior.

For a remote clone (different systems) the config file of the source repository isn't easily available. So its not easily used to get that setting. The git protocol would have to be extended to make transfer of parts of the config file possible. We've talked about this in the past but have never had a compelling application to cause patches to be submitted for it.

-- 
Shawn.
Previous: Gonzalo GarramuñoNext: Jakub Narebski
Message 12 of 18 in “Git and securing a repository”
  1. Gonzalo GarramuñoJan 2, 2008
  2. Felipe BalbiJan 2, 2008
  3. Gonzalo GarramuñoJan 2, 2008
  4. David SymondsJan 2, 2008
  5. Gonzalo GarramuñoJan 2, 2008
  6. Jakub NarebskiJan 2, 2008
  7. Shawn O. PearceJan 3, 2008
  8. Bruno Cesar RibasJan 3, 2008
  9. Gonzalo GarramuñoJan 3, 2008
  10. Shawn O. PearceJan 3, 2008
  11. Gonzalo GarramuñoJan 3, 2008
  12. Shawn O. PearceJan 3, 2008
  13. Jakub NarebskiJan 3, 2008
  14. Junio C HamanoJan 3, 2008
  15. Jan HudecJan 2, 2008
  16. Gregory JefferisJan 2, 2008
  17. Linus TorvaldsJan 2, 2008
  18. Daniel BarkalowJan 2, 2008

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.