logging and customs attributes
Hello, i'm using freeradius with basic authentication (mac adress). Then my config file is like that : 0025646642D6 Cleartext-Password := "0025646642D6". i would like to be able to see in the log the computer name, then i added in dictionnary file this line : "ATTRIBUTE Nom-Machine 3003 string". My config file become like that : 0025646642D6 Cleartext-Password := "0025646642D6", Nom-Machine := "portable". I would like to see in the log file, when authentication is ok, in addition to mac address, the name "portable". Is it possible to do that ? Thank for your help -- Pascal
On Oct 5, 2018, at 3:29 PM, Pascal Legrand <pascal.legrand@univ-orleans.fr> wrote:
Hello,
i'm using freeradius with basic authentication (mac adress). Then my config file is like that : 0025646642D6 Cleartext-Password := "0025646642D6".
i would like to be able to see in the log the computer name, then i added in dictionnary file this line : "ATTRIBUTE Nom-Machine 3003 string".
My config file become like that : 0025646642D6 Cleartext-Password := "0025646642D6", Nom-Machine := "portable".
I would like to see in the log file, when authentication is ok, in addition to mac address, the name "portable".
Is it possible to do that ?
Sure. see man unlang and raddb/mods-available/linelog -Arran
Sure. see man unlang and raddb/mods-available/linelog I'm a really beginner on freeradius and not sure to understand how your solution works. Anyway thanks for your answer
On Oct 5, 2018, at 8:09 AM, Pascal Legrand <pascal.legrand@univ-orleans.fr> wrote:
I'm a really beginner on freeradius and not sure to understand how your solution works.
If you want your custom attribute logged in radius.log along with the other messages, see radiusd.conf. Look for the "log" subsection, and read the configuration there. All of this is documented. Alan DeKok.
I already done evrything in the log section # Log the full User-Name attribute, as it was found in the request. stripped_names = yes # Log authentication requests to the log file. auth = yes # logs password if it's rejected auth_badpass = yes # logs password if it's correct auth_goodpass = yes But i cant see my custom attribute Le 05/10/2018 à 14:12, Alan DeKok a écrit :
On Oct 5, 2018, at 8:09 AM, Pascal Legrand <pascal.legrand@univ-orleans.fr> wrote:
I'm a really beginner on freeradius and not sure to understand how your solution works.
If you want your custom attribute logged in radius.log along with the other messages, see radiusd.conf. Look for the "log" subsection, and read the configuration there.
All of this is documented.
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On Oct 5, 2018, at 9:15 AM, Pascal Legrand <pascal.legrand@univ-orleans.fr> wrote:
I already done evrything in the log section
No.
# Log the full User-Name attribute, as it was found in the request. stripped_names = yes # Log authentication requests to the log file. auth = yes # logs password if it's rejected auth_badpass = yes # logs password if it's correct auth_goodpass = yes
But i cant see my custom attribute
The custom attribute isn't magically logged. If every attribute was logged all of the time, then the logs would be full of garbage. You have to *tell* the server to log the custom attribute. How do you do this? Via the "msg_goodpass" and "msg_badpass" configuration items. The ones you didn't include above. The default configuration has LOTS of comments that document what everything is, what it does, and how to use it. Please read it. Alan DeKok.
Then if i add this line in dictionary : ATTRIBUTE Nom-Machine 3003 string And if my config file is like that : 0C41E978313C Cleartext-Password := "0C41E978313C", Nom-Machine := "SWITCH-CM1" 0C41E97831A3 Cleartext-Password := "0C41E97831A3", Nom-Machine := "SWITCH-CM2" 007E95CC6070 Cleartext-Password := "007E95CC6070", Nom-Machine := "AP-CM1" 007E95CC5EF0 Cleartext-Password := "007E95CC5EF0", Nom-Machine := "AP-CM2" .......... I see that "msg_badpass = string" can be a variable. Then, does "Nom-Machine" is the variable name ? Thanks
The custom attribute isn't magically logged. If every attribute was logged all of the time, then the logs would be full of garbage.
You have to *tell* the server to log the custom attribute. How do you do this? Via the "msg_goodpass" and "msg_badpass" configuration items. The ones you didn't include above.
The default configuration has LOTS of comments that document what everything is, what it does, and how to use it. Please read it.
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Hi,
I see that "msg_badpass = string" can be a variable. Then, does "Nom-Machine" is the variable name ?
Try as msg_goodpass = "%{&control:Nom-Machine}" msg_badpass = "%{&control:Nom-Machine}" On Friday, October 5, 2018 04:30:06 PM +03, Pascal Legrand <pascal.legrand@univ-orleans.fr> wrote: Then if i add this line in dictionary : ATTRIBUTE Nom-Machine 3003 string And if my config file is like that : 0C41E978313C Cleartext-Password := "0C41E978313C", Nom-Machine := "SWITCH-CM1" 0C41E97831A3 Cleartext-Password := "0C41E97831A3", Nom-Machine := "SWITCH-CM2" 007E95CC6070 Cleartext-Password := "007E95CC6070", Nom-Machine := "AP-CM1" 007E95CC5EF0 Cleartext-Password := "007E95CC5EF0", Nom-Machine := "AP-CM2" .......... I see that "msg_badpass = string" can be a variable. Then, does "Nom-Machine" is the variable name ? Thanks
The custom attribute isn't magically logged. If every attribute was logged all of the time, then the logs would be full of garbage.
You have to *tell* the server to log the custom attribute. How do you do this? Via the "msg_goodpass" and "msg_badpass" configuration items. The ones you didn't include above.
The default configuration has LOTS of comments that document what everything is, what it does, and how to use it. Please read it.
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
This line works great : msg_goodpass = " - Machine : %{&control:Nom-Machine}" Thanks a lot for your help Le 05/10/2018 à 15:36, Ali Arslan via Freeradius-Users a écrit :
Hi,
I see that "msg_badpass = string" can be a variable. Then, does "Nom-Machine" is the variable name ?
Try as
msg_goodpass = "%{&control:Nom-Machine}" msg_badpass = "%{&control:Nom-Machine}"
On Friday, October 5, 2018 04:30:06 PM +03, Pascal Legrand <pascal.legrand@univ-orleans.fr> wrote:
Then if i add this line in dictionary : ATTRIBUTE Nom-Machine 3003 string
And if my config file is like that : 0C41E978313C Cleartext-Password := "0C41E978313C", Nom-Machine := "SWITCH-CM1" 0C41E97831A3 Cleartext-Password := "0C41E97831A3", Nom-Machine := "SWITCH-CM2" 007E95CC6070 Cleartext-Password := "007E95CC6070", Nom-Machine := "AP-CM1" 007E95CC5EF0 Cleartext-Password := "007E95CC5EF0", Nom-Machine := "AP-CM2" ..........
I see that "msg_badpass = string" can be a variable. Then, does "Nom-Machine" is the variable name ?
Thanks
The custom attribute isn't magically logged. If every attribute was logged all of the time, then the logs would be full of garbage.
You have to *tell* the server to log the custom attribute. How do you do this? Via the "msg_goodpass" and "msg_badpass" configuration items. The ones you didn't include above.
The default configuration has LOTS of comments that document what everything is, what it does, and how to use it. Please read it.
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-- Pascal Legrand - /Service Informatique/ *IUT de Chartres* - 1, place Roger Joly - 28000 Chartres Téléphone : 02 37 91 83 36 Mail : service-info.iut.chartres@univ-orleans.fr GLPI : aide.infoiut28@univ-orleans.fr PGP : 0x29d77e71 Facebook : Rejoignez-nous sur Facebook <http://www.facebook.com/IUTdeCHARTRES> QR Code Site web : <http://www.univ-orleans.fr/iut-chartres>
On Oct 5, 2018, at 9:29 AM, Pascal Legrand <pascal.legrand@univ-orleans.fr> wrote:
Then if i add this line in dictionary : ATTRIBUTE Nom-Machine 3003 string
And if my config file is like that : 0C41E978313C Cleartext-Password := "0C41E978313C", Nom-Machine := "SWITCH-CM1" 0C41E97831A3 Cleartext-Password := "0C41E97831A3", Nom-Machine := "SWITCH-CM2" 007E95CC6070 Cleartext-Password := "007E95CC6070", Nom-Machine := "AP-CM1" 007E95CC5EF0 Cleartext-Password := "007E95CC5EF0", Nom-Machine := "AP-CM2" ..........
I see that "msg_badpass = string" can be a variable. Then, does "Nom-Machine" is the variable name ?
Concepts like this are answered in the documentation. See "man unlang", which Arran told you to read a while back. Or, hundreds of examples in the configuration files. If you don't read the documentation, you will have a *very* hard time configuring the software. Alan DeKok.
participants (4)
-
Alan DeKok -
Ali Arslan -
Arran Cudbard-Bell -
Pascal Legrand