-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Radius Audit Log UI displays WLAN-AKM-Suite, WLAN-Group-Cipher, and WLAN-Pairwise-Cipher as float/double values and TLS cert dates are unprocessed #8358
Comments
Part of the mystery is revealed. The Redis cache has base64 encoded JSON data. In that data the WLAN attributes are integers. But once that infomation is serialized and put in the SQL database the 7 digit integers have become floats. The TLS cert dates are quoted strings, these are unchanged in the SQL database. There is most likely implicit type conversion happening during JSON serialization or URL encoding. Perhaps if the integers were quoted strings they wouldn't be converted to floats. Also, it the attributes were to be parsed, it'd be easiest to do so while the radius request and response are JSON. So this feature would most likely be implemented prior to inserting into redis. There are only a few possible values for the AKM suite and cipher suites A table based integer to string conversion method should be relatively straight forward to implement. Redis cache:
SQL
URL encoding removed:
|
The root of the issue regarding integers being parsed as floats is because of how Golang's json.Unmarshal handles numbers. All numbers are interpreted as float64s. The conversion happens in pfcron $PF/go/cron/flush_radius_audit_log_job.go I tinkered with a custom decoder that uses the UserNumber() method to interpret the values as json.Number. But decided against it. I had too many issues with that conversion and later function requirements. Since I was in the file, I added logic to parse the attributes mentioned above and convert them to friendly strings. I left the numbers as float64 until actually parsed and convert from float to int64 when needed.
It probably makes sense to leave these alone here and wait until they are retrieved from the database to be parsed. That way it's not something that happens at every RADIUS packet and only when the RADIUS log entry is displayed in the UI. At any rate, here is the Go code:
|
Describe the bug
The "Radius Audit Log" UI displays WLAN-AKM-Suite, WLAN-Group-Cipher, and WLAN-Pairwise-Cipher as float/double values. Also TLS cert valid from/to dates aren't processed. These issues exists in PF 14.0 and 13.2, I can't confirm if it exists in other versions.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The WLAN-AKM-Suite, WLAN-Group-Cipher, and WLAN-Pairwise-Cipher should not be displayed as float/double values. Either display raw hex or parse to display the decoded fields. The TLS-Cert-Expiration, TLS-Cert-Valid-Since, TLS-Client-Cert-Expiration, and TLS-Client-Cert-Valid-Since should display a date. There are other fields that are displayed as hex, such as EAP-Message, State, PacketFence-KeyBalanced and others. If those can easily be parsed, they should be. Hex is fine if the alternatives aren't simple or are resource prohibitive.
The text was updated successfully, but these errors were encountered: