question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New TAG for each ruleset file

See original GitHub issue

Motivation

sometimes I need to exclude a whole CRS ruleset file (included on the main modsecurity.conf) just when occurs a certain condition. For example when 2 different websites share the same modsecurity.conf but need two completely different configurations.

Proposed solution

Add a tag for each rule on the same ruleset file that could be used to remove them “on the fly”. For example: all rules in REQUEST-912-DOS-PROTECTION.conf have the tag file-request-dos-protection all rules in REQUEST-930-APPLICATION-ATTACK-LFI.conf have the tag file-request-application-attack-lfi etc…

Alternatives

Or just set a tag based on rules prefix number, something like: all rules in REQUEST-912-DOS-PROTECTION.conf have the tag request-912 all rules in REQUEST-930-APPLICATION-ATTACK-LFI.conf have the tag request-930 etc…

if you all agree, I can send a PR

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
dune73commented, Apr 27, 2021

Awesome plan. Let’s talk about a good placement at the next project chat (-> add to agenda)

1reaction
theMiddleBluecommented, Apr 27, 2021

thanks to @airween msc_pyparser module, I’ve created a script to append, rename or remove tags from rules in file (if someone need it I can push it somewhere):

python3 rule-ctl.py \
   --config ../../rules/REQUEST-933-APPLICATION-ATTACK-PHP.conf \
   --filter-rule-id '^933.+' \
   --append-tag 'req-933' > tmp/test.conf

image

how about adding a short tag like (req|res)-❤️ digit id> ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Customize a rule set - Visual Studio - Microsoft Learn
In the New File dialog box, select the General category on the left, and then select Code Analysis Rule Set. Select Open. The...
Read more >
8.1 Ruleset File Syntax (XML) - DVT Eclipse IDE
Include in a separate category all new rules added since the specified date. Date format must be: yyyy-MM-dd, for example 2019-01-31. #COMPONENT_TYPE#.
Read more >
Ruleset tag library - IBM
Description: A ruleset is a collection of rules that will be executed when the ruleset is selected during a Reset session. Each ruleset...
Read more >
Configuring tag protection rules - GitHub Docs
Click New rule. Under "Tag name pattern", type the pattern of the tags you want to protect. In this example, typing "*" protects...
Read more >
Automatic creations of tags and rules based on folders - Tabbles
Automatic creations of tags and rules based on folders. Major new feature in Tabbles 5.3.1: using this feature you can select a group...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found