Project

General

Profile

Actions

Bug #4659

closed

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

Added by Jeff Lucovsky about 1 year ago. Updated 8 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:
Needs backport to 5.0, Needs backport to 6.0

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 3 (0 open3 closed)

Copied from Bug #4369: Configuration test mode succeeds when threshold.config file contains invalid contentClosedJeff LucovskyActions
Copied to Bug #4677: Configuration test mode succeeds when reference.config file contains invalid contentClosedShivani BhardwajActions
Copied to Bug #4678: Configuration test mode succeeds when reference.config file contains invalid contentClosedJeff LucovskyActions
Actions #1

Updated by Jeff Lucovsky about 1 year ago

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

Updated by Jeff Lucovsky about 1 year ago

  • Copied to Bug #4677: Configuration test mode succeeds when reference.config file contains invalid content added
Actions #3

Updated by Jeff Lucovsky about 1 year ago

  • Copied to Bug #4678: Configuration test mode succeeds when reference.config file contains invalid content added
Actions #4

Updated by Jeff Lucovsky about 1 year ago

  • Assignee changed from Jeff Lucovsky to OISF Dev
Actions #5

Updated by Jeff Lucovsky 9 months ago

  • Status changed from New to In Review
  • Assignee changed from OISF Dev to Jeff Lucovsky
Actions #6

Updated by Jeff Lucovsky 8 months ago

  • Status changed from In Review to Closed
Actions

Also available in: Atom PDF