From: "Shawn O. Pearce" <spearce@spearce.org>
To: Arun Raghavan <ford_prefect@gentoo.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 0/2] upload-pack: pre- and post- hooks
Date: Mon, 1 Feb 2010 08:01:41 -0800 [thread overview]
Message-ID: <20100201160141.GG8916@spearce.org> (raw)
In-Reply-To: <6f8b45101002010750t5541faefv5b4640dfb9949306@mail.gmail.com>
Arun Raghavan <ford_prefect@gentoo.org> wrote:
> On 1 February 2010 20:50, Shawn O. Pearce <spearce@spearce.org> wrote:
> > Arun Raghavan <ford_prefect@gentoo.org> wrote:
> >> This patch set reintroduces the post-upload-pack hook and adds a
> >> pre-upload-pack hook. These are now only built if 'ALLOW_INSECURE_HOOKS' is set
> >> at build time. The idea is that only system administrators who need this
> >> functionality and are sure the potential insecurity is not relevant to their
> >> system will enable it.
> >
> > *sigh*
> >
> > I guess this is better, having it off by default, but allowing an
> > administrator who needs this feature to build a custom package.
> >
> > Unfortunately... I'm sure some distro out there is going to think
> > they know how to compile Git better than we do, and enable this by
> > default, exposing their users to a security hole. ?Ask the OpenSSL
> > project about how well distros package code... ?:-\
> >
> > I'd like a bit more than just a compile time flag.
>
> I was hoping the all-caps INSECURE in the name would give
> distributors pause. :)
>
> Suggestions on what else might work?
At one point we were talking about checking the owner of the hook
script itself. If it was uid 0 or the current actual user uid,
then we run the hook, otherwise we don't.
That only really works on POSIX platforms, but it does make some
sense. Root can already screw with you by replacing the binary
you are executing, so any hook they own is no more risky than the
git-upload-pack you just started.
If its the actual user uid, then systems like gitosis can still
make use of the hook by making the hook owned by the "git" user
that gitosis is executing all sessions under.
But mixed user systems, the hook would only run for the user who
created it, and be skipped for everyone else.
I'm not really sure what to do on Win32 here. Everyone is usually
Administrator these days which makes the test for "root" there
somewhat pointless. Maybe its just not enabled on Win32.
> >> At some point if the future, if needed, this could also be made a part of the
> >> negotiation between the client and server.
> >
> > I'm not sure I follow.
> >
> > Are you proposing the server advertises that it wants to run hooks,
> > and lets the client decide whether or not they should be executed?
>
> Something like that. I was thinking the client could always advertise
> whether the it wants to allow the hooks to be executed or not (which
> would override the default value of the global variable I introduced).
> Either approach would work, though the second is simpler but also
> dumber.
>
> Again, this might be over-complicating things, which is why I did not
> implement it. I just wanted to make a note of the fact that this could
> be done if the need is felt.
My concern with this is, users might disable the hook all of the
time, and then servers that actually want the hook (e.g. gentoo's
use of the pre-upload-pack to avoid initial clones over git://)
would be stuck, just like they are today.
No, its just not sane to give the user a choice whether or not they
should execute something remotely.
--
Shawn.
next prev parent reply other threads:[~2010-02-01 16:07 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-14 18:01 Removal of post-upload-hook Arun Raghavan
2010-01-14 19:36 ` Jeff King
2010-01-14 19:41 ` Shawn O. Pearce
2010-01-14 19:52 ` Arun Raghavan
2010-01-14 20:43 ` Jeff King
2010-01-14 21:06 ` Robin H. Johnson
2010-01-15 14:47 ` Jeff King
2010-01-15 6:12 ` Arun Raghavan
2010-01-15 11:52 ` Ilari Liusvaara
2010-01-15 12:14 ` Arun Raghavan
2010-02-01 8:32 ` [PATCH 0/2] upload-pack: pre- and post- hooks Arun Raghavan
2010-02-01 8:32 ` [PATCH 1/2] upload-pack: Reinstate the post-upload-pack hook Arun Raghavan
2010-02-01 8:32 ` [PATCH 2/2] upload-pack: Add a pre-upload-pack hook Arun Raghavan
2010-02-01 15:20 ` [PATCH 0/2] upload-pack: pre- and post- hooks Shawn O. Pearce
2010-02-01 15:50 ` Arun Raghavan
2010-02-01 16:01 ` Shawn O. Pearce [this message]
2010-02-02 5:50 ` Arun Raghavan
2010-02-01 16:30 ` Nicolas Pitre
2010-02-01 16:36 ` Shawn O. Pearce
2010-02-02 5:52 ` Arun Raghavan
2010-02-02 6:15 ` Nicolas Pitre
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=20100201160141.GG8916@spearce.org \
--to=spearce@spearce.org \
--cc=ford_prefect@gentoo.org \
--cc=git@vger.kernel.org \
/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).