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

Count column #103

Closed
mkwired opened this issue Oct 3, 2022 · 9 comments
Closed

Count column #103

mkwired opened this issue Oct 3, 2022 · 9 comments
Assignees
Labels
enhancement New feature or request

Comments

@mkwired
Copy link

mkwired commented Oct 3, 2022

The behavior of Chainsaw does not work as I thought. I assumed the output column 'count' represents the number of occurrences of that specific event, but based on my EVTX files, that does not appear correct. So what does the 'column' mean?

Clipboard04

@alexkornitzer
Copy link
Contributor

Hey, so the count in this context it about how many documents were needed to cause the detection to fire. Thus it is only really there to inform users when aggregation based rules trigger such as brute force attacks. The reason it is shown in every row is for consistency. Very happy to change or improve things, do you have any thoughts on it?

@alexkornitzer alexkornitzer added the question Further information is requested label Oct 20, 2022
@Sub-Z3r0
Copy link

Hi, is it possible to concatenate results of a column whenever trying to perform an aggregation.
For instance, trying to perform an aggregation rule for a brute force attack and I need to concatenate all of the source IPs into a single cell. is that feasible ?

@alexkornitzer
Copy link
Contributor

I believe that is doable in the way that I wrote it, are you wanting to aggregate by multiple columns or just one? The chainsaw rule syntax should already support both use cases: https://github.com/WithSecureLabs/chainsaw/blob/master/rules/login_attacks/account_brute_force.yml

Please let me know if this is not what you meant and we can hash out what is missing in order to get it added in :)

@alexkornitzer
Copy link
Contributor

alexkornitzer commented Aug 30, 2023

Having said that I have not wired up the fancy outputting for aggregates yet which I think is what you want? https://github.com/WithSecureLabs/chainsaw/blob/master/src/cli.rs#L347

@Sub-Z3r0
Copy link

Sub-Z3r0 commented Aug 30, 2023

I would like to add to the aggregation the ability to concat cells. attached you can see an example.
In the first screenshot the users and timestamps are each in a row, I would like to concatenate them in a single row if that is feasible.
Screen Shot 2023-08-30 at 11 45 11 PM
Screen Shot 2023-08-30 at 11 47 04 PM

by doing so additional rule use cases can be added to chainsaw playbook.

@alexkornitzer
Copy link
Contributor

So you can do the first bit by adding the extra field to the aggregate fields in the rule. The second part of merging the non grouped columns is not implemented yet (it just picks the first doc as show in my second comment above). But in theory this is pretty easy to add so I can add that to my list of things to do.

Rule tweak would be like this:

...
aggregate:
  count: '>5'
  fields:
    - Event.EventData.TargetUserName
    - Event.EventData.SourceIP

@alexkornitzer alexkornitzer self-assigned this Sep 4, 2023
alexkornitzer pushed a commit that referenced this issue Sep 4, 2023
The implementation of this is not that nice due to compromises that had
to be made elsewhere but this should do the job for now. This will be
handled properly when rescoping occurs.
@alexkornitzer
Copy link
Contributor

alexkornitzer commented Sep 4, 2023

@Sub-Z3r0, if you are able to compile Chainsaw, can you give the latest master branch a go? full aggregation support should be working properly now.

Screenshot 2023-09-04 at 12 03 23

@alexkornitzer alexkornitzer added enhancement New feature or request and removed question Further information is requested labels Sep 4, 2023
@Sub-Z3r0
Copy link

@alexkornitzer Thank you for your support. It is working as expected.
2023-09-11 23 05 56

@alexkornitzer
Copy link
Contributor

No problem, will get that tagged up and released. Thanks for testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants