Project

General

Profile

Actions

Bug #4677

closed

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

Added by Jeff Lucovsky about 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
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 1 (0 open1 closed)

Copied from Suricata - Bug #4659: Configuration test mode succeeds when reference.config file contains invalid contentClosedJeff LucovskyActions
Actions

Also available in: Atom PDF