-
Notifications
You must be signed in to change notification settings - Fork 728
Review severity levels of CRS to make sure all rules have severity levels #610
Comments
Hopefully we could lint the rules automatically. I currently use the following primitive script to detect missing tags and severities:
cont.py just glues lines with
|
Yeah i'm pretty much all but ready to have a serious linter as part of the travis CI integration that i plan to roll out soon :) |
@lifeforms that python script is a nice and dirty way to fix the newline problems with the apache < 2.4 bug https://bz.apache.org/bugzilla/show_bug.cgi?id=55910 |
This is aimed for 3.1.0 and I - sorry for repeating myself - think it needs to be part of a bigger initiative doing the following:
Otherwise, I welcome this completely. |
:-D i'm glad this ticket has lots of traction - I think it would behoove us to use a proper parser for this and not just make it dirty, that way we can say 100% this will work in ModSecurity (at least 3, i can't speak for apache :-P ) |
Yeah using the modsec parser would be very cool to do rule validation. At the other hand, the parser might not retain source information such as spacing and lines conventions, so we'll probably want both stupid and smart scripts :) |
Absolutely @lifeforms -- I literally cannot wait to have TavisCI running on our code and making sure we don't have little issues, like missing regression tests, bad formatting, etc.... we're gonna #devops so hard with 3.1 :) |
How about the python module to pull this off? |
Thats what i was thinking @dune73 - it'd be great if it was in python since the rest of the project pretty much is. I really wanted to straight up convert the parser from c++ to python but the python regex engine is different :( so a little work there |
Way to go then. |
Haven't started yet but for CRS 3.1 this is a must in my opinion, i'm sure once we push 3.0.0 we'll have a nice long break and a conversation about what should make the cut :) |
Yes, I suggest we rent a boat in the Carribean somewhere and talk it out - for a week or two. ;) On a more serious note, I think we have to force ourselves to clean out the pile of old issues before we touch anything 3.1. |
good idea about cleaning out the log .... if the flight wouldn't be so expensive for you two i'd do the boat trip, I could use one :-P Maybe i'll go to the next AppSec EU instead :) |
I'm seeing myself at the AppSecEU as well next year. It's been a while. |
I see it's Belfast. Hmm. Never been to Ireland. But it's like half way to the Caribbean. Makes me think... |
@dune73 What is remaining to do here? Maybe we can have a pass of airween 's magical tool here also, identifying what changes remain? |
What do you think about this? (List of severity levels at every rule.) If you have any idea, just let me know. |
What I see is that there are lots of rules without severity 😮 |
I think a lot of the rules missing severity are the paranoia level checks. |
Yes, the rule IDs below xxx100 probably don't need the severity. I made some comment above what else needs to be done. I stand by that comment, but I think it should not keep this issue back. Let's get this over and do the rest afterwards. |
Right, it's important info. Any other criteria? I mean, |
I'd skip the rule files below 910 and also 949, 959 and 980. |
Perhaps rather than skipping ranges we could exclude some of these files altogether? |
That's what I tried to express, yes. |
Sorry, I can't read. Reading it again, your comment was clear. |
Table updated. The used filter was:
Tha last condition filters out the rules with id 900NNNN... |
I would be happy to help out with this issue. I was talking with @airween about it and I can take an initial go at updating the rules in the range listed. Are there any other suggested heuristics for setting the severity? |
After dissussing with @fgsch I updated the table. This table also filtered the rules with this condition:
The concept what I checked: the code follows the used PL (which controlled with a special rule what checks the If the used PL not equals with variable name (column F and H) then it marked in column J. If the given severity level not equals with variable value (column G and I) then it marked in column K. I think I still can't decide when needs a rule any Hope it will helpfully :). |
Meeting outcome: @airween with make sure this issue is solved together with Anna. |
Updated the table, please review this issue the next monthly chat. |
Decision during the CRS project chat on March 2, 2020: @lifeforms will sort this out. |
Addressed in #1732. Thanks for the help, everyone! |
No description provided.
The text was updated successfully, but these errors were encountered: