LDAP authentication logging in DEBUG by default #4156

Closed
opened 2025-12-29 18:33:30 +01:00 by adam · 5 comments
Owner

Originally created by @niamtokik on GitHub (Sep 30, 2020).

Originally assigned to: @DanSheps on GitHub.

  • Python version: 3.7.3
  • NetBox version: 2.9.3
  • Debian: 10.6

During deployment, the LDAP authentication logging feature present in netbox/netbox/authentication.pyis set by default to DEBUG. This can be problematic in different context, in particular in production environment. In particularly dynamic environment with many users, it can make the different log files growing exponentially.

Steps to Reproduce

  1. Run netbox with LDAP backend support
  2. Logs files will increase in size when someone will connect
  3. Too many information are printed by default with DEBUG mode

Expected Behavior

By default, the application should not be in DEBUG mode, but more in INFO or WARNING, except if a "switch" could be easily modified.

I have made a quick modification there: https://github.com/niamtokik/netbox/tree/authentication-debug-logging-removal

Observed Behavior

  • Logging files growing exponentially.
  • Too many information logged
Originally created by @niamtokik on GitHub (Sep 30, 2020). Originally assigned to: @DanSheps on GitHub. * Python version: 3.7.3 * NetBox version: 2.9.3 * Debian: 10.6 During deployment, the LDAP authentication logging feature present in `netbox/netbox/authentication.py`is set by default to `DEBUG`. This can be problematic in different context, in particular in production environment. In particularly dynamic environment with many users, it can make the different log files growing exponentially. ### Steps to Reproduce 1. Run netbox with LDAP backend support 2. Logs files will increase in size when someone will connect 3. Too many information are printed by default with `DEBUG` mode ### Expected Behavior By default, the application should not be in `DEBUG` mode, but more in `INFO` or `WARNING`, except if a "switch" could be easily modified. I have made a quick modification there: https://github.com/niamtokik/netbox/tree/authentication-debug-logging-removal ### Observed Behavior * Logging files growing exponentially. * Too many information logged
adam added the type: bugstatus: accepted labels 2025-12-29 18:33:30 +01:00
adam closed this issue 2025-12-29 18:33:30 +01:00
Author
Owner

@glennmatthews commented on GitHub (Sep 30, 2020):

See also #5192, #5194

@glennmatthews commented on GitHub (Sep 30, 2020): See also #5192, #5194
Author
Owner

@n0creativity commented on GitHub (Oct 1, 2020):

This issue managed to create 10GB+ syslog files on our server in a matter of an hour or 2... with just 1 person working on documenting parts of our network.
Doing a quick analysis of one of these files showed large entries of LDAP search results, sometimes being written to the log 20k+ times per second. The lines all indicated gunicorn was the source and most of them started with search_s(

@glennmatthews - Thanks for finding this... I knew something had its logging set in debug mode, but I couldn't figure out where the setting was.

@n0creativity commented on GitHub (Oct 1, 2020): This issue managed to create 10GB+ syslog files on our server in a matter of an hour or 2... with just 1 person working on documenting parts of our network. Doing a quick analysis of one of these files showed large entries of LDAP search results, sometimes being written to the log 20k+ times per **_second_**. The lines all indicated `gunicorn` was the source and most of them started with `search_s(` @glennmatthews - Thanks for finding this... I knew _something_ had its logging set in debug mode, but I couldn't figure out where the setting was.
Author
Owner

@niamtokik commented on GitHub (Oct 1, 2020):

The lines all indicated gunicorn was the source and most of them started with search_s(

it's probably due to the DEBUG level used in LDAP authentication part. This snippet use another handler to log message, and should be configured to send them to stdin or stderr by default.

@niamtokik commented on GitHub (Oct 1, 2020): > The lines all indicated gunicorn was the source and most of them started with search_s( it's probably due to the `DEBUG` level used in LDAP authentication part. This snippet use another handler to log message, and should be configured to send them to `stdin` or `stderr` by default.
Author
Owner

@stuntguy3000 commented on GitHub (Oct 1, 2020):

@niamtokik Were you going to commit your changes as a PR? If not, I'll snap it up...

@stuntguy3000 commented on GitHub (Oct 1, 2020): @niamtokik Were you going to commit your changes as a PR? If not, I'll snap it up...
Author
Owner

@niamtokik commented on GitHub (Oct 1, 2020):

Were you going to commit your changes as a PR? If not, I'll snap it up...

Yes, I will create the PR right now.

@niamtokik commented on GitHub (Oct 1, 2020): > Were you going to commit your changes as a PR? If not, I'll snap it up... Yes, I will create the PR right now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4156