1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-06 16:49:32 +03:00
Commit Graph

63 Commits

Author SHA1 Message Date
Stefan Fritsch
1008c27260 Allow authz providers to check args while reading the config and allow
them to cache parsed args.

Use this to check that argument to 'all' provider is 'granted' or 'denied'.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@998706 13f79535-47bb-0310-9956-ffa450edef68
2010-09-19 17:55:47 +00:00
Stefan Fritsch
aa576071af - Remove a load of unused variables (or variables that are set but never read).
- Move some declarations into the correct #ifdef scope.

I couldn't compile/test netware, but the changes look obvious enough.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@982016 13f79535-47bb-0310-9956-ffa450edef68
2010-08-03 19:45:21 +00:00
Stefan Fritsch
f14218c7ad The approach for allowing authorization by user or IP introduced in r956387,
etc. causes problems because the authentication module calls
note_*_auth_failure if authentication fails. This is inappropriate if access is
later allowed because of the IP.

So, instead of calling the auth_checker hook even if authentication failed, we
introduce a new access_checker_ex hook that runs between the access_checker and
the check_user_id hooks. If an access_checker_ex functions returns OK, the
request will be allowed without authentication.

To make use of this, change mod_authz_core to walk the require blocks in the
access_checker_ex phase and deny/allow the request if the authz result does not
depend on an authenticated user. To distinguish a real AUTHZ_DENIED from an
authz provider from an authz provider needing an authenticated user, the latter
must return the new AUTHZ_DENIED_NO_USER code.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@964156 13f79535-47bb-0310-9956-ffa450edef68
2010-07-14 19:59:31 +00:00
Stefan Fritsch
56eaabbe46 more pid logging cleanup
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@956376 13f79535-47bb-0310-9956-ffa450edef68
2010-06-20 17:04:34 +00:00
Stefan Fritsch
ebb62867fb Use the new APLOG_USE_MODULE/AP_DECLARE_MODULE macros everywhere to take
advantage of per-module loglevels


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951895 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 16:59:50 +00:00
Eric Covener
67f3df7be5 When checking direct group membership, interpret LDAP_NO_SUCH_ATTRIBUTE the same as
LDAP_COMPARE_FALSE and continue on to subgroup (nested group) processing. This 
triggers when the group has no "direct" members but may have entries that 
represent nested groups to check.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@950249 13f79535-47bb-0310-9956-ffa450edef68
2010-06-01 21:26:28 +00:00
Eric Covener
a8720fa901 mod_authnz_ldap: Search or Comparison during authorization phase
can use the credentials from the authentication phase
(AuthLDAPSearchAsUSer,AuthLDAPCompareAsUser).
PR 48340 

Submitted by: Domenico Rotiroti, Eric Covener
Reviewed by: Eric Covener



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@950248 13f79535-47bb-0310-9956-ffa450edef68
2010-06-01 21:19:06 +00:00
Ruediger Pluem
4dda9383cb * Fix compiler warning
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@949673 13f79535-47bb-0310-9956-ffa450edef68
2010-05-31 07:15:35 +00:00
Eric Covener
d15983f1d1 mod_authnz_ldap: Allow the initial DN lookup to bind with a
transformation of the basic auth username.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@949436 13f79535-47bb-0310-9956-ffa450edef68
2010-05-29 20:19:10 +00:00
Eric Covener
27c654fc67 Allow mod_authnz_ldap to set environment variables when it only performs authorization.
AuthLDAPAuthorizePrefix can be used to force this to overlap with the prefix used
for authentication.

PR 45584


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@949336 13f79535-47bb-0310-9956-ffa450edef68
2010-05-29 02:32:22 +00:00
Stefan Fritsch
0d7fe7ffd7 mod_authnz_ldap: If AuthLDAPCharsetConfig is set, also convert the password to
UTF-8.

PR: 45318
Adapted patch from Johannes Müller


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@902654 13f79535-47bb-0310-9956-ffa450edef68
2010-01-24 21:52:29 +00:00
Eric Covener
fa60d18103 Change LDAP authentication failures (user->DN or password check) to log
level INFO from log level WARNING.  This is still liberal for authn
providers.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@902641 13f79535-47bb-0310-9956-ffa450edef68
2010-01-24 20:54:05 +00:00
Eric Covener
d5861f048a Add AuthLDAPBindAuthoritative to allow other authentication providers a chance
to run when mod_authnz_ldap finds a user but can't verify their password.

Submitted By: Justin Erenkrantz, Joe Schaefer, Tony Stevenson



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@881808 13f79535-47bb-0310-9956-ffa450edef68
2009-11-18 15:49:48 +00:00
Jeff Trawick
4ba05cdabb fix the name of this module in an error log message
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@745073 13f79535-47bb-0310-9956-ffa450edef68
2009-02-17 13:59:30 +00:00
Paul J. Reder
0ae9279219 mod_authnz_ldap: Reduce number of initialization debug messages and make
information more clear. PR 46342 [Dan Poirier]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@732912 13f79535-47bb-0310-9956-ffa450edef68
2009-01-09 02:32:12 +00:00
Chris Darroch
704feaaeb3 Implement checks for NULL r->user as per r705361.
NOTE: If someone with an LDAP setup can ensure this compiles and works,
that would be great.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@707183 13f79535-47bb-0310-9956-ffa450edef68
2008-10-22 20:11:07 +00:00
Nick Kew
e8dd90b487 mod_authnz_ldap: avoid returning NULL env vars
PR 39045


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@693328 13f79535-47bb-0310-9956-ffa450edef68
2008-09-09 00:52:03 +00:00
Eric Covener
bb7398fce0 revert r672639 which lacked a necessary major bump, add a major MMN bump
to account for the short-lived API addition/removal.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@678947 13f79535-47bb-0310-9956-ffa450edef68
2008-07-22 23:49:51 +00:00
Eric Covener
b159abbf7a caught by Ruediger
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@672671 13f79535-47bb-0310-9956-ffa450edef68
2008-06-29 20:09:45 +00:00
Eric Covener
bbc850ee33 mod_auth_digest: Detect during startup when AuthDigestProvider
is configured to use an incompatible provider via AuthnProviderAlias.
PR 45196 



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@672639 13f79535-47bb-0310-9956-ffa450edef68
2008-06-29 16:42:43 +00:00
Chris Darroch
9864958fcd Convert common provider version strings ("0") to
AUTHN/Z_PROVIDER_VERSION macros defined in mod_auth.h.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@658046 13f79535-47bb-0310-9956-ffa450edef68
2008-05-19 23:53:05 +00:00
Chris Darroch
c8ba67fb83 Avoid calling access control hooks for internal requests with
configurations which match those of the initial request.  Revert to
the original behaviour (call access control hooks for internal requests
with URIs different from the initial request) if any access control hooks
or providers are not registered as permitting this optimization.
Introduce wrappers for access control hook and provider registration
which can accept additional mode and flag data.

The configuration walk optimizations were originally proposed a while
ago (see http://marc.info/?l=apache-httpd-dev&m=116536713506234&w=2);
they have been used since then in production systems and appear to be
stable and effective.  They permit certain combinations of modules
and clients to function efficiently, especially when a deeply recursive
series of internal requests, such as those generated by certain WebDAV
requests, are all subject to the identical authentication and authorization
directives.

The major change from the original proposal is a cleaner mechanism for
detecting modules which may expect the old behaviour.  This has been
tested successfully with Subversion's mod_authz_svn, which specifically
requires the old behaviour when performing path-based authorization based
against its own private access control configuration files.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@644525 13f79535-47bb-0310-9956-ffa450edef68
2008-04-03 21:51:07 +00:00
Eric Covener
e5143bc75a return AUTHZ_GRANTED instead of OK from the LDAP nested group checking.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@633620 13f79535-47bb-0310-9956-ffa450edef68
2008-03-04 20:20:00 +00:00
Eric Covener
7c9503a556 When using the MS SDK, re-establish LDAP backend connections on a
return code of LDAP_UNAVAILABLE as if it were LDAP_SERVER_DOWN.

With this SDK, LDAP_UNAVAIALBLE is returned when the socket had been closed 
between LDAP API calls.

PR 39095



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@607766 13f79535-47bb-0310-9956-ffa450edef68
2007-12-31 19:20:25 +00:00
Paul J. Reder
4ae49c0ce4 Ooops. Not sure why this didn't get deleted in the last commit to this file. This
is no longer required due to the more optimal way the list of subgroup attributes
is now handled.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@600017 13f79535-47bb-0310-9956-ffa450edef68
2007-11-30 23:51:48 +00:00
Paul J. Reder
b92b10f079 Remove code that was both memory intensive and unnecessary. Replace the
complicated code with a simple list.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@599877 13f79535-47bb-0310-9956-ffa450edef68
2007-11-30 17:11:53 +00:00
Paul J. Reder
8e90a80064 Improve logged information and fix broken doc.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@599872 13f79535-47bb-0310-9956-ffa450edef68
2007-11-30 16:59:14 +00:00
Graham Leggett
1fc39f2164 mod_authnz_ldap, mod_authn_dbd: Tidy up the code to expose authn parameters to the environment. Improve portability to EBCDIC machines by using apr_toupper()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@571798 13f79535-47bb-0310-9956-ffa450edef68
2007-09-01 13:26:27 +00:00
Jim Jagielski
94d6c33002 detabify
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@563244 13f79535-47bb-0310-9956-ffa450edef68
2007-08-06 20:02:27 +00:00
Paul J. Reder
cc4a706e61 mod_ldap, mod_authnzldap: Add support for nested groups (i.e. the ability
to authorize an authenticated user via a "require ldap-group X" directive
     where the user is not in group X, but is in a subgroup contained in X.
     PR 42891 [Paul J. Reder]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@560373 13f79535-47bb-0310-9956-ffa450edef68
2007-07-27 20:34:41 +00:00
Eric Covener
f65de07e7e revert revision 555470
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@557772 13f79535-47bb-0310-9956-ffa450edef68
2007-07-19 21:05:16 +00:00
Eric Covener
ab845c1671 This data is passed in an unsafe way to the LDAP SDK if the compiler
chooses to use shorts for the enum values.
http://www.redbooks.ibm.com/redbooks/SG245992/nn4/SG245992_88.html

Submitted by: David Jones


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@555470 13f79535-47bb-0310-9956-ffa450edef68
2007-07-12 02:42:44 +00:00
Graham Leggett
2d79512131 mod_authn_dbd: Export any additional columns queried in the SQL select
into the environment with the name AUTHENTICATE_<COLUMN>. This brings
mod_authn_dbd behaviour in line with mod_authnz_ldap.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@466865 13f79535-47bb-0310-9956-ffa450edef68
2006-10-22 19:11:51 +00:00
Graham Leggett
488411491b mod_authnz_ldap: Add an AuthLDAPRemoteUserAttribute directive. If
set, REMOTE_USER will be set to this attribute, rather than the
username supplied by the user. Useful for example when you want users
to log in using an email address, but need to supply a userid instead
to the backend.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@463427 13f79535-47bb-0310-9956-ffa450edef68
2006-10-12 20:52:37 +00:00
Roy T. Fielding
de659cbed0 update license header text
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@420983 13f79535-47bb-0310-9956-ffa450edef68
2006-07-11 20:33:53 +00:00
Jeff Trawick
4b0c598d3c spellcheck
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@413730 13f79535-47bb-0310-9956-ffa450edef68
2006-06-12 19:35:09 +00:00
Bradley Nicholes
da77cf5678 Fix a problem with invalid auth error detection for LDAP client SDKs that don't support LDAP_SECURITY_ERROR macro. PR#39529
Submitted by: [Ray Price <dohrayme yahoo.com>], [Josh Fenlason <jfenlason ptc.com>]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@411306 13f79535-47bb-0310-9956-ffa450edef68
2006-06-02 22:01:53 +00:00
Colm MacCarthaigh
dd95d7c37c Update the copyright year in all .c, .h and .xml files
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395228 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 12:11:27 +00:00
Jeff Trawick
144c3fe342 Clean up some string manipulation.
Submitted by: Christophe JAILLET <christophe.jaillet wanadoo.fr>
Reviewed by: Jeff Trawick
PR: 38701


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@386437 13f79535-47bb-0310-9956-ffa450edef68
2006-03-16 19:39:38 +00:00
Bradley Nicholes
9fed4c73d7 Authz refactoring
Merge from branches/authz-dev

Basically here is a list of what has been done:
- Convert all of the authz modules from hook based to provider based
- Remove the ap_requires field from the core_dir_config structure
- Remove the function ap_requires() since its functionality is no
longer supported or necessary in the refactoring
- Remove the calls to ap_some_auth_required() in the core request
handling to allow the  hooks to be called in all cases.
- Add the new module mod_authz_core which will act as the authorization
provider vector and contain common authz directives such as 'Require',
'Reject' and  '<RequireAlias>'
- Add the new module mod_authn_core which will contain common
authentication directives such as 'AuthType', 'AuthName' and
'<AuthnProviderAlias>'
- Move the check for METHOD_MASK out of the authz providers and into
the authz_core provider vector
- Define the status codes that can be returned by the authz providers
as AUTHZ_DENIED,  AUTHZ_GRANTED and AUTHZ_GENERAL_ERROR   
- Remove the 'Satisfy' directive 
- Implement the '<RequireAll>', '<RequireOne>' block directives  to
handle the 'and' and 'or' logic for authorization.
- Remove the 'AuthzXXXAuthoritative' directives from all of the authz
providers
- Implement the 'Reject' directive that will deny authorization if the
argument is true
- Fold the 'Reject' directive into the '<RequireAll>', '<RequireOne>'
logic
- Reimplement the host based authorization functionality provided by 
'allow', 'deny' and 'order' as authz providers   
- Remove the 'allow', 'deny' and 'order' directives      
- Merge mod_authn_alias into mod_authn_core
- Add '<RequireAlias>' functionality which is similar to
'<AuthnProviderAlias>' but specific to authorization aliasing
- Remove all of the references to the 'authzxxxAuthoritative'
directives from the documentation
- Remove the 'Satisfy' directive from the documentation
- Remove 'Allow', 'Deny', 'Order' directives from the documentation
- Document '<RequireAll>', '<RequireOne>', 'Reject' directives
- Reimplement the APIs ap_auth_type(), ap_auth_name() as optional
functions and move the  actual implementation into mod_authn_core
- Reimplement the API ap_some_auth_required() as an optional function
and move the  actual implementation into mod_authz_core

Major Changes:
- Added the directives <RequireAll>, <RequireOne>, <RequireAlias>,
Reject
- Expanded the functionality of the directive 'Require' to handle all
authorization and access control
- Added the new authz providers 'env', 'ip', 'host', 'all' to handle
host-based access control
- Removed the directives 'Allow', 'Deny', 'Order', 'Satisfy',
'AuthzXXXAuthoritative'
- Removed the ap_require() API
- Moved the directives 'AuthType', 'AuthName' out of mod_core and into
mod_authn_core
- Moved the directive 'Require' out of mod_core and into
mod_authz_core
- Merged mod_authn_alias into mod_authn_core
- Renamed mod_authz_dbm authz providers from 'group' and 'file-group'
to 'dbm-group' and 'dbm-file-group'

Benefits:
- All authorization and access control is now handle through two
directives, 'Require' and 'Reject'
- Authorization has been expanded to allow for complex 'AND/OR' control
logic through the directives '<RequireAll>' and '<RequireOne>'
- Configuration is now much simpler and consistent across the board
- Other modules like mod_ssl and mod_proxy should be able to plug into
and take advantage of  the same provider based authorization mechanism
by implementing their own providers

Issues:
- Backwards compatibility between 2.2 and 2.3 configurations will be
broken in the area  of authorization and access control due to the fact
that the directives 'allow', 'deny',  'order' and 'satisfy' have been
removed.  When moving from 2.2 to 2.3 these directives  will have to be
changed to 'Require all granted', 'Require all denied' or some variation
 of the authz host-based providers.
- Existing third party authorization modules will have to adapt to the
new structure.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@368027 13f79535-47bb-0310-9956-ffa450edef68
2006-01-11 14:30:28 +00:00
William A. Rowe Jr
783d5b0dc1 This shift was treated in 32 bit scope, then masked to 64 bits,
which was probably quite uncool.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@358040 13f79535-47bb-0310-9956-ffa450edef68
2005-12-20 17:10:38 +00:00
Jim Jagielski
5061d9fa92 No functional Change: Removing trailing whitespace. This also
means that "blank" lines consisting of just spaces or
tabs are now really blank lines


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332306 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:11:44 +00:00
Jim Jagielski
5d2fae4818 No functional change: simple detabbing of indented code.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332305 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:05:51 +00:00
Jim Jagielski
27da0d6787 Start of getpid()/%d confusion fix...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@265047 13f79535-47bb-0310-9956-ffa450edef68
2005-08-31 14:18:33 +00:00
Jim Jagielski
c2c05e0aee Ensure that req->dn is valid for the util_ldap_cache_compare() call.
Esp make sure not null.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@230895 13f79535-47bb-0310-9956-ffa450edef68
2005-08-08 21:23:22 +00:00
Joe Orton
1dc07b9e89 * modules/ldap/util_ldap.c, modules/aaa/mod_authnz_ldap.c: Stop using
APLOG_NOERRNO throughout.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@225794 13f79535-47bb-0310-9956-ffa450edef68
2005-07-28 15:00:46 +00:00
Joe Orton
84b83bc77a * modules/aaa/mod_authnz_ldap.c (authz_ldap_check_user_access): Remove
unused variable.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@225587 13f79535-47bb-0310-9956-ffa450edef68
2005-07-27 19:36:07 +00:00
Bradley Nicholes
549cf1e255 Backing out the AuthLDAPAllowDNAuth patch from r168016. Because of LDAP filter issues this patch still can't guarantee unique results.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@168644 13f79535-47bb-0310-9956-ffa450edef68
2005-05-06 19:50:57 +00:00
Bradley Nicholes
3a3447622c Add the directive AuthLDAPAllowDNAuth to allow a user to authenticate against an LDAP directory using a full user DN. This directive allows a user to authenticate against a subcontext that may contain non-unique user IDs.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@168016 13f79535-47bb-0310-9956-ffa450edef68
2005-05-03 23:07:43 +00:00
Bradley Nicholes
38e8b5da89 Implement the exported function from mod_ldap(util_ldap) as optional functions so that we can eliminate the load ordering of mod_ldap and mod_authnz_ldap.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@159619 13f79535-47bb-0310-9956-ffa450edef68
2005-03-31 18:44:16 +00:00