From e0a8a416de9e2ba4500f9342af47364205a8ff15 Mon Sep 17 00:00:00 2001 From: Alexander Wilke Date: Sat, 7 Jan 2012 13:04:35 +0100 Subject: freeradius2 updates pkg v.1.4.5 --- config/freeradius2/freeradius.inc | 458 ++++++++++++++++++++++-- config/freeradius2/freeradius.xml | 4 + config/freeradius2/freeradius_view_config.php | 4 + config/freeradius2/freeradiusauthorizedmacs.xml | 201 +++++++++++ config/freeradius2/freeradiuscerts.xml | 4 + config/freeradius2/freeradiusclients.xml | 4 + config/freeradius2/freeradiuseapconf.xml | 4 + config/freeradius2/freeradiusinterfaces.xml | 4 + config/freeradius2/freeradiusmodulesldap.xml | 4 + config/freeradius2/freeradiussettings.xml | 17 +- config/freeradius2/freeradiussqlconf.xml | 4 + config/freeradius2/freeradiussync.xml | 6 +- 12 files changed, 686 insertions(+), 28 deletions(-) mode change 100755 => 100644 config/freeradius2/freeradius.inc create mode 100644 config/freeradius2/freeradiusauthorizedmacs.xml (limited to 'config/freeradius2') diff --git a/config/freeradius2/freeradius.inc b/config/freeradius2/freeradius.inc old mode 100755 new mode 100644 index 6c64a615..98ac837f --- a/config/freeradius2/freeradius.inc +++ b/config/freeradius2/freeradius.inc @@ -70,10 +70,22 @@ function freeradius_install_command() { } } + closedir($handle); + exec("chown -R root:wheel /usr/local/etc/raddb"); exec("chown -R root:wheel /usr/local/lib/freeradius-2.1.12"); - closedir($handle); + // creating a backup file of the original policy.conf no matter if user checked this or not + if (!file_exists("/usr/local/etc/raddb/policy.conf.backup")) { + log_error("FreeRADIUS: Creating backup of the original file to {$filepolicyconfbackup}"); + copy("/usr/local/etc/raddb/policy.conf", "/usr/local/etc/raddb/policy.conf.backup"); + } + + // creating a backup file of the original /modules/files no matter if user checked this or not + if (!file_exists("/usr/local/etc/raddb/files.backup")) { + log_error("FreeRADIUS: Creating backup of the original file to {$filemodulesfilesbackup}"); + copy("/usr/local/etc/raddb/modules/files", "/usr/local/etc/raddb/files.backup"); + } $rcfile = array(); $rcfile['file'] = 'radiusd.sh'; @@ -82,7 +94,7 @@ function freeradius_install_command() { conf_mount_rw(); write_rcfile($rcfile); conf_mount_ro(); - start_service("radiusd"); + restart_service("radiusd"); } function freeradius_settings_resync() { @@ -123,7 +135,6 @@ function freeradius_settings_resync() { $sqlconf = $config['installedpackages']['freeradiussqlconf']['config'][0]; $varsqlconfincludeenable = ($sqlconf['varsqlconfincludeenable']?$sqlconf['varsqlconfincludeenable']:'Disable'); - // Dis-/Enable SQL in "instatiate" section in "freeradius_settings_resync" and radiusd.conf if ($sqlconf['varsqlconfincludeenable'] == 'Enable') { $varsqlconfinclude = '$INCLUDE sql.conf'; @@ -301,6 +312,7 @@ EOD; conf_mount_ro(); // "freeradius_sqlconf_resync" is pointing to this function because we need to run "freeradius_serverdefault_resync" and after that restart freeradius. + freeradius_plainmacauth_resync(); freeradius_serverdefault_resync(); freeradius_modulescounter_resync(); freeradius_modulesmschap_resync(); @@ -435,6 +447,39 @@ EOD; restart_service('freeradius'); } + +function freeradius_authorizedmacs_resync() { +global $config; + +$conf = ''; + +$arrmacs = $config['installedpackages']['freeradiusauthorizedmacs']['config']; + +if (is_array($arrmacs) && !empty($arrmacs)) { + foreach ($arrmacs as $macs) { + + // Variables for macs file defined parameters + $varmacaddress = $macs['varmacaddress']; + $varmacaddress = "\n$varmacaddress"; + + $conf .= << \ No newline at end of file diff --git a/config/freeradius2/freeradius.xml b/config/freeradius2/freeradius.xml index f2cd3dcf..313495f2 100644 --- a/config/freeradius2/freeradius.xml +++ b/config/freeradius2/freeradius.xml @@ -67,6 +67,10 @@ /pkg.php?xml=freeradius.xml + + MACs + /pkg.php?xml=freeradiusauthorizedmacs.xml + NAS / Clients /pkg.php?xml=freeradiusclients.xml diff --git a/config/freeradius2/freeradius_view_config.php b/config/freeradius2/freeradius_view_config.php index 218a9abb..6bda5f3e 100644 --- a/config/freeradius2/freeradius_view_config.php +++ b/config/freeradius2/freeradius_view_config.php @@ -37,6 +37,7 @@ function get_file($file){ $files['sql']="/usr/local/etc/raddb/sql.conf"; $files['clients']="/usr/local/etc/raddb/clients.conf"; $files['users']="/usr/local/etc/raddb/users"; + $files['macs']="/usr/local/etc/raddb/authorized_macs"; $files['virtual-server-default']="/usr/local/etc/raddb/sites-enabled/default"; $files['ca']="/usr/local/etc/raddb/certs/ca.cnf"; $files['server']="/usr/local/etc/raddb/certs/server.cnf"; @@ -81,6 +82,7 @@ else{       +         @@ -150,6 +153,7 @@ else{ $('btn_sql').value="sql.conf"; $('btn_clients').value="clients.conf"; $('btn_users').value="users"; + $('btn_macs').value="macs"; $('btn_virtual').value="virtual-server-default"; $('btn_ca').value="ca.cnf"; $('btn_server').value="server.cnf"; diff --git a/config/freeradius2/freeradiusauthorizedmacs.xml b/config/freeradius2/freeradiusauthorizedmacs.xml new file mode 100644 index 00000000..021f8772 --- /dev/null +++ b/config/freeradius2/freeradiusauthorizedmacs.xml @@ -0,0 +1,201 @@ + + + + + + + All rights reserved. + + Based on m0n0wall (http://m0n0.ch/wall) + Copyright (C) 2003-2006 Manuel Kasper . + All rights reserved. + */ +/* ========================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ +/* ========================================================================== */ +]]> + + Describe your package requirements here + Currently there are no FAQ items provided. + freeradiusauthorizedmacs + 2.1.12 + FreeRADIUS: MACs + /usr/local/pkg/freeradius.inc + + FreeRADIUS + Modify FreeRADIUS macs, clients, and settings. +
Services
+ /pkg.php?xml=freeradiusauthorizedmacs.xml +
+ + radiusd + radiusd.sh + radiusd + + + + + + Users + /pkg.php?xml=freeradius.xml + + + MACs + /pkg.php?xml=freeradiusauthorizedmacs.xml + + + + NAS / Clients + /pkg.php?xml=freeradiusclients.xml + + + Interfaces + /pkg.php?xml=freeradiusinterfaces.xml + + + Settings + /pkg_edit.php?xml=freeradiussettings.xml&id=0 + + + EAP + /pkg_edit.php?xml=freeradiuseapconf.xml&id=0 + + + SQL + /pkg_edit.php?xml=freeradiussqlconf.xml&id=0 + + + Certificates + /pkg_edit.php?xml=freeradiuscerts.xml&id=0 + + + LDAP + /pkg_edit.php?xml=freeradiusmodulesldap.xml&id=0 + + + View config + /freeradius_view_config.php + + + XMLRPC Sync + /pkg_edit.php?xml=freeradiussync.xml&id=0 + + + + /usr/local/pkg/ + 0755 + http://www.pfsense.org/packages/config/freeradius2/freeradius.inc + + + /usr/local/www/ + 0755 + http://www.pfsense.org/packages/config/freeradius2/freeradius_view_config.php + + + /usr/local/pkg/ + 0755 + http://www.pfsense.org/packages/config/freeradius2/freeradiusclients.xml + + + /usr/local/pkg/ + 0755 + http://www.pfsense.org/packages/config/freeradius2/freeradiussettings.xml + + + /usr/local/pkg/ + 0755 + http://www.pfsense.org/packages/config/freeradius2/freeradiuseapconf.xml + + + /usr/local/pkg/ + 0755 + http://www.pfsense.org/packages/config/freeradius2/freeradiussqlconf.xml + + + /usr/local/pkg/ + 0755 + http://www.pfsense.org/packages/config/freeradius2/freeradiusinterfaces.xml + + + /usr/local/pkg/ + 0755 + http://www.pfsense.org/packages/config/freeradius2/freeradiuscerts.xml + + + /usr/local/pkg/ + 0755 + http://www.pfsense.org/packages/config/freeradius2/freeradiussync.xml + + + /usr/local/pkg/ + 0755 + http://www.pfsense.org/packages/config/freeradius2/freeradiusmodulesldap.xml + + + /usr/local/pkg/ + 0755 + http://www.pfsense.org/packages/config/freeradius2/freeradiusauthorizedmacs.xml + + + + MAC Address + varmacaddress + + + Description + description + + + + + GENERAL CONFIGURATION + listtopic + + + MAC Address + varmacaddress + + input + + + + Description + description + + input + + + + freeradius_authorizedmacs_resync(); + + + freeradius_authorizedmacs_resync(); + +
\ No newline at end of file diff --git a/config/freeradius2/freeradiuscerts.xml b/config/freeradius2/freeradiuscerts.xml index 1393dea8..e3f6365d 100644 --- a/config/freeradius2/freeradiuscerts.xml +++ b/config/freeradius2/freeradiuscerts.xml @@ -54,6 +54,10 @@ Users /pkg.php?xml=freeradius.xml
+ + MACs + /pkg.php?xml=freeradiusauthorizedmacs.xml + NAS / Clients /pkg.php?xml=freeradiusclients.xml diff --git a/config/freeradius2/freeradiusclients.xml b/config/freeradius2/freeradiusclients.xml index 57ad1b7d..be066937 100644 --- a/config/freeradius2/freeradiusclients.xml +++ b/config/freeradius2/freeradiusclients.xml @@ -53,6 +53,10 @@ Users /pkg.php?xml=freeradius.xml + + MACs + /pkg.php?xml=freeradiusauthorizedmacs.xml + NAS / Clients /pkg.php?xml=freeradiusclients.xml diff --git a/config/freeradius2/freeradiuseapconf.xml b/config/freeradius2/freeradiuseapconf.xml index b319f198..309066f0 100644 --- a/config/freeradius2/freeradiuseapconf.xml +++ b/config/freeradius2/freeradiuseapconf.xml @@ -54,6 +54,10 @@ Users /pkg.php?xml=freeradius.xml + + MACs + /pkg.php?xml=freeradiusauthorizedmacs.xml + NAS / Clients /pkg.php?xml=freeradiusclients.xml diff --git a/config/freeradius2/freeradiusinterfaces.xml b/config/freeradius2/freeradiusinterfaces.xml index f15e998f..fd51f800 100644 --- a/config/freeradius2/freeradiusinterfaces.xml +++ b/config/freeradius2/freeradiusinterfaces.xml @@ -53,6 +53,10 @@ Users /pkg.php?xml=freeradius.xml + + MACs + /pkg.php?xml=freeradiusauthorizedmacs.xml + NAS / Clients /pkg.php?xml=freeradiusclients.xml diff --git a/config/freeradius2/freeradiusmodulesldap.xml b/config/freeradius2/freeradiusmodulesldap.xml index 317054d2..06a990e7 100644 --- a/config/freeradius2/freeradiusmodulesldap.xml +++ b/config/freeradius2/freeradiusmodulesldap.xml @@ -54,6 +54,10 @@ Users /pkg.php?xml=freeradius.xml + + MACs + /pkg.php?xml=freeradiusauthorizedmacs.xml + NAS / Clients /pkg.php?xml=freeradiusclients.xml diff --git a/config/freeradius2/freeradiussettings.xml b/config/freeradius2/freeradiussettings.xml index 8115945a..611db03f 100644 --- a/config/freeradius2/freeradiussettings.xml +++ b/config/freeradius2/freeradiussettings.xml @@ -54,6 +54,10 @@ Users /pkg.php?xml=freeradius.xml + + MACs + /pkg.php?xml=freeradiusauthorizedmacs.xml + NAS / Clients /pkg.php?xml=freeradiusclients.xml @@ -93,6 +97,17 @@ + + PLAIN MAC AUTHORIZATION + listtopic + + + Enable Plain MAC Auth + varsettingsenablemacauth + + Some NAS are not able to convert the MAC in a 802.1X format then you could enable this. If you doo not need this leave this disabled. It could have unknown side-effects. (Default: unchecked)]]> + checkbox + GENERAL CONFIGURATION listtopic @@ -284,7 +299,7 @@ input 0 - + freeradius_settings_resync(); diff --git a/config/freeradius2/freeradiussqlconf.xml b/config/freeradius2/freeradiussqlconf.xml index 538ad45d..a5bc4d2e 100644 --- a/config/freeradius2/freeradiussqlconf.xml +++ b/config/freeradius2/freeradiussqlconf.xml @@ -54,6 +54,10 @@ Users /pkg.php?xml=freeradius.xml + + MACs + /pkg.php?xml=freeradiusauthorizedmacs.xml + NAS / Clients /pkg.php?xml=freeradiusclients.xml diff --git a/config/freeradius2/freeradiussync.xml b/config/freeradius2/freeradiussync.xml index 66a2701f..27f4fe80 100644 --- a/config/freeradius2/freeradiussync.xml +++ b/config/freeradius2/freeradiussync.xml @@ -67,6 +67,10 @@ POSSIBILITY OF SUCH DAMAGE. Users /pkg.php?xml=freeradius.xml + + MACs + /pkg.php?xml=freeradiusauthorizedmacs.xml + NAS / Clients /pkg.php?xml=freeradiusclients.xml @@ -114,7 +118,7 @@ POSSIBILITY OF SUCH DAMAGE. Automatically sync freeRADIUS configuration changes? varsyncenablexmlrpc - Important: Only Users and NAS / Clients will be synced.]]> + Important: Only Users, MACs and NAS / Clients will be synced.]]> checkbox -- cgit v1.2.3