Project

General

Profile

Actions

Bug #4678

open

Configuration test mode succeeds when reference.config file contains invalid content

Added by Jeff Lucovsky about 1 month ago. Updated 20 days ago.

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

Description

When testing configuration settings (-T), invalid content in reference.config doesn't result in the "test" failing.

If reference.config contains

this is not correct

then
$ src/suricata -c suricata.yaml -T --set reference-config-file=reference.config -S ~/rules/be.rule
[1607765] 2/9/2021 -- 13:51:11 - (suricata.c:1683) <Info> (ParseCommandLine) -- Running suricata under test mode
[1607765] 2/9/2021 -- 13:51:11 - (suricata.c:1091) <Notice> (LogVersion) -- This is Suricata version 7.0.0-dev (148277ec9 2021-07-20) running in SYSTEM mode
[1607765] 2/9/2021 -- 13:51:12 - (util-reference-config.c:247) <Error> (SCRConfAddReference) -- [ERRCODE: SC_ERR_REFERENCE_CONFIG(175)] - Invalid Reference Config in reference.config file
[1607765] 2/9/2021 -- 13:51:12 - (suricata.c:2850) <Notice> (SuricataMain) -- Configuration provided was successfully loaded. Exiting.
$ echo $?
0

Expected behavior:

 jlucovsky@ ~/src/jal/suricata (master) $ src/suricata -c suricata.yaml -T --set reference-config-file=reference.config -S ~/rules/be.rule
[1607765] 2/9/2021 -- 13:51:11 - (suricata.c:1683) <Info> (ParseCommandLine) -- Running suricata under test mode
[1607765] 2/9/2021 -- 13:51:11 - (suricata.c:1091) <Notice> (LogVersion) -- This is Suricata version 7.0.0-dev (148277ec9 2021-07-20) running in SYSTEM mode
[1607765] 2/9/2021 -- 13:51:12 - (util-reference-config.c:247) <Error> (SCRConfAddReference) -- [ERRCODE: SC_ERR_REFERENCE_CONFIG(175)] - Invalid Reference Config in reference.config file
[1607765] 2/9/2021 -- 08:39:15 - (util-threshold-config.c:257) <Warning> (tbd) -- [ERRCODE: SC_WARN_REFERENCE_CONFIG(338)] - Error loading reference configuration from /tmp/reference.config
[1607765] 2/9/2021 -- 08:39:15 - (suricata.c:2187) <Error> (LoadSignatures) -- [ERRCODE: SC_ERR_NO_RULES_LOADED(43)] - Loading signatures failed
 $ echo $?
1


Related issues

Copied from Bug #4659: Configuration test mode succeeds when reference.config file contains invalid contentNewOISF DevActions
Actions #1

Updated by Jeff Lucovsky about 1 month ago

  • Copied from Bug #4659: Configuration test mode succeeds when reference.config file contains invalid content added
Actions #2

Updated by Victor Julien 20 days ago

  • Target version changed from 5.0.8 to 5.0.9
Actions

Also available in: Atom PDF