Introduction
For each directive, this chapter gives several types of information:
For each directive, the Context field gives one of three possible
contexts, each denoting a level in the configuration hierarchy:
Although many directives can appear in more than one context, only
one is given for each. The given context is the narrowest one in which the directive can
appear; it can also appear in any larger context.
Each directive listing also specifies the module controlled by that
directive. If a directive applies to the core Apache server and not to any module,
"core" is listed instead of a module name. If you add or remove modules, be sure
to comment out the directives that pertain to it, or use the <IfModule> container to
configure modules conditionally.
Features of the Apache RADIUS Authentication Module:
Cookie Format:
The cookie has to have the following syntax.
md5digest,expiretime,groupid's
32bytes:
md5digest(secret, md5digest(secret,
"username,
user password,
special server secret*,
client ip number,
hostname,
expires (seconds since 1-1-1970),
group_id (string discribed below)
8bytes expires time (seconds since 1-1-1970)
string beginging and ending with a '$'
character make up outof
multiple 8bytes seperated by a '$'. The
multiple 8bytes strings
seperated by a '$' represend (hex) group ID
integers
So the cookie will look like:
38f088b5215c674d59514ae1b9e378f83575c7cd$0000012c$0000012d$0000012e$
etc
................................--------$========$========$========$
. digest
- expiretime (hex)
$ seperator
= groupids (hex)
(*) 16 byte random character sequence generated
every time the
server starts.
Getting the Source And Compiling
Compliling the stuff is straghtforward. Fetch the latest apache sources from www.apache.org. Untar the complete
distribution and follow the compilation instruction.
Apply this patch to the Apache sourcecode apache.patch if you
are going to use this apache as a proxy server. This will fix the fact that the 'proxing' webserver
does not send the cookie back to the client
Install mod_auth_radius.c in a directory. and type:
$ apxs -g -n auth_radius
Creating [DIR] auth_radius
Creating [FILE] auth_radius/Makefile
Creating [FILE] auth_radius/mod_auth_radius.c
check that a directory is created which is named auth_radius
replace auth_radius/mod_auth_radius.c with mod_auth_radius.c
Apply this patch to the Apache sourcecode apache.patch .
Ensure that apache in compiled with the -lresolv libraries from bind!.
General Configuration
The following drectives are avalable:
Radius module setup directives
AddRadiusAuth
send authentication requests. The default timeout is 5 seconds.
You can specify more
than one such a directive. This way you can create redundanty.
AddRadiusCookieValid
- Syntax: AddRadiusCookieValid minutes
- Context: host
- Module: mod_auth_radius
- AllowOverride: None
- Default: 60 minutes
This sets the expire time for the Cookie that is send to the client. If set to 0 the
Cookie never expires. (not tested :).
Pleas note:
The per-dir configuration Cookie Valid time does NOT over-ride the server configuration.
mod_auth_radius choose the most restrictive of the two to use. This way, a site
administrator can say all cookies are valid forever, and then make some directories a bit
more secure, by forcing re-authentication every hour. See AuthRadiusCookieValid.
AddRadiusGroupidAttirbuteNumber
RadiusDictionary
AuthRadiusNetMaskFile
- Syntax: AuthRadiusNetMaskFile filename
- Context: host
- Module: mod_auth_radius
- AllowOverride: None
- Default: None
This file contains networks where specific realms are allowed to connect from. This is used to
discriminate users, depending where they connect from.
the syntax of this file is:
tag: network/nnn (mask cidr notation)
# Tag: Network
external: 0.0.0.0/0
internal: 193.79.248.0/25
See Authentication Setup: realm
RadiusLog
- Syntax: RadiusLog filename
- Context: host
- Module: mod_auth_radius
- AllowOverride: None
- Default: /var/spool/syslog/httpd/radius
In this file all attributes are loged that are send allong with a succesfull
authentication request.
An example entry:
[Thu Jul 9 13:28:37 1998] Radius Successfull
authentication for user: brendan@nl.gnarst.net
Service-Type = 8 (Authenticate-Only)
Full-Name = Brendan Bank
Email-Address = Brendan.Bank@nl.gnarst.net
Phone = ..-31-(0)20-4952779
Supervisor = Jaap Akkerhuis
Supervisor-Email = jaap@nl.gnarst.net
Supervisor-Phone = ..-31-(0)20-4952780
Modification-date = 898639200 (Jun 24 1998)
Creation-date = 898639200 (Jun 24 1998)
Job-Title = Developer
Department = Development
Group-ID = 1 (Executive)
Group-ID = 3 (Marketing)
Group-ID = 4 (Operations)
RadiusDefaultRealm
AuthRadiusCaseConvert
RadiusTrustServer
- Syntax: RadiusTrustServer hostname
- Context: host
- Module: mod_auth_radius
- AllowOverride: None
If this directive is set a http connection that comes from this trused host. The
stronghold web server trusted that the authentication was done on this host. This make it
possible to run the radius module on proxyserver and on backend web servers. This way
users can bennifit from the Group-ID's that were send to the proxy server. And the special
require directives such as "require realm", "require groupid" etc.
Radius module Authentication Setup
AuthRadiusAuthoritative
AuthRadiusCheckexists
RadiusReauthenticate
AuthRadiusGroupFile
Require group directive.
a line in the groupfile must have the following syntax:
groupname: user [user [user [user]]]
AuthRadiusCookieValid
AddRadiusCookieValid will be used.
Pleas note:
The per-dir configuration Cookie Valid time does NOT over-ride the server configuration.
mod_auth_radius choose the most restrictive of the two to use. This way, a site
administrator can say all cookies are valid forever, and then make some directories a bit
more secure, by forcing re-authentication every hour.
Authconfig Setup
This authorization setup is differend from the standard apache configurations in
respect to the the fact that you can explisitly deny users from vieuwing your content,
revieuw the folloing syntax.
<Directory gnarst/workfloor/gossip>
...
AuthRadiusGroupFile /etc/gnarst.groupfile
require realm @uk.gnarst.net
require not group executive
require user andrewc@uk.gnarst.net
require realm @lusers.gnarst.net internal
</Directory>
In this example the directory gnarst/workfloor/gossip can be accessed by anyone that has
a realm '@uk.gnarst.net'. But if the user belongs to the group executive access will be
denied. This group file in this case is a file that lives on the webserver itself
/usr/local/www/gnarst.groupfile. And may hold the following lines.
executive: pat@uk.gnarst.net luc@uk.gnarst.net
users with an @lusers.gnarst.net realm can only connect from networks which match the
tag internal. In the AuthRadiusNetMaskFile you can configure the tag's
and the networks where clients can connect from. (see AuthRadiusNetMaskFile)
If multiple directive are specified you should read like this.
( realm @uk.gnarst.net AND NOT group executive )
OR
( user andrewc@uk.gnarst.net
AND not group executive )
So if the user matches andrewc@uk.gnarst.net and belongs to the group executive in the
group file /usr/local/www/gnarst.groupfile andrewc@uk.gnarst.net will be denied access.
valid-user
radgroup
RadiusDictionary.
Since there is no agreement yet on what these group must be this feature is inplemented in
the code but not operational.
group
AuthRadiusGroupFile
realm
- Syntax: require [not] realm realmname [network tag] [network tag] etc.
- Context: object
- Module: mod_auth_radius
- AllowOverride: AuthConfig
- Example: require realm @nl.gnarst.net internal
A user matches this directive if his realm part of his username matches the string.
if a [network tag] is given the ipaddress from the client ip address must match the network
address represented by the tag (see AuthRadiusNetMaskFile) Mulitple tag's
are allowed.
norealm
|