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

Re: What's up with the GIT archive on www.kernel.org?

From
Linus Torvalds <torvalds@osdl.org>
Date
Sep 12, 2005, 18:37 UTC
Message-ID
<Pine.LNX.4.58.0509121128170.3242@g5.osdl.org>
In-Reply-To
<12c511ca050912112266470d8b@mail.gmail.com>
On Mon, 12 Sep 2005, Tony Luck wrote:
> 
> Should the git daemon take a look at objects/info/alternates to check
> that if it exists, it points to a repository that also has a
> "git-daemon-export-ok" file?

I considered it, but decided against the complexity. I just don't see the point. The "git-daemon-export-ok" is not so much about security as about _accidental_ exposure.

Remember: the security is in the writing. If you allow "bad people" enough
capabilities that they can create their own git archive and can read the
target archive, those "bad people" could just export the target archive
some other way in the first place (ie they could have just copied the
files over to their own area).

And there are actually real downsides to requiring "git-daemon-export-ok" from a security standpoint. In particular, imagine that a company has a "master archive", and wants to export just a particular "public branch" from that master archive. The way you can do that right now is to create a dummy git archive, that is empty except for having one head (symlink to the public branch head in the master) and an "alternates" pointer to the master.

See? You don't actually want to expose the master archive itself: so requiring that one to also have "git-daemon-export-ok" would actually _defeat_ the security in the system.

So the git approach to security is that you secure the writing side. That's where you use ssh. And even if you happen to run git-daemon, it will never export anything that you didn't explicitly mark for export, so it defaults to a "nothing exported" mode. But once you mark a project for public export, the branches exposed there really are public.

(And the branches _not_ exposed there are private. Sure, if you can guess the SHA1 ID's, you can make git-daemon export them, but the point is that git-daemon will never expose any SHA1's from other projects unless they have the "git-daemon-export-ok" flag set. And the thing is, if you know the SHA1's, you already know the contents and you had a leak some other way, so..).

			Linus
Previous: Tony LuckNext: Junio C Hamano
Message 17 of 18 in “Re: What's up with the GIT archive on www.kernel.org?”
  1. Linus TorvaldsSep 11, 2005
  2. Sam RavnborgSep 11, 2005
  3. Linus TorvaldsSep 11, 2005
  4. Roland DreierSep 11, 2005
  5. Linus TorvaldsSep 11, 2005
  6. Linus TorvaldsSep 11, 2005
  7. Junio C HamanoSep 12, 2005
  8. Dmitry TorokhovSep 12, 2005
  9. Ryan AndersonSep 12, 2005
  10. Linus TorvaldsSep 12, 2005
  11. Define relative .git/objects/info/alternates semantics.Junio C Hamano, Sep 13, 2005
  12. Linus TorvaldsSep 13, 2005
  13. Junio C HamanoSep 13, 2005
  14. Daniel BarkalowSep 13, 2005
  15. H. Peter AnvinSep 12, 2005
  16. Tony LuckSep 12, 2005
  17. Linus TorvaldsSep 12, 2005
  18. Junio C HamanoSep 11, 2005

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.