Monitor configuration changes

Monitoring configuration changes establishes accountability for changes made to systems and applications. By maintaining a record of changes and who made them, organizations can identify responsible parties and ensure changes are properly authorized and documented.

Configure the FIM module to monitor configuration files and report changes. It uses the whodata and report_changes options to log the following about such changes:

  • The login user that made the changes.

  • The time of the changes.

  • The process that the user executed.

  • The changes made to the file.

Use case description

Endpoint

Description

CentOS Stream 9

The FIM module monitors a configuration file on this endpoint to detect file changes.

Configuration

Perform the following steps to configure the FIM module to monitor the /etc/app.conf file and report changes.

  1. Create a file app.conf in the /etc directory:

    # touch /etc/app.conf
    
  2. Edit the /var/ossec/etc/ossec.conf configuration file and add the configuration below:

    <syscheck>
      <directories check_all="yes" report_changes="yes" whodata="yes">/etc/app.conf</directories>
      <whodata>
        <provider>ebpf</provider>
      </whodata>
    </syscheck>
    
  3. Restart the Wazuh agent to apply the configuration changes:

    # systemctl restart wazuh-agent
    

Test the configuration

  1. Modify the /etc/app.conf file by using nano with root privileges:

    # nano /etc/app.conf
    
  2. Add updated image to V2 to the file and save.

Visualize the finding

Navigate to Endpoint securityFile Integrity MonitoringFindings on the Wazuh dashboard to view the finding generated when the FIM module detects modification of the configuration file.

Modification of the configuration file

Expand the finding to get more information about the event. In this example, the nano text editor modified the configuration file. The logged-in user on the endpoint was wazuh. The user modified the file using root privileges. The content added to the file is updated image to V2.

Get more information about the event