PackeTsar / radiuid

An application to extract User-to-IP mappings from RADIUS accounting data and send them to Palo Alto firewalls for use by the User-ID function.
http://packetpushers.net/radiuid/
GNU General Public License v3.0
34 stars 10 forks source link

Service stops after about 1 hour's operation #31

Closed AdamNib closed 7 years ago

AdamNib commented 7 years ago

Thanks for a superb utility. Just what I need in a School where we are trying to authenticate BYOD from Aerohive APs to the PAlo.

Really sorry to pester you with a problem...I am on versions (PAlo is 8.0.3). Apologies if I have configured something wrong...

-------------------------------------- OPERATING SYSTEM -------------------------------------- Current OS is Ubuntu 16.04 xenial

------------------------------------------ RADIUID ------------------------------------------- Currently running RadiUID 2.4.1

----------------------------------------- FREERADIUS ----------------------------------------- freeradius: FreeRADIUS Version 2.2.8, for host x86_64-pc-linux-gnu, built on Apr 5 2016 at 13:40:43

Managed to get it up and running and it works great for about 1 hour and then the service stops. I do a show status and get the following:

oot@RADIUID:/home/radiuid# radiuid show status 2017-08-02 17:26:20: ##### COMMAND 'show status' ISSUED FROM CLI BY USER 'root' #####

########################## CHECKING RADIUID ########################## ###################################################################### â radiuid.service - RadiUID User-ID Service Loaded: loaded (/etc/systemd/system/radiuid.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Wed 2017-08-02 15:46:34 BST; 1h 39min ago Process: 4633 ExecStart=/bin/bash -c cd /bin; python radiuid run (code=exited, status=1/FAILURE) Main PID: 4633 (code=exited, status=1/FAILURE)

Aug 02 15:46:34 RADIUID bash[4633]: File "radiuid", line 3115, in interpreter Aug 02 15:46:34 RADIUID bash[4633]: self.radiuid.looper() Aug 02 15:46:34 RADIUID bash[4633]: File "radiuid", line 2007, in looper Aug 02 15:46:34 RADIUID bash[4633]: statustypes = self.dpr.clean_statuses(statustypes) Aug 02 15:46:34 RADIUID bash[4633]: File "radiuid", line 1464, in clean_statuses Aug 02 15:46:34 RADIUID bash[4633]: newdict[key] = cleaned Aug 02 15:46:34 RADIUID bash[4633]: UnboundLocalError: local variable 'cleaned' referenced before assignment Aug 02 15:46:34 RADIUID systemd[1]: radiuid.service: Main process exited, code=exited, status=1/FAILURE Aug 02 15:46:34 RADIUID systemd[1]: radiuid.service: Unit entered failed state. Aug 02 15:46:34 RADIUID systemd[1]: radiuid.service: Failed with result 'exit-code'. ###################################################################### ###################################################################### ########################## CHECKING FREERADIUS ########################## ######################################################################### â freeradius.service - LSB: Radius Daemon Loaded: loaded (/etc/init.d/freeradius; bad; vendor preset: enabled) Active: active (running) since Wed 2017-08-02 15:13:36 BST; 2h 12min ago Docs: man:systemd-sysv-generator(8) Process: 4614 ExecStop=/etc/init.d/freeradius stop (code=exited, status=0/SUCCESS) Process: 4644 ExecStart=/etc/init.d/freeradius start (code=exited, status=0/SUCCESS) Tasks: 6 Memory: 4.0M CPU: 191ms CGroup: /system.slice/freeradius.service ââ4680 /usr/sbin/freeradius

Aug 02 15:13:36 RADIUID systemd[1]: Starting LSB: Radius Daemon... Aug 02 15:13:36 RADIUID freeradius[4644]: * Starting FreeRADIUS daemon freeradius Aug 02 15:13:36 RADIUID freeradius[4644]: ...done. Aug 02 15:13:36 RADIUID systemd[1]: Started LSB: Radius Daemon. ######################################################################### #########################################################################

Config is this radiuid set radiuslogpath /var/log/freeradius/radacct/ ! radiuid set logfile /etc/radiuid/radiuid.log ! radiuid set maxloglines 0 ! radiuid set userdomain uppingham ! radiuid set timeout 60 ! radiuid set looptime 10 ! radiuid set tlsversion 1.2 ! radiuid set radiusstopaction clear ! ! radiuid clear client all ! radiuid set client **REMOVED as sensitive* ! radiuid set client **REMOVED as sensitive* ! ! radiuid clear target all ! radiuid set target *removed as sensitve version 6 ! radiuid set target version:vsys1 !

PackeTsar commented 7 years ago

Just seeing this. I will look into it and see what could be happening @AdamNib

PackeTsar commented 7 years ago

Looks like this is happening because RADIUS is reporting some odd status type in the logs. I wrote a fix and will release it in v2.4.3 which will prevent the crash and will report the status in the logs.

PackeTsar commented 7 years ago

Version 2.4.3 is released. Please update to that version. When these rare logs are seen now, you show see the below in the RadiUID log:

2017-08-03 17:24:16:   IP Address List Cleaned Up!

2017-08-03 17:24:16:   Unrecognized RADIUS Accounting status type! Dumping User-ID!

2017-08-03 17:24:16:   Status: '        Acct-Status-Type = Other
'

2017-08-03 17:24:16:   Status List Cleaned Up!

2017-08-03 17:24:16:   Error detected in FreeRADIUS log. Looks like there were log entries missing the username, IP address, or delineatorterm

2017-08-03 17:24:16:   Skipping entry. Dump of dictionaries shown below.

2017-08-03 17:24:16:   {0: '10.162.10.223', 1: '10.162.10.224', 2: '10.162.10.225', 3: '10.162.10.226'}

2017-08-03 17:24:16:   {0: 'domain\\\\john', 1: 'domain\\\\steve', 2: 'host/icts-e1111-01.habsboys.internal', 3: 'domain\\laura'}

2017-08-03 17:24:16:   Dictionary values merged into one dictionary
PackeTsar commented 7 years ago

Closing issue

AdamNib commented 7 years ago

Many thanks that is very kind and thanks for such a rapid response. I am away from work for a long weekend but will install the new version on Tuesday and feedback.

AdamNib commented 7 years ago

Works perfectly now ! Many thanks, you have made a stressed IT Manager a little less stressed now ! My Palo based School BYOD Network solution is now viable.

For completeness and interest the logs show -
2017-08-08 12:39:23: Unrecognized RADIUS Accounting status type! Dumping User -ID! 2017-08-08 12:39:23: Status: ' Acct-Status-Type = Accounting-On ' 2017-08-08 12:39:23: Unrecognized RADIUS Accounting status type! Dumping User -ID! 2017-08-08 12:39:23: Status: ' Acct-Status-Type = Accounting-On '