FreeRADIUS and Redis Module

freeradiusredis

I am wanting to use FreeRADIUS with REDIS for authorisation and accounting. I am running FreeRADIUS 3.0.3.

I note the rlm_rediswho module, which appears to be used for caching recent accounting records for users.

I also note a rlm_redisn module that appears to be the fore bearer of the current rlm_redis module.

The redis module configuration file does not give any guidance on how to configure authorisation queries etc, but the rlm_redisn module does have syntax for this in it's example file (see http://free.oxymium.net/freeradius/rlm_redisn/redisn.example)

If I try and add the redis module to the authorisation section in sites-enabled/default, I get the following error:

Thu Sep  4 02:06:08 2014 : Error: /etc/freeradius/sites-enabled/default[332]: "redis" modules aren't allowed in 'authorize' sections -- they have no such method.
Thu Sep  4 02:06:08 2014 : Error: /etc/freeradius/sites-enabled/default[220]: Errors parsing authorize section. 

Best Answer

The REDIS module is not meant to be used directly, but referenced from other modules like rlm_rediswho.

There is one exception to that, in that it appears to register a string expansion matching the module name.

update control {
    Cleartext-Password := "%{redis:<redis query>}"
    Group := "%{redis:<redis query>}"
}

If you want authorization logic you'll have to write you own module, or retrieve individual attributes using something like the above string expansions.