Skip to content
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

Add/improve authentication logs #8961

Open
2tefan opened this issue Feb 14, 2025 · 3 comments
Open

Add/improve authentication logs #8961

2tefan opened this issue Feb 14, 2025 · 3 comments

Comments

@2tefan
Copy link

2tefan commented Feb 14, 2025

What would you like to add or change?

Hi!

We would like to see authentication logs for ntopng.
In the newest packaged version of ntopng 6.3.250214 you can already (kinda) see authentication logs when users try to log in via LDAP when the LDAP debug option is set:

Failed login:

14/Feb/2025 08:30:37 [LdapAuthenticator.cpp:464] Attemping auth connection to LDAP server ldaps://10.0.0.1:636 using password ****
14/Feb/2025 08:30:37 [LdapAuthenticator.cpp:493] LDAP lookup in OU=Testing,DC=test with filter samaccountname=my_username
14/Feb/2025 08:30:37 [LdapAuthenticator.cpp:519] Attribute: cn Value: my_username
14/Feb/2025 08:30:37 [LdapAuthenticator.cpp:519] Attribute: sn Value: also_mostly_my_username
14/Feb/2025 08:30:37 [LdapAuthenticator.cpp:519] Attribute: distinguishedName Value: CN=my_username,OU=Testing,DC=test
14/Feb/2025 08:30:37 [LdapAuthenticator.cpp:519] Attribute: memberOf Value: CN=ntopng_admins,OU=groups,DC=test
14/Feb/2025 08:30:37 [LdapAuthenticator.cpp:573] ERROR: Could not bind to distinguishedName/dn/sn attribute

And when the login is successful, the error message is basically omitted:

14/Feb/2025 08:31:15 [LdapAuthenticator.cpp:464] Attemping auth connection to LDAP server ldaps://10.0.0.1:636 using password ****
14/Feb/2025 08:31:15 [LdapAuthenticator.cpp:493] LDAP lookup in OU=Testing,DC=test with filter samaccountname=my_username
14/Feb/2025 08:31:15 [LdapAuthenticator.cpp:519] Attribute: cn Value: my_username
14/Feb/2025 08:31:15 [LdapAuthenticator.cpp:519] Attribute: sn Value: also_mostly_my_username
14/Feb/2025 08:31:15 [LdapAuthenticator.cpp:519] Attribute: distinguishedName Value: CN=my_username,OU=Testing,DC=test
14/Feb/2025 08:31:15 [LdapAuthenticator.cpp:519] Attribute: memberOf Value: CN=ntopng_admins,OU=groups,DC=test

But this currently just seems to work for LDAP. When trying to log in with a local user, you'll get no logs at all. And when the password for the local user is wrong, it tries to query the LDAP server and fails:

14/Feb/2025 08:54:06 [LdapAuthenticator.cpp:464] Attemping auth connection to LDAP server ldaps://10.0.0.1:636 using password ****
14/Feb/2025 08:54:06 [LdapAuthenticator.cpp:493] LDAP lookup in OU=Testing,DC=test with filter samaccountname=not_my_username
14/Feb/2025 08:54:06 [LdapAuthenticator.cpp:577] no matching memberOf attribute found for any privileged/unprivileged group

What do I want?

It would be nice to have logs that are more clear and work for every type of authentication. So for example, when trying to log in via LDAP or a local user:

14/Feb/2025 08:54:55 [LdapAuthenticator.cpp:xxx] Successful login from <my_user> via LDAP from IP <w.x.y.z>
14/Feb/2025 08:55:10 [LdapAuthenticator.cpp:xxx] Successful login from <my_user> via local authentication from <w.x.y.z>

And if the login fails to have a statement like

14/Feb/2025 08:58:55 [LdapAuthenticator.cpp:xxx] Failed login from <my_user> (tried local authentication & LDAP) from IP <w.x.y.z>

Why do you and others need this?

We would need this for security reasons :)

@cardigliano
Copy link
Member

Please note user login activities are also logged using alerts. You can find them under Alerts -> Explorer -> User. Thus another option is to extend those alerts with missing information, if any, and still keep the system logs for debugging only. What do you think?

@cardigliano
Copy link
Member

Example:

Image

@2tefan
Copy link
Author

2tefan commented Feb 17, 2025

Yeah, that would also be fine :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants