Skip to content

Commit

Permalink
Basic plex support (#1120)
Browse files Browse the repository at this point in the history
  • Loading branch information
blotus authored Sep 24, 2024
1 parent f3fe010 commit ce1ade2
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .index.json
Original file line number Diff line number Diff line change
Expand Up @@ -4746,6 +4746,24 @@
"crowdsecurity/pgsql-bf"
]
},
"crowdsecurity/plex": {
"path": "collections/crowdsecurity/plex.yaml",
"version": "0.1",
"versions": {
"0.1": {
"digest": "2361b10d19f3f5c4d84ca2c8a9fbbfc8522e1f28047b2e2b87bdfbab6d119de3",
"deprecated": false
}
},
"long_description": "QSBjb2xsZWN0aW9uIGZvciBbUGxleF0oaHR0cHM6Ly93d3cucGxleC50di8pLgoKQXMgcGxleCBhdXRoZW50aWNhdGlvbiBpcyBoYW5kbGVkIGJ5IHRoZWlyIHNlcnZlcnMsIHRoaXMgY29sbGVjdGlvbiBvbmx5IHByb3ZpZGVzIGFuIGFsbG93bGlzdA==",
"content": "cGFyc2VyczoKICAtIGNyb3dkc2VjdXJpdHkvcGxleC1hbGxvd2xpc3QKZGVzY3JpcHRpb246ICJwbGV4IHN1cHBvcnQ6IGFsbG93bGlzdCIKYXV0aG9yOiBjcm93ZHNlY3VyaXR5CnRhZ3M6CiAgLSBwbGV4CiAgLSBhbGxvd2xpc3QK",
"description": "plex support: allowlist",
"author": "crowdsecurity",
"labels": null,
"parsers": [
"crowdsecurity/plex-allowlist"
]
},
"crowdsecurity/postfix": {
"path": "collections/crowdsecurity/postfix.yaml",
"version": "0.3",
Expand Down Expand Up @@ -7935,6 +7953,22 @@
"author": "crowdsecurity",
"labels": null
},
"crowdsecurity/plex-allowlist": {
"path": "parsers/s02-enrich/crowdsecurity/plex-allowlist.yaml",
"stage": "s02-enrich",
"version": "0.1",
"versions": {
"0.1": {
"digest": "38c6b298e8358e7d15145f9d34e1720596850342c705aa57e4764ccdf551bca4",
"deprecated": false
}
},
"long_description": "IyMgUGxle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2dC5NZXRhLmh0dHBfcGF0aCBtYXRjaGVzICdeL2xpYnJhcnkvbWV0YWRhdGEvXFxkKycKICAgLSBldnQuTWV0YS5odHRwX3N0YXR1cyA9PSAnMjAwJyAmJiBldnQuTWV0YS5odHRwX3ZlcmIgPT0gJ0dFVCcgJiYgZXZ0Lk1ldGEuaHR0cF9wYXRoID09ICcvc3RhdHVzL3Nlc3Npb25zJw==",
"description": "Allowlist events from Plex",
"author": "crowdsecurity",
"labels": null
},
"crowdsecurity/postfix-logs": {
"path": "parsers/s01-parse/crowdsecurity/postfix-logs.yaml",
"stage": "s01-parse",
Expand Down
3 changes: 3 additions & 0 deletions collections/crowdsecurity/plex.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
A collection for [Plex](https://www.plex.tv/).

As plex authentication is handled by their servers, this collection only provides an allowlist
7 changes: 7 additions & 0 deletions collections/crowdsecurity/plex.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
parsers:
- crowdsecurity/plex-allowlist
description: "plex support: allowlist"
author: crowdsecurity
tags:
- plex
- allowlist
5 changes: 5 additions & 0 deletions parsers/s02-enrich/crowdsecurity/plex-allowlist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Plex Allowlist

Allowlist for Plex Media Server.

Allow events on the various transcode endpoints, timeline scrubbing and library metadata.
11 changes: 11 additions & 0 deletions parsers/s02-enrich/crowdsecurity/plex-allowlist.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: crowdsecurity/plex-allowlist
description: "Allowlist events from Plex"
filter: "evt.Meta.service == 'http' && evt.Meta.log_type in ['http_access-log', 'http_error-log']"
whitelist:
reason: "Plex Allowlist"
expression:
- evt.Meta.http_status == '200' && evt.Meta.http_verb == 'GET' && evt.Meta.http_path startsWith '/video/:/transcode/'
- evt.Meta.http_status == '200' && evt.Meta.http_verb == 'GET' && evt.Meta.http_path startsWith '/photo/:/transcode/'
- evt.Meta.http_status == '200' && evt.Meta.http_verb == 'GET' && evt.Meta.http_path startsWith '/:/timeline'
- evt.Meta.http_status == '200' && evt.Meta.http_verb == 'GET' && evt.Meta.http_path matches '^/library/metadata/\\d+'
- evt.Meta.http_status == '200' && evt.Meta.http_verb == 'GET' && evt.Meta.http_path == '/status/sessions'

0 comments on commit ce1ade2

Please sign in to comment.