This message was deleted.
# neuvector-security
a
This message was deleted.
c
What version are you running? https://www.suse.com/support/kb/doc/?id=000021230 suggest v5.2.0+ accepts regex.
a
Hello Garrick, I've already read that post which is very interesting. I am using 5.3.0 but my regex doesn't work, probaly because the format is not expected in Neuvector (it works on other regex platforms). Which regex format does Neuvector support?
c
I just tested pasting your regex into a v5.3.0 deployment. Here's a screenshot of me trying to edit the rule.
Is the error from Manager UI or Controller? You may want to check the either manager or controller logs and see if you can find more details on the error.
a
Did you apply the configuration?. Thje problem arrises when you update the rule.
1
The only entry in the logs is this one in the controller pod: 2024-03-31T171552.809|ERRO|CTL|rest.handlerPatchAdmissionRule: Admission rule validation failed - error=Invalid criterion value for regex operator: ^(?:[1-5]?[1-9]{1,4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$
c
Sorry, I made a mistake in my previous test. I believe this is a bug. Definitely should open an issue on github.
Escaping the parenthesis allows the regex to be accepted, but I don't know if the evaluation will work the same. Are you able to verify?
Copy code
^\(?:[1-5]?[1-9]{1,4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]\)
a
Thanks Garrick, I will test it as soon as possible and let you know.
c
I finally confirmed the character not playing nice is the comma. Alternatively, the following regex should get accepted and function similarly to your original.
Copy code
^(?:[1-5]?[1-9]{1}|[1-5]?[1-9]{2}|[1-5]?[1-9]{3}|[1-5]?[1-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$
a
Many Thanks Garrick, I tested your solution and works perfect!!!.
👍 1