Project

General

Profile

Actions

Bug #9493

open
JI JI

datasets: update to only a dataset file is not detected as a change

Bug #9493: datasets: update to only a dataset file is not detected as a change

Added by Jason Ish about 17 hours ago. Updated about 17 hours ago.

Status:
In Review
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

If a rule source update changes only the contents of a dataset file, and no rule changes, Suricata-Update does not consider the ruleset to be modified. It logs "No changes detected, exiting." and exits before testing the rules and before running the reload command, so Suricata keeps running with the old dataset contents.

The new dataset file is written to the output directory, it is just never picked up until something else triggers a reload.

Cause

Change detection only tracks the checksum of the rule output files (suricata.rules, or the individual rule files with --no-merge), plus the --yaml-fragment and --threshold-out files. Files that rules depend on are not tracked.

This only affects the default merged output. With --no-merge every file from the source is also written to the output directory and tracked, so the change is detected.

Before 1.3.1 this was hidden for datasets, as the dataset file was written to a filename based on a hash of its contents. A dataset update changed the filename in the rule, which changed suricata.rules. The fix for #6763 changed the filename to a hash of the source filename, so the rule text is now identical when only the dataset contents change.

The same applies to the other files copied from a rule source because a rule references them: filemd5, filesha1, filesha256 and lua. These have always kept their original filename, so an update to only those files has never been detected.

Steps to reproduce

  1. Use a rule source containing a rule with dataset:isset,name,load file.lst and the dataset file.
  2. Run suricata-update.
  3. Change only the contents of the dataset file in the source.
  4. Run suricata-update again.

Expected: the change is detected, the rules are tested and Suricata is reloaded.

Actual: "No changes detected, exiting."

Workaround

Run suricata-update --force.

JI Updated by Jason Ish about 17 hours ago Actions #1

  • Status changed from New to In Review
Actions

Also available in: PDF Atom