Discussion:
Remove double quotes from variable
Raghu nathan
2018-10-26 10:11:21 UTC
Permalink
We are calling %{Module-Failure-Message} in linelog and trying to create
JSON logs.

But we are getting sometime error with double quotes, which is creating
issue on JSON spec.

For example,
In linelog messages we have below entry

Access-Reject = "{\"Datetime\":\"%t\",\
\"Packet-Type\":\"%{reply:Packet-Type}\",\
\"User-Name\":\"%{User-Name}\",\
\"Module-Failure-Message\":\"%{Module-Failure-Message}\"\
}"
We are getting the logs as

{"Datetime":"Fri Oct 26 09:07:17
2018","Packet-Type":"Access-Reject","User-Name":"CONSUMER4.TATA","Module-Failure-Message":"pap:
Cleartext password "WRONG-PASSWORD" does not match "known good" password"}


In the Module-Failure-Message output we are receiving the message with
double quotes which is not as per JSON standard.
Please let me know how I can solve the issue without doing any coding.

Regards,
Raghu.
-
List info/subscribe/unsubscribe? See http:/
Matthew Newton
2018-10-26 10:22:20 UTC
Permalink
Post by Raghu nathan
Access-Reject = "{\"Datetime\":\"%t\",\
\"Packet-Type\":\"%{reply:Packet-Type}\",\
\"User-Name\":\"%{User-Name}\",\
\"Module-Failure-Message\":\"%{Module-Failure-Message}\"\
}"
...
Post by Raghu nathan
In the Module-Failure-Message output we are receiving the message with
double quotes which is not as per JSON standard.
Please let me know how I can solve the issue without doing any
coding.
Use the jsonquote xlat on any untrusted data that comes in the request
(e.g. User-Name as well, as that can be controlled by the connecting
device).

..., \"Module-Failure-Message\":\"%{jsonquote:%{Module-Failure-Message}}\", ...
--
Matthew

-
List info/subscribe/unsubscrib
Raghu nathan
2018-10-29 04:52:16 UTC
Permalink
Thanks Matthew,

We are using centos 7 and freeRADIUS 3.0.13

Now we are missing "/usr/lib64/freeradius/rlm_rest.so" , I have
installed using stable release.
Please let us know how we can install this library?

Error:
/etc/raddb/mods-enabled/rest[1]: Failed to link to module 'rlm_rest':
/usr/lib64/freeradius/rlm_rest.so: cannot open shared object file: No such
file or directory
Post by Matthew Newton
...,
\"Module-Failure-Message\":\"%{jsonquote:%{Module-Failure-Message}}\", ...
Post by Matthew Newton
--
Matthew
We are calling %{Module-Failure-Message} in linelog and trying to create
JSON logs.
But we are getting sometime error with double quotes, which is creating
issue on JSON spec.
For example,
In linelog messages we have below entry
Access-Reject = "{\"Datetime\":\"%t\",\
\"Packet-Type\":\"%{reply:Packet-Type}\",\
\"User-Name\":\"%{User-Name}\",\
\"Module-Failure-Message\":\"%{Module-Failure-Message}\"\
}"
We are getting the logs as
{"Datetime":"Fri Oct 26 09:07:17
Cleartext password "WRONG-PASSWORD" does not match "known good" password"}
In the Module-Failure-Message output we are receiving the message with
double quotes which is not as per JSON standard.
Please let me know how I can solve the issue without doing any coding.
Regards,
Raghu.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/lis
Herwin Weststrate
2018-10-29 08:07:00 UTC
Permalink
Post by Raghu nathan
Thanks Matthew,
We are using centos 7 and freeRADIUS 3.0.13
Now we are missing "/usr/lib64/freeradius/rlm_rest.so" , I have
installed using stable release.
Please let us know how we can install this library?
There probably is a freeradius-rest-package you need to install.
--
Herwin Weststrate
-
List info/subscribe/unsubscribe? See http://w
Loading...