Skip to content
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

Filter bot #569

Closed
7 of 18 tasks
sebix opened this issue Jul 14, 2016 · 13 comments
Closed
7 of 18 tasks

Filter bot #569

sebix opened this issue Jul 14, 2016 · 13 comments
Labels
component: bots feature Indicates new feature requests or new features help wanted Indicates that a maintainer wants help on an issue or pull request

Comments

@sebix
Copy link
Member

sebix commented Jul 14, 2016

During a workshop we collected some feedback on needed filtering possibilities. We now came up with this list of useful comparisons. Could be implemented by an abstract base class and derived specific classes.

I used pseudo code for easier reading.

Generic filter

The filter bot shall support these generic filtering comparisons:

Match any key in the event against a value with these comparison operators:

Ip specific filtering

In particular, the filter bot shall have a derived class "IPAddressFilter" which can compare:
source.ip, destination.ip, source.network, destination.network against a value with these comparators:

  • ip = '192.0.2.1'
  • ip in '192.0.2.1-192.0.2.10'
  • ip in ['192.0.2.1', '192.0.2.2']
  • ip in '192.0.2.0/24'
  • ip in ['192.0.2.1-192.0.2.10', '192.0.2.100/28']
  • for source.ip and destination.ip

Time specific filtering:

Again this is a derived class.
Compare time.source, time.observation via:

  • <,>
  • <=,>=
  • ==
  • !=
  • absolute
  • relative

comments appreciated

EDIT 2016-07-18: Added exists
EDIT 2016-09-07: ip-filtering: different entries in lists

@sebix sebix added feature Indicates new feature requests or new features component: bots labels Jul 14, 2016
@sebix sebix added this to the Release 3 - Future milestone Jul 14, 2016
@ondj
Copy link
Contributor

ondj commented Jul 18, 2016

Because not every message has every field, "field exists" and "field does not exist" filters are necessary (or handle not exists fields as null).

And then at least and, or and not operators are useful for advanced filtering.

@aaronkaplan
Copy link
Member

aaronkaplan commented Jul 18, 2016

On 18 Jul 2016, at 14:28, ondj [email protected] wrote:

Because not every message has every field, "field exists" and "field does not exist" filters are necessary (or handle not exists fields as null).

And then at least and, or and not operators are useful for advanced filtering.

Agreed.

EDIT 2018-06-04 @wagner-certat: fix citation syntax

@dmth
Copy link
Contributor

dmth commented Jul 19, 2016

An enhancement of the filters would be great. Do these ideas also include a "choice of output queues", for example: if ip in 192.0.2.1/28 then my-special-expert-queue else normal-expert-queue?

Can this be realised?

@sebix
Copy link
Member Author

sebix commented Jul 19, 2016

Can this be realised?

Currently not, but definitely on the wishlist.

@sebix sebix added the help wanted Indicates that a maintainer wants help on an issue or pull request label Jul 19, 2016
@dmth
Copy link
Contributor

dmth commented Sep 7, 2016

FYI: I'm going to start working on the RegEx thing, later it is going to be extended, in order to be capable of understanding the extras-JSON.

@sebix
Copy link
Member Author

sebix commented Sep 7, 2016

The extras-Field should actually be a native dict (or similar) and its JSON-representation should just be used for outputs and in the message queue. The usage of json for extra in intelmq itself is a shortcoming in the current version.

@dmth
Copy link
Contributor

dmth commented Sep 12, 2016

See #676 for RegEx in the Filter Expert.
The interpreting of JSON ist currently paused.

@dmth
Copy link
Contributor

dmth commented Feb 28, 2017

Idea: What about using Conditioned Pipelines additional to filters?
This might solve my requirement stated in #569 (comment)

Each destination pipeline has an entry-condition which has to be met before an event is inserted into the pipeline. Maybe you can imagine it like a bouncer in front of a club. The default condition for each pipeline is true, so every event can get into the pipeline.

2789_0_img_20170228_085913

How might this look in a pipeline.conf file?

    "parser": {
        "source-queue": "parser-queue",
        "destination-queues": {
            "expert1-queue": "if event.get(\"source.cc\") = \"DE\""
            "expert2-queue": "if event.get(\"source.cc\") != \"DE\""
        }
    },
    "expert2": {
        "source-queue": "expert2-queue",
        "destination-queues": {
            "another-expert-queue": true
            "yet-another-expert-queue": true
        }
    },

Problems:

  1. This allows the execution of arbitrary code from the *.conf files, if a programming language like python is used instead of a rule-language.

Questions:

  1. What happens to bounced events?

@ghost
Copy link

ghost commented Feb 28, 2017

What happens to bounced events?

What are bounced events?

@dmth
Copy link
Contributor

dmth commented Feb 28, 2017

What are bounced events?

Bounced events are those events which were not fit to get into the destination pipeline.

@ghost
Copy link

ghost commented Jun 4, 2018

An enhancement of the filters would be great. Do these ideas also include a "choice of output queues", for example: if ip in 192.0.2.1/28 then my-special-expert-queue else normal-expert-queue?

Can this be realised?

Named destination queues are in develop branch, for support in filter expert see #1208

@ghost ghost modified the milestones: 2.0.0, 2.1.0 Apr 10, 2019
@ghost
Copy link

ghost commented Aug 15, 2019

I created a new issue for the Conditioned Pipelines, so this issue can focus on the filter bot's capabilities itself as existing solution

@ghost ghost modified the milestones: 2.1.0, 2.2.0 Oct 25, 2019
@ghost ghost modified the milestones: 2.2.0, More bots and feeds Jun 17, 2020
@ghost ghost mentioned this issue Jun 7, 2021
@ghost
Copy link

ghost commented Jul 30, 2021

the sieve bot can cover all of them. != can be done with paths -> Closing here. If you think that something should still be implemented, please reopen here or another issue.

@ghost ghost closed this as completed Jul 30, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: bots feature Indicates new feature requests or new features help wanted Indicates that a maintainer wants help on an issue or pull request
Projects
None yet
Development

No branches or pull requests

4 participants