Closed PackeTsar closed 7 years ago
Repaired. This was due to a bug in the munge engine which only recognized the accept
interrupt to break the looping through the rule base. If the discard interrupt carried through the other rules, then the input was discarded at the end, but if there was an accept
step configured in a rule (after the discard) which matched the input and processed it, then the discard interrupt was overwritten and not processed at the end.
Output after fix
[root radiuid]# python radiuid.py request munge-test host/laptop-111111 debug
########################## MUNGE TEST ##########################
################################################################
----- Sorted index of rules and steps: {'rules': ['rule10', 'rule100'], 'rule100': ['step10', 'step15', 'step20', 'step30', 'step40'], 'rule10': ['step10']} -----
----- Input String: host/laptop-111111 -----
----- rule10 -----
----- Rule beginning with input: host/laptop-111111 -----
----- Loaded Rule: -----
<root>
<match>
<regex>host/</regex>
<criterion>partial</criterion>
</match>
<step10>
<discard />
</step10>
</root>
----- Rule match statement regex returned: -----
['host/']
----- Matched pattern {'regex': 'host/', 'criterion': 'partial'} for rule10 in input host/laptop-111111 -----
----- Loaded step10: {'discard': None} -----
----- 'Discard' interrupt detected and set, breaking out of rule-set and discarding input -----
----- rule100 -----
----- Rule beginning with input: host/laptop-111111 -----
No string returned by Munge Engine. It was discarded
################################################################
################################################################
Reported by Marcus Cooke on the PacketPushers blog.
A
discard
step in a munge rule is not successfully stopping the processing of rules.Rulebase:
Debug Output