Brown, James wrote:
> I'm having this exact problem, though only with a couple of hundred 
> SEC rules,
> not thousands.
>  
> I'm even convinced that the problem extends earlier than matching.  
> How do I know
> whether a new rule I'm about to implement isn't already matching some 
> other rule?
> It's possible I'm duplicating earlier effort without realizing it, or 
> perhaps the rule
> matches in a way I didn't intend when I wrote the regex.
>  
> I'd be interested to hear from others about a possible solution for a SEC
> rules database generator.  Something along the lines of:
>  
>   - DB contains rules and meta data (device type, security category, etc.)
>   - DB provides a mechanism to search for a regex match
>   - DB provides the ability to automatically generate  SEC rules file(s)
>   - DB provides an action meta tag that can be used to identify the match
>  
> Has anyone done any work in this area?  I started a simple SQLite 
> schema about
> a month ago, but had to abandon it due to time pressures.  My 
> intention was to
> load all my rules and create some simple SQL scripts to generate a SEC 
> rules file.
>  
> Anyway, your thoughts and suggestions are welcome...
I have done some work on this.

I'm very confident in unix and scripting so I wrote a build system for 
Sec but it's all flat files, not sure about this let's make everything a 
database problem approach.

The problem is that regex are too flexible to be easily matched 
themselves and therefore the benefits of using a database may be lost as 
you cannot do queries for a specific match.

To test for an existing comparable match you'd have to do a full table 
scan, and for each result do a regex comparison against what you are 
doing, if it's even possible to do this in a 100% complete/reliable way.

I have my rules split into lots of files for different things so I know 
where to go to find a likely rule (as I did earlier regarding my 
starting thread) and alphabetically ordered such that it's usually quite 
easy to see what matches are available.

Having a layered approach helps to avoid duplicate regex comparisons 
within Sec and if you catch the fall through it helps to avoid 
re-writing redundant rules as you only add rules for things that are 
caught at the very end. Having a categorized, sorted layout of my rules 
helps avoid duplicates in me it being obvious if there is a similar rule.

Sorry, slight correction from the previous thread, I have over 10000 
*lines* of Sec rules, that's over 1300 rules running across my 
infrastructure. Some of the rules are comprehensive and multi-layered to 
the point where I cannot see it ever getting to 10, 000 rules actually. 
It would be near impossible even for me, the creator who wrote the whole 
thing to get anything past such a thorough lattice of rules. I think 
this is the best approach.

-h

-- 
Hari Sekhon
Always open to interesting opportunities
http://www.linkedin.com/in/harisekhon


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Simple-evcorr-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users

Reply via email to