You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Eric Covener <co...@gmail.com> on 2007/08/29 16:28:17 UTC
authnz_ldap in 2.2.x
mod_authnz_ldap in 2.2.x doesn't track whether or not it has seen any
applicable 'Require ldap-*' entries in the requires list, and also
doesn't explicitly accept valid-user (despite a commnt)
Other authz modules check that their flavor of Require was present
where they check if they're configured to be authoritative. At the
simplest level, this allows the authz modules to DECLINE and let
authz_user authorize based on "Require valid-user"
To do authn-only where LDAP is used as the basic provider, (or
otherwise configured in that context) you have to make LDAP
non-authoritative or come up with some LDAP filter or attribute that
is always true.
Is this something were stuck with in a stable release? The trunk
authz provider API makes this relevant only to 2.2.x.
--
Eric Covener
covener@gmail.com
Re: authnz_ldap in 2.2.x
Posted by Brad Nicholes <BN...@novell.com>.
>>> On 8/30/2007 at 4:36 PM, in message
<14...@mail.gmail.com>, "Eric Covener"
<co...@gmail.com> wrote:
> On 8/30/07, Brad Nicholes <BN...@novell.com> wrote:
>> >>> On 8/29/2007 at 7:51 PM, in message
>> <14...@mail.gmail.com>, "Eric Covener"
>> <co...@gmail.com> wrote:
>> >
>> > In 2.2.x If authz_XXX are one of dbm, owner, or groupfile they track
>> > the list of requires and decline if they don't see any they're
>> > responsible for -- this isn't a crap shoot of module ordering in this
>> > case.
>> >
>> > $ grep \!required *.c
>> > mod_authz_dbm.c: if (!required_group || !conf->authoritative) {
>> > mod_authz_groupfile.c: if (!required_group || !conf->authoritative) {
>> > mod_authz_owner.c: if (!required_owner || !conf->authoritative) {
>> > mod_authz_user.c: if (!required_user) {
>> >
>> > That roughly leaves authz_host, authz_default, and authnz_ldap.
>> > authz_host has a built-in default based on Order, and authz_default
>> > doesn't have any Requires to check -- leaving authnz_ldap as the odd
>> > man out.
>> >
>>
>> True, so that brings up the question of what does AuthzXXXAuthoritative
> really mean? Does it mean that if set to ON, this module is authoritatively
> responsible for authorization and if it can't (whatever the reason including
> no require statement), then authorization fails? Or does it mean that the
> module is only authoritatively responsible for authorization if a matching
> require statement exists? According to what you are saying as well as what
> the code is currently saying in the other authz modules, the latter is true.
> And if that is really the definition of AuthzXXXAuthoritative, then it
> appears that authnz_ldap needs to be fixed.
>>
>> Brad
>>
>
> For the ones in the list above it seems to roughly be:
>
> if an authz_XXX require is satisfied, return OK
> If authz_XXX is authoritative, and any authz_XXX require directives
> were present, return HTTP_UNAUTHORIZED
> else return DECLINED
>
> Any clue from a development process POV how I'd propose such a thing
> for "backport" since it doesn't apply to trunk? I was also hoping
> some more people might weigh in on the behavior change for
> mod_authnz_ldap in a stable release.
Welcome to the world of ldap development in Apache, outside of a very small group of us, there usually isn't much response from anyone else. :( I would suggest that you write a patch and either post the patch file in your people.apache.org user dir so that it is easily accessible from the web or attach it to a bugzilla bug that can be referenced. Then write your backport proposal in the 2.2 STATUS file and reference the patch file directly rather than a link into SVN. Also note that this is specific to 2.2 and does not apply to trunk due to the authorization refactoring going forward.
Brad
Re: authnz_ldap in 2.2.x
Posted by Eric Covener <co...@gmail.com>.
On 8/30/07, Brad Nicholes <BN...@novell.com> wrote:
> >>> On 8/29/2007 at 7:51 PM, in message
> <14...@mail.gmail.com>, "Eric Covener"
> <co...@gmail.com> wrote:
> >
> > In 2.2.x If authz_XXX are one of dbm, owner, or groupfile they track
> > the list of requires and decline if they don't see any they're
> > responsible for -- this isn't a crap shoot of module ordering in this
> > case.
> >
> > $ grep \!required *.c
> > mod_authz_dbm.c: if (!required_group || !conf->authoritative) {
> > mod_authz_groupfile.c: if (!required_group || !conf->authoritative) {
> > mod_authz_owner.c: if (!required_owner || !conf->authoritative) {
> > mod_authz_user.c: if (!required_user) {
> >
> > That roughly leaves authz_host, authz_default, and authnz_ldap.
> > authz_host has a built-in default based on Order, and authz_default
> > doesn't have any Requires to check -- leaving authnz_ldap as the odd
> > man out.
> >
>
> True, so that brings up the question of what does AuthzXXXAuthoritative really mean? Does it mean that if set to ON, this module is authoritatively responsible for authorization and if it can't (whatever the reason including no require statement), then authorization fails? Or does it mean that the module is only authoritatively responsible for authorization if a matching require statement exists? According to what you are saying as well as what the code is currently saying in the other authz modules, the latter is true. And if that is really the definition of AuthzXXXAuthoritative, then it appears that authnz_ldap needs to be fixed.
>
> Brad
>
For the ones in the list above it seems to roughly be:
if an authz_XXX require is satisfied, return OK
If authz_XXX is authoritative, and any authz_XXX require directives
were present, return HTTP_UNAUTHORIZED
else return DECLINED
Any clue from a development process POV how I'd propose such a thing
for "backport" since it doesn't apply to trunk? I was also hoping
some more people might weigh in on the behavior change for
mod_authnz_ldap in a stable release.
--
Eric Covener
covener@gmail.com
Re: authnz_ldap in 2.2.x
Posted by Brad Nicholes <BN...@novell.com>.
>>> On 8/29/2007 at 7:51 PM, in message
<14...@mail.gmail.com>, "Eric Covener"
<co...@gmail.com> wrote:
>
> In 2.2.x If authz_XXX are one of dbm, owner, or groupfile they track
> the list of requires and decline if they don't see any they're
> responsible for -- this isn't a crap shoot of module ordering in this
> case.
>
> $ grep \!required *.c
> mod_authz_dbm.c: if (!required_group || !conf->authoritative) {
> mod_authz_groupfile.c: if (!required_group || !conf->authoritative) {
> mod_authz_owner.c: if (!required_owner || !conf->authoritative) {
> mod_authz_user.c: if (!required_user) {
>
> That roughly leaves authz_host, authz_default, and authnz_ldap.
> authz_host has a built-in default based on Order, and authz_default
> doesn't have any Requires to check -- leaving authnz_ldap as the odd
> man out.
>
True, so that brings up the question of what does AuthzXXXAuthoritative really mean? Does it mean that if set to ON, this module is authoritatively responsible for authorization and if it can't (whatever the reason including no require statement), then authorization fails? Or does it mean that the module is only authoritatively responsible for authorization if a matching require statement exists? According to what you are saying as well as what the code is currently saying in the other authz modules, the latter is true. And if that is really the definition of AuthzXXXAuthoritative, then it appears that authnz_ldap needs to be fixed.
Brad
Re: authnz_ldap in 2.2.x
Posted by Eric Covener <co...@gmail.com>.
On 8/29/07, Brad Nicholes <bn...@novell.com> wrote:
> > To clarify; I understand not duplicating valid-user, but the other
> > authz modules know to decline when they haven't seen a single
> > requirement they grok, which allows mod_authz_user to authorize the
> > request in the case of "Require valid-user". I don't think the
> > coupling is a factor there.
>
>
> No, all of the authz modules should be working the same. They
> all have an AuthzXXXAuthoritative directive which defaults to
> ON. The problem with 2.0 and 2.2 is that if you load multiple
> authz modules and try to use multiple require statements, you
> have no guarantee as to which authz handler will get called
> first. So it might look like authz_XXX module is DECLINEing
> and allowing authz_user's "Require valid-user" to handle the
> authorization, when in fact the authz_XXX handler was never
> called at all.
In 2.2.x If authz_XXX are one of dbm, owner, or groupfile they track
the list of requires and decline if they don't see any they're
responsible for -- this isn't a crap shoot of module ordering in this
case.
$ grep \!required *.c
mod_authz_dbm.c: if (!required_group || !conf->authoritative) {
mod_authz_groupfile.c: if (!required_group || !conf->authoritative) {
mod_authz_owner.c: if (!required_owner || !conf->authoritative) {
mod_authz_user.c: if (!required_user) {
That roughly leaves authz_host, authz_default, and authnz_ldap.
authz_host has a built-in default based on Order, and authz_default
doesn't have any Requires to check -- leaving authnz_ldap as the odd
man out.
--
Eric Covener
covener@gmail.com
Re: authnz_ldap in 2.2.x
Posted by Brad Nicholes <bn...@novell.com>.
>>> On 8/29/2007 at 3:14 PM, in message
<14...@mail.gmail.com>, "Eric Covener"
<co...@gmail.com> wrote:
> On 8/29/07, Brad Nicholes <BN...@novell.com> wrote:
>> The only real reason why you have to set LDAP to
>> non-authoritative when using LDAP authn only, is because LDAP
>> had to combine both authn and authz into the same module. This
>> is not a good practice in general, but in the case of LDAP there
>> was so much code and data overlap between authn_ldap and
>> authz_ldap, that splitting them apart was a problem.
>
>
> To clarify; I understand not duplicating valid-user, but the other
> authz modules know to decline when they haven't seen a single
> requirement they grok, which allows mod_authz_user to authorize the
> request in the case of "Require valid-user". I don't think the
> coupling is a factor there.
No, all of the authz modules should be working the same. They all have an AuthzXXXAuthoritative directive which defaults to ON. The problem with 2.0 and 2.2 is that if you load multiple authz modules and try to use multiple require statements, you have no guarantee as to which authz handler will get called first. So it might look like authz_XXX module is DECLINEing and allowing authz_user's "Require valid-user" to handle the authorization, when in fact the authz_XXX handler was never called at all. This problem has been taken care of in 2.3. The difference between mod_authnz_ldap and other authz modules is that in most cases, an Authz module is not loaded unless it is needed. In the case of Authnz_LDAP, you don't have that option. If you load Authnz_LDAP, you get both authn and authz even if you don't want to use the authz side. So your only choice is to disable it by setting the AuthzLDAPAuthoritative to OFF.
Brad
Re: authnz_ldap in 2.2.x
Posted by Eric Covener <co...@gmail.com>.
On 8/29/07, Brad Nicholes <BN...@novell.com> wrote:
> The only real reason why you have to set LDAP to
> non-authoritative when using LDAP authn only, is because LDAP
> had to combine both authn and authz into the same module. This
> is not a good practice in general, but in the case of LDAP there
> was so much code and data overlap between authn_ldap and
> authz_ldap, that splitting them apart was a problem.
To clarify; I understand not duplicating valid-user, but the other
authz modules know to decline when they haven't seen a single
requirement they grok, which allows mod_authz_user to authorize the
request in the case of "Require valid-user". I don't think the
coupling is a factor there.
--
Eric Covener
covener@gmail.com
Re: authnz_ldap in 2.2.x
Posted by Brad Nicholes <BN...@novell.com>.
>>> On 8/29/2007 at 8:28 AM, in message
<14...@mail.gmail.com>, "Eric Covener"
<co...@gmail.com> wrote:
> mod_authnz_ldap in 2.2.x doesn't track whether or not it has seen any
> applicable 'Require ldap-*' entries in the requires list, and also
> doesn't explicitly accept valid-user (despite a commnt)
>
> Other authz modules check that their flavor of Require was present
> where they check if they're configured to be authoritative. At the
> simplest level, this allows the authz modules to DECLINE and let
> authz_user authorize based on "Require valid-user"
>
> To do authn-only where LDAP is used as the basic provider, (or
> otherwise configured in that context) you have to make LDAP
> non-authoritative or come up with some LDAP filter or attribute that
> is always true.
>
> Is this something were stuck with in a stable release? The trunk
> authz provider API makes this relevant only to 2.2.x.
Yes, the idea, even going forward into 2.3, is to not have overlapping authz types. It doesn't really make sense to have all of the various authz modules replicate "valid-user". There should only be one authz module that implements an authorization type. That is why you only see authz_user implement "user" where authnz_ldap implements "ldap-user". They both authorize users in different ways. In 2.0 if both mod_auth and mod_auth_ldap were both loaded (for whatever reason), they both implemented "user". So when your configuration used "require user", you never really knew which one you were getting.
The only real reason why you have to set LDAP to non-authoritative when using LDAP authn only, is because LDAP had to combine both authn and authz into the same module. This is not a good practice in general, but in the case of LDAP there was so much code and data overlap between authn_ldap and authz_ldap, that splitting them apart was a problem.
Brad