-
-
Notifications
You must be signed in to change notification settings - Fork 402
Refactored and tested version of rule-ctl script #2193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi @theseion, I had some time and started to review this modified script. Here are some notes after the reviewing of tag handling.
After a quick view, I found these issues. |
Great, thanks @airween! I'll get those fixed soon. |
The simple stuff is fixed. I want to write tests for the other things so that will take a little more time. |
@airween Updated with fixes and tests for all your finds. Thanks again! |
Thanks, I'll take a look soon. |
Hi @theseion, I had some time and could review the whole script. First, let me congratulate you and @theMiddleBlue - I think this will be a very useful tool. It's also good that someone has finally used the parser :). These are the items what I have found:
- t:none,t:lowercase,\
- msg:'PHP Injection Attack: PHP Script File Upload Found',\
+ t:none,msg:'PHP Injection Attack: PHP Script File Upload Found',\
python3 util/rule_ctl/rule_ctl.py --config rules/REQUEST-933... --uncond-replace-action 'msg:this is a new message for rule 125'`
...
rule_ctl.py: error: unrecognized arguments: --uncond-replace-action msg:this is a new message for rule 125 no matter how do I quote the action Actually, these are what I have found. Let me know, if I can help you any other thing. |
Thanks for refactoring @theseion and the feedback @airween. Do you have time to look into the comments @theseion? How does it look from your side @theMiddleBlue? |
Thanks for the reminder. Yes, I should have time to address the comments. |
Thank you. |
Thanks a lot @airween!
Thanks :)
Fixed
Will fix.
It's already in the documentation (lines 53 and 74 of the README).
I will add documentation and a test.
I'll add a test for that.
I'll add a test for that.
I removed it as |
Variable replacement can now also change the quote type
Fixed shell escaping of examples
Actions now have a unique ID by which they can be identified, regardless of their position
@airween I've addressed all your findings. From my point of view this is ready to merge. More bugs will probably crop up when people start using the script in more exotic contexts but with the test suite they should be pretty easy to fix. |
Cool stuff. |
Thank you @theMiddleBlue, @theseion and @airween. Gorgeous script! |
This updates #2068.
The contents of this PR are not yet perfect but should be a good starting point.