Project

General

Profile

Actions

Bug #15744

closed

Suricata LOGS MGMT feature shows ``enabled`` by default on a green-field install when it should instead default to ``disabled``

Added by Bill Meeks 3 months ago. Updated about 2 months ago.

Status:
Resolved
Priority:
Low
Assignee:
Category:
Suricata
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
24.11
Affected Version:
2.7.x
Affected Plus Version:
24.03
Affected Architecture:
All

Description

There is a PHP code logic error when testing the value of the "enable_log_mgmt" config parameter in the Suricata package. By default, upon initial install, the LOGS MGMT feature is disabled. It is left up to the admin to decide whether or not to enable the feature. While there is a good argument to make for default enabling the feature, I've felt it better to leave the feature default disabled in the event a user does not want log data automatically cleaned up without their explict intervention.

The code logic error is on line 36 of the file /usr/local/www/suricata/suricata_logs_mgmt.php :

// Grab saved settings from configuration
$pconfig['enable_log_mgmt'] = config_get_path('installedpackages/suricata/config/0/enable_log_mgmt') == 'off' ? 'off' : 'on';

That line should instead read as follows:

// Grab saved settings from configuration
$pconfig['enable_log_mgmt'] = config_get_path('installedpackages/suricata/config/0/enable_log_mgmt') == 'on' ? 'on' : 'off';

On a green-field install the parameter "enable_log_mgmt" will be uninitialized. The test for "off" in the current code will thus evaluate to FALSE resulting in the variable being initialized to "on" when the LOGS MGMT tab page is rendered. Instead, an explict test for "on" should be done, and if false, the variable should be initialized to "off".

Actions #1

Updated by Marcos M 3 months ago

  • Subject changed from Suricata LOGS MGMT feature shows "enabled" by default on a green-field install when it should instead default to "disabled" on a green-field installation to Suricata LOGS MGMT feature shows ``enabled`` by default on a green-field install when it should instead default to ``disabled``
  • Status changed from New to In Progress
  • Assignee set to Marcos M
Actions #2

Updated by Marcos M 3 months ago

  • Status changed from In Progress to Feedback
Actions #3

Updated by Marcos M 3 months ago

  • Target version set to 2.8.0
  • Plus Target Version set to 24.08
Actions #4

Updated by Jim Pingle 2 months ago

  • Plus Target Version changed from 24.08 to 24.11
Actions #5

Updated by Georgiy Tyutyunnik about 2 months ago

  • Status changed from Feedback to Resolved

latest suricata version (7.0.7_4) has this fix implemented
tested on
24.11-ALPHA (amd64)
built on Fri Oct 18 8:00:00 CEST 2024
FreeBSD 15.0-CURRENT

Actions

Also available in: Atom PDF