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

Feat: Analyze logsources #53

Merged
merged 2 commits into from
Jul 17, 2024
Merged

Feat: Analyze logsources #53

merged 2 commits into from
Jul 17, 2024

Conversation

andurin
Copy link
Collaborator

@andurin andurin commented Jul 17, 2024

This PR brings a new sub-command to sigma analyze which prints a simple table about the used logsources.

Example:

$ sigma analyze logsource - ../sigma/rules/windows
Parsing Sigma rules  [####################################]  100%          
--------------------------+---------+----------+------+--------+-----+---------------+-----
Logsource                 | Overall | Critical | High | Medium | Low | Informational | None
--------------------------+---------+----------+------+--------+-----+---------------+-----
process_creation          | 1082    | 25       | 519  | 486    | 51  | 1             | 0   
None                      | 320     | 13       | 161  | 105    | 35  | 6             | 0   
registry_set              | 182     | 0        | 97   | 77     | 7   | 1             | 0   
ps_script                 | 160     | 2        | 51   | 88     | 19  | 0             | 0   
file_event                | 151     | 7        | 79   | 58     | 7   | 0             | 0   
image_load                | 90      | 1        | 41   | 44     | 3   | 1             | 0   
network_connection        | 49      | 0        | 24   | 23     | 2   | 0             | 0   
registry_event            | 35      | 9        | 18   | 8      | 0   | 0             | 0   
ps_module                 | 33      | 1        | 17   | 10     | 4   | 1             | 0   
process_access            | 23      | 1        | 17   | 4      | 1   | 0             | 0   
pipe_created              | 17      | 6        | 3    | 7      | 0   | 1             | 0   
dns_query                 | 17      | 1        | 3    | 10     | 3   | 0             | 0   
file_delete               | 12      | 0        | 4    | 7      | 1   | 0             | 0   
create_remote_thread      | 11      | 0        | 8    | 3      | 0   | 0             | 0   
ps_classic_start          | 10      | 0        | 2    | 5      | 3   | 0             | 0   
driver_load               | 10      | 0        | 7    | 2      | 1   | 0             | 0   
registry_add              | 9       | 0        | 4    | 4      | 1   | 0             | 0   
create_stream_hash        | 9       | 0        | 6    | 3      | 0   | 0             | 0   
registry_delete           | 7       | 0        | 3    | 4      | 0   | 0             | 0   
file_access               | 7       | 0        | 0    | 5      | 2   | 0             | 0   
wmi_event                 | 3       | 0        | 2    | 1      | 0   | 0             | 0   
file_change               | 2       | 0        | 2    | 0      | 0   | 0             | 0   
raw_access_thread         | 1       | 0        | 0    | 0      | 1   | 0             | 0   
process_tampering         | 1       | 0        | 0    | 1      | 0   | 0             | 0   
sysmon_status             | 1       | 0        | 1    | 0      | 0   | 0             | 0   
sysmon_error              | 1       | 0        | 1    | 0      | 0   | 0             | 0   
ps_classic_provider_start | 1       | 0        | 1    | 0      | 0   | 0             | 0   
file_executable_detected  | 1       | 0        | 0    | 1      | 0   | 0             | 0   
file_rename               | 1       | 0        | 0    | 1      | 0   | 0             | 0   

Edit:
Columns are sortable using -k/--sort-by switch:

$ sigma analyze logsource --sort-by Critical - ../sigma/rules/windows
Parsing Sigma rules  [####################################]  100%          
--------------------------+---------+----------+------+--------+-----+---------------+-----
Logsource                 | Overall | Critical | High | Medium | Low | Informational | None
--------------------------+---------+----------+------+--------+-----+---------------+-----
process_creation          | 1082    | 25       | 519  | 486    | 51  | 1             | 0   
None                      | 320     | 13       | 161  | 105    | 35  | 6             | 0   
registry_event            | 35      | 9        | 18   | 8      | 0   | 0             | 0   
file_event                | 151     | 7        | 79   | 58     | 7   | 0             | 0   
...

@thomaspatzke thomaspatzke merged commit 90dabf8 into main Jul 17, 2024
24 checks passed
@andurin andurin deleted the analyze_logsource branch July 17, 2024 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants