-
Notifications
You must be signed in to change notification settings - Fork 177
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
Logic is going to get messy fast, rules engine? #19
Comments
Let's see if we can find something in python first. I am not familiar with Drools, what are its main characteristics that you find appropriate? It seems to be a business engine? |
I agree a Rules Engine will be necessary and important, if nothing else to manage the complexity as the threat list expands. We might consider a package like this: https://pypi.org/project/Intellect/ |
I agree, it will be necessary as we move forward and complexity increases.
I was looking at a Python-Prolog bridge, but this Intellect seems
interesting in the fact that it appears to take input via classes and
properties, just as we are structuring the input for pytm.
…On Thu, Aug 9, 2018 at 6:28 PM colesmj ***@***.***> wrote:
I agree a Rules Engine will be necessary and important, if nothing else to
manage the complexity as the threat list expands. We might consider a
package like this: https://pypi.org/project/Intellect/
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#19 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAWggW3FcUgSpcxAZ-wwAnScRoCTY-qzks5uPOG7gaJpZM4VYaSe>
.
|
I'm looking into https://pypi.org/project/durable-rules/ and https://pypi.org/project/rule-engine/ . I just tried looking into Intellect, but I didn't really get the grip of it. Have you had any discussions on this topic since 2018? is there a preferred way to go? I'd try to re-create the same threats and come up with the same results. Does anyone have any other examples that could be run to try this approach? |
We are currently testing a number of approaches - a "best" one has not been decided yet. So far we will progress with the simple boolean rules until we get to an approach that is worth moving to. |
I had good experience with plugin based models (Cuckoo sandbox signatures and most of the flexible components in PurpleDome https://github.com/avast/PurpleDome ). |
interesting, i had never seen PurpleDome, thanks! |
Purpledome was fun. But rule wise Cuckoo is more interesting. They use two system for rules. The newer one is "evented" because the logs they are processing are huge. Still they are quite simple to read. Examples are in https://github.com/cuckoosandbox/community/tree/master/modules/signatures/windows One with medium complexity is this one: https://github.com/cuckoosandbox/community/blob/master/modules/signatures/windows/disables_security.py The boilerplate
Is similar to your rule entries. And the things in your "condition" line can be a logic like:
I will try to find some time and prototype a rule base class and 2-3 example rules |
I created an example for rule plugins: It is not perfect yet. I would like to add more helper functions, examples and documentation (including types for the rules author's IDEs) before releasing it. But the code is working and can be discussed. What do you think ? This is how a rule looks like: https://github.com/primion/pytm/blob/rule_plugins_simple/pytm/plugins/rules/example.py Some design principles:
|
Thanks, it looks really good. And it does away with the eval() silliness, which is a big + for me :) |
I will refine the code and create a PR. Either to your main branch or to a dev branch (depends on you, on a dev branch you can do a shorter review as people will not necessarily expect it to work....). I have some more ideas and will just open up new issues to discuss them. Your feedback there would be very important. But I will find workarounds for PRs that get stuck for a few months ( like my dev branch in my fork). My goal is to get everything upstream sooner or later while at the same time benefit from new features as early as possible. |
@Thorsten-Sick I am also curious about the system you are looking to use, as it seems very flexible and can have some interesting uses. Some questions perhaps you can enlighten me / us on your thoughts?
|
hi, sorry for taking so long to get to this! new year (happy new year!), new job, closing some older projects. i took a look at the code - and I am not quite sure where to go from here. Do we have to translate the existing rules into this plugin system? What are some other possible plugins that this enables ? |
Hi You can keep the old rules. But sooner or later it would be simpler to translate them to plugins an remove the redundant code. Maybe I could do that. But as I will start a new job soon I can not promise anything. Is it ok to merge into the main branch ? Do you want to start a "next generation" branch for those giant leaps ? |
Yeah I'm thinking next gen. This sounds like a change that might break
things way too easily going forward.
…On Thu, Jan 4, 2024 at 1:14 AM Thorsten Sick ***@***.***> wrote:
Hi
You can keep the old rules. But sooner or later it would be simpler to
translate them to plugins an remove the redundant code. Maybe I could do
that. But as I will start a new job soon I can not promise anything.
The other plugin type I am thinking about is moving all the design
elements (servers, communication protocols) to a plugin system as well. In
my current company we do build embedded systems (embedded Linux, secure
controllers to store key material) and cloud services. All the extremes.
This architecture could benefit from more components written as plugins.
Is it ok to merge into the main branch ? Do you want to start a "next
generation" branch for those giant leaps ?
—
Reply to this email directly, view it on GitHub
<#19 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC2BAMT7RT6VULWIZVGC3DYMZCEBAVCNFSM4FLBUSPKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBXGY2DGOBVGMZA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
If possible, please select something that's available out-of-the box, without the need to install additional software. Since this is a Python project, please try to limit to standard Python3. I don't want to run Pip, and I don't want to install stuff from third parties. Xz has demonstrated how dangerous it is to depend on externalities. Xz contaminated SELinx and Systemd (among others). |
I've been thinking about this and relates to a few issues I've added recently.
I think the logic is going to get messy as we add more Threats, Mitigations, and add logic to alter severity while applying mitigations.
Does it make sense to continue creating a tightly coupled rules engine here vs using something existing?
Idk what exists for Python. For Java I've worked with Drools that would be perfect for this. So much so I had the fleeting thought to port this to Java to use it.
The text was updated successfully, but these errors were encountered: