@@ -39,7 +39,7 @@ def get_config(config=None):
39
39
if not conf .exists (base ):
40
40
return None
41
41
42
- suricata = conf .get_config_dict (base ,
42
+ suricata = conf .get_config_dict (base , key_mangling = ( '-' , '_' ),
43
43
get_first_key = True , with_recursive_defaults = True )
44
44
45
45
return suricata
@@ -81,19 +81,19 @@ def verify(suricata):
81
81
if 'interface' not in suricata :
82
82
raise ConfigError ('No interfaces configured!' )
83
83
84
- if 'address-group ' not in suricata :
84
+ if 'address_group ' not in suricata :
85
85
raise ConfigError ('No address-group configured!' )
86
86
87
- if 'port-group ' not in suricata :
87
+ if 'port_group ' not in suricata :
88
88
raise ConfigError ('No port-group configured!' )
89
89
90
90
try :
91
- topological_sort (suricata ['address-group ' ])
91
+ topological_sort (suricata ['address_group ' ])
92
92
except (ConfigError ,StopIteration ) as e :
93
93
raise ConfigError (f'Invalid address-group: { e } ' )
94
94
95
95
try :
96
- topological_sort (suricata ['port-group ' ])
96
+ topological_sort (suricata ['port_group ' ])
97
97
except (ConfigError ,StopIteration ) as e :
98
98
raise ConfigError (f'Invalid port-group: { e } ' )
99
99
@@ -126,12 +126,12 @@ def format_group(group):
126
126
return format_group
127
127
128
128
# Format the address group
129
- suricata ['address-group ' ] = map (to_config ('address' ),
130
- topological_sort (suricata ['address-group ' ]))
129
+ suricata ['address_group ' ] = map (to_config ('address' ),
130
+ topological_sort (suricata ['address_group ' ]))
131
131
132
132
# Format the port group
133
- suricata ['port-group ' ] = map (to_config ('port' ),
134
- topological_sort (suricata ['port-group ' ]))
133
+ suricata ['port_group ' ] = map (to_config ('port' ),
134
+ topological_sort (suricata ['port_group ' ]))
135
135
136
136
render (config_file , 'ids/suricata.j2' , {'suricata' : suricata })
137
137
render (rotate_file , 'ids/suricata_logrotate.j2' , suricata )
0 commit comments