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

Add qBittorrent collection to hub. #1179

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .tests/qbittorrent-bf/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
parsers:
- crowdsecurity/syslog-logs
- ./parsers/s01-parse/gilbsgilbs/qbittorrent-logs.yaml
- "crowdsecurity/dateparse-enrich"
scenarios:
- ./scenarios/gilbsgilbs/qbittorrent-bf.yaml
postoverflows:
- ""
log_file: qbittorrent-logs.log
log_type: qbittorrent
labels: {}
ignore_parsers: false
248 changes: 248 additions & 0 deletions .tests/qbittorrent-bf/parser.assert

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions .tests/qbittorrent-bf/qbittorrent-logs.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(N) 2024-11-26T01:26:58 - WebAPI login success. IP: b942:70a6:a98a:de85:0733:bf28:33fb:fc71
(W) 2024-11-26T13:37:02 - WebAPI login failure. Reason: invalid credentials, attempt count: 1, IP: a839:f70d:3ed9:bf86:119b:e579:acdd:dce8, username: user0
(W) 2024-11-26T13:37:03 - WebAPI login failure. Reason: invalid credentials, attempt count: 2, IP: a839:f70d:3ed9:bf86:119b:e579:acdd:dce8, username: user0
(W) 2024-11-26T13:37:04 - WebAPI login failure. Reason: invalid credentials, attempt count: 3, IP: a839:f70d:3ed9:bf86:119b:e579:acdd:dce8, username: user0
(W) 2024-11-26T13:37:05 - WebAPI login failure. Reason: invalid credentials, attempt count: 4, IP: a839:f70d:3ed9:bf86:119b:e579:acdd:dce8, username: user0
(W) 2024-11-26T13:37:06 - WebAPI login failure. Reason: invalid credentials, attempt count: 5, IP: a839:f70d:3ed9:bf86:119b:e579:acdd:dce8, username: user0
(W) 2024-11-26T13:37:07 - WebAPI login failure. Reason: IP has been banned, IP: a839:f70d:3ed9:bf86:119b:e579:acdd:dce8, username: user0
51 changes: 51 additions & 0 deletions .tests/qbittorrent-bf/scenario.assert
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
len(results) == 1
"a839:f70d:3ed9:bf86:119b:e579:acdd:dce8" in results[0].Overflow.GetSources()
results[0].Overflow.Sources["a839:f70d:3ed9:bf86:119b:e579:acdd:dce8"].IP == "a839:f70d:3ed9:bf86:119b:e579:acdd:dce8"
results[0].Overflow.Sources["a839:f70d:3ed9:bf86:119b:e579:acdd:dce8"].Range == ""
results[0].Overflow.Sources["a839:f70d:3ed9:bf86:119b:e579:acdd:dce8"].GetScope() == "Ip"
results[0].Overflow.Sources["a839:f70d:3ed9:bf86:119b:e579:acdd:dce8"].GetValue() == "a839:f70d:3ed9:bf86:119b:e579:acdd:dce8"
results[0].Overflow.Alert.Events[0].GetMeta("datasource_path") == "qbittorrent-logs.log"
results[0].Overflow.Alert.Events[0].GetMeta("datasource_type") == "file"
results[0].Overflow.Alert.Events[0].GetMeta("log_type") == "qbittorrent_failed_auth"
results[0].Overflow.Alert.Events[0].GetMeta("service") == "qbittorrent"
results[0].Overflow.Alert.Events[0].GetMeta("source_ip") == "a839:f70d:3ed9:bf86:119b:e579:acdd:dce8"
results[0].Overflow.Alert.Events[0].GetMeta("timestamp") == "2024-11-26T13:37:02Z"
results[0].Overflow.Alert.Events[0].GetMeta("user") == "user0"
results[0].Overflow.Alert.Events[1].GetMeta("datasource_path") == "qbittorrent-logs.log"
results[0].Overflow.Alert.Events[1].GetMeta("datasource_type") == "file"
results[0].Overflow.Alert.Events[1].GetMeta("log_type") == "qbittorrent_failed_auth"
results[0].Overflow.Alert.Events[1].GetMeta("service") == "qbittorrent"
results[0].Overflow.Alert.Events[1].GetMeta("source_ip") == "a839:f70d:3ed9:bf86:119b:e579:acdd:dce8"
results[0].Overflow.Alert.Events[1].GetMeta("timestamp") == "2024-11-26T13:37:03Z"
results[0].Overflow.Alert.Events[1].GetMeta("user") == "user0"
results[0].Overflow.Alert.Events[2].GetMeta("datasource_path") == "qbittorrent-logs.log"
results[0].Overflow.Alert.Events[2].GetMeta("datasource_type") == "file"
results[0].Overflow.Alert.Events[2].GetMeta("log_type") == "qbittorrent_failed_auth"
results[0].Overflow.Alert.Events[2].GetMeta("service") == "qbittorrent"
results[0].Overflow.Alert.Events[2].GetMeta("source_ip") == "a839:f70d:3ed9:bf86:119b:e579:acdd:dce8"
results[0].Overflow.Alert.Events[2].GetMeta("timestamp") == "2024-11-26T13:37:04Z"
results[0].Overflow.Alert.Events[2].GetMeta("user") == "user0"
results[0].Overflow.Alert.Events[3].GetMeta("datasource_path") == "qbittorrent-logs.log"
results[0].Overflow.Alert.Events[3].GetMeta("datasource_type") == "file"
results[0].Overflow.Alert.Events[3].GetMeta("log_type") == "qbittorrent_failed_auth"
results[0].Overflow.Alert.Events[3].GetMeta("service") == "qbittorrent"
results[0].Overflow.Alert.Events[3].GetMeta("source_ip") == "a839:f70d:3ed9:bf86:119b:e579:acdd:dce8"
results[0].Overflow.Alert.Events[3].GetMeta("timestamp") == "2024-11-26T13:37:05Z"
results[0].Overflow.Alert.Events[3].GetMeta("user") == "user0"
results[0].Overflow.Alert.Events[4].GetMeta("datasource_path") == "qbittorrent-logs.log"
results[0].Overflow.Alert.Events[4].GetMeta("datasource_type") == "file"
results[0].Overflow.Alert.Events[4].GetMeta("log_type") == "qbittorrent_failed_auth"
results[0].Overflow.Alert.Events[4].GetMeta("service") == "qbittorrent"
results[0].Overflow.Alert.Events[4].GetMeta("source_ip") == "a839:f70d:3ed9:bf86:119b:e579:acdd:dce8"
results[0].Overflow.Alert.Events[4].GetMeta("timestamp") == "2024-11-26T13:37:06Z"
results[0].Overflow.Alert.Events[4].GetMeta("user") == "user0"
results[0].Overflow.Alert.Events[5].GetMeta("datasource_path") == "qbittorrent-logs.log"
results[0].Overflow.Alert.Events[5].GetMeta("datasource_type") == "file"
results[0].Overflow.Alert.Events[5].GetMeta("log_type") == "qbittorrent_failed_auth"
results[0].Overflow.Alert.Events[5].GetMeta("service") == "qbittorrent"
results[0].Overflow.Alert.Events[5].GetMeta("source_ip") == "a839:f70d:3ed9:bf86:119b:e579:acdd:dce8"
results[0].Overflow.Alert.Events[5].GetMeta("timestamp") == "2024-11-26T13:37:07Z"
results[0].Overflow.Alert.Events[5].GetMeta("user") == "user0"
results[0].Overflow.Alert.GetScenario() == "gilbsgilbs/qbittorrent-bf"
results[0].Overflow.Alert.Remediation == true
results[0].Overflow.Alert.GetEventsCount() == 6
11 changes: 11 additions & 0 deletions .tests/qbittorrent-logs/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
parsers:
- crowdsecurity/syslog-logs
- ./parsers/s01-parse/gilbsgilbs/qbittorrent-logs.yaml
scenarios:
- ""
postoverflows:
- ""
log_file: qbittorrent-logs.log
log_type: qbittorrent
labels: {}
ignore_parsers: false
Loading