Re: JRS - Proxying v2

2007-04-08 Thread Alan DeKok
Arran Cudbard-Bell wrote:
 Hmm looks good, failing over as expected, pinging all dead servers to 
 check if they're alive cool.

  g  Much better than before.

  There are a few other things to add, but they're minor.  I think I'll
also re-name the ping checks to live checks, because pings will
confuse people.

  After that, 2.0 looks to be pretty good.

 Ah, ok... so it might be better as an extension to the expressions
 module possibly As that must already have hooks, to write the values
 to the configuration variables during expansion.

  Maybe.

 On a completely unrelated subject, whats the standard checking behaviour 
 when you have multiple instances of the same attribute,
 will each of the instances be checked in turn ?

  Yes.

  Alan DeKok.
--
  http://deployingradius.com   - The web site of the book
  http://deployingradius.com/blog/ - The blog
- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


unsubscribe

2007-04-08 Thread tseveen

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: JRS - Proxying v2

2007-04-08 Thread Peter Nixon
On Sun 08 Apr 2007, Arran Cudbard-Bell wrote:
 Alan DeKok wrote:
Yes, they're in CVS.  Also see raddb/templates.conf for some minimal
  documentation.

 Hmm didn't come through in the install :(

  And i'm guessing templates are global too :) ? So they can also be used
  in clients and anywhere else you have to repeat something over and over
  again ??
 
Almost anywhere.  Sub-sections aren't supported yet (e.g. multiple SQL
  modules).

 Aww, would be cool if they were. I do actually use multiple sql
 configurations, but they're just selecting data from different databases
 so much of the configuration is the same. But still very nice :)

Hi Arran

Although it will be nice when templates work inside sql sections too, the 
config you mention can already be done with little config duplication do to 
the way I split up sql.conf in cvs head. Just duplicate the data in sql.conf 
but not the included query file for the database type you are using...

Cheers
-- 

Peter Nixon
http://www.peternixon.net/
PGP Key: http://www.peternixon.net/public.asc
- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Alternate proxying methods.

2007-04-08 Thread Arran Cudbard-Bell
Due to the complicated filtering required for JRS, the standard way of 
doing proxying with the realms
module is not sufficient.

Most institutions will just use rlm_realm to strip the user name and 
realm out, and proxy the user to the default realm,
Then explicitly define a realm for themselves to catch local users.

This is fine, as locally terminated realms don't get sent through the 
pre-proxy and post-proxy sections, and so the stringent attribute
filters required for JRS don't affect locally proxied data.

The issue comes when you have a set of RADIUS servers in front of your 
home_servers.
Because you have to use DEFAULT in the attribute filter to match users 
going off to JRS (as you have no idea what their realm will be),
the data flowing through the front end servers will also have the 
DEFAULT filters applied, which is not good !

The obvious solution is to actually direct users at a realm, instead of 
relying on DEFAULT entries... But as soon as a user hits the rlm_realm
they will be proxied...

The solution I found is to ignore the standard front end for rlm_realm, 
and instead use the Proxy-To-Realm and Replicate-To-Realm in the users file.

1. User hits hints file.

# Writes stripped user name to use in authorization
DEFAULT User-Name =~ ^([[:alnum:[EMAIL PROTECTED])@([[:alnum:].]*)$
Stripped-User-Name = %{1},
Pre-Proxy-Realm = %{2}

You split the user name into two sections using a generic regular 
expression, user name goes into Stripped-User-Name, second part goes 
into a custom Attribute Pre-Proxy-Realm.

2. User hits users file.


# Reject annoying users who use the wrong realm, so we don't have to 
bother JRS with them.
# Shorthand sussex
DEFAULT Pre-Proxy-Realm =~ .*susx.ac.uk.*, Auth-Type := Reject
Reply-Message = Please use [EMAIL PROTECTED] 
as your user ID,
Fall-Through = no
# Freeman centre users
DEFAULT Pre-Proxy-Realm =~ .*freeman-centre.ac.uk.*, Auth-Type := Reject
Reply-Message = Please use [EMAIL PROTECTED] 
as your user ID,
Fall-Through = no
# Subdomains of sussex
DEFAULT Pre-Proxy-Realm =~ (.+)sussex.ac.uk.*, Auth-type := Reject
Reply-Message = Please use [EMAIL PROTECTED] 
as your user ID,
Fall-Through = no

# Proxy user to JRS.
DEFAULT Pre-Proxy-Realm != sussex.ac.uk, Pre-Proxy-Realm !=, 
Proxy-To-Realm := jrs
Fall-Through = no
# Or to backend servers.
DEFAULT Proxy-To-Realm := sussex
Fall-Through = no


You can then black hole users using incorrect domains.

And proxy users who don't belong to your local domain, directly to the 
jrs realm.

You can then define specific attribute filters for JRS users :)

3. Acct_users


# Replicate none sussex users accounting packets to jrs realm
# (allows us to use attr_filter properly!)
DEFAULT Pre-Proxy-Realm != sussex.ac.uk, Pre-Proxy-Realm !=, 
Replicate-To-Realm := jrs
Fall-Through = yes
DEFAULT Proxy-To-Realm := sussex

Just thought it was quite a neat way or doing it, as opposed to all the 
weirdness with prefixes and suffixes and using rlm_realm in the 
authorize and accounting section.
Also rely's on *standardish* behaviour.

Also heard talk to deprecating Proxy-To-Realm and Replicate-To-Realm... 
which is a really bad idea as using Proxy-To-Realm and 
Replicate-To-Realm is far more powerful , and can be configured from sql :)

---
Arran


- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: Can i do that?

2007-04-08 Thread Marat Rysbekov
Hello, Kostas.

I believe the best way to do that is to use stored procedures, if your
DB server supports them. Then you can replace the accounting query
strings in sql.conf to something like: CALL
accounting_start_procedure(attributes_you_want_to_pass), and compose
a stored procedure that will process the passed attributes and write
to whatever tables you need.

I can give you a MySQL example, if you're interested.
- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html