You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this example, we check if the queue has at least 3 items, compute the average interval between the last 3 requests, and trigger if the average time between requests exceeds 5 minutes and all responses are 404s (indicating a slow scan).
49
+
50
+
**Notes:**
51
+
- Timestamps are automatically sorted internally for correctness
52
+
- Requires at least two timestamps
53
+
- Useful for detecting consistent behavior patterns over time
Calculates the median interval (time duration) between consecutive timestamps in a slice.
58
+
59
+
**Use case:** Detecting typical timing patterns when intervals vary widely. The median is more robust against outliers than the average, making it ideal for identifying timing anomalies in irregular patterns.
In this example, we check if there are at least 5 events in the queue, calculate the median interval between the last 5 requests, and trigger if the median interval exceeds 10 minutes and all responses are 404s.
81
+
82
+
**Notes:**
83
+
- Timestamps are automatically sorted internally for correctness
84
+
- Handles both even and odd numbers of intervals correctly
85
+
- Requires at least two timestamps
86
+
- More robust against outliers compared to `AverageInterval`
87
+
- Useful for capturing typical timing patterns in skewed data
This documentation mostly focus on installation of custom scenarios. Scenarios from the hub should be installed as a part of the collection, by using `cscli collections install <collection-name>`. Installing scenarios directly with `cscli scenario install <scenario-name>` might lead to unexpected results because of missing dependencies (ie. parsers, enrichers, post-overflows etc.)
10
+
11
+
:::
12
+
13
+
14
+
## Deployment
15
+
16
+
### Installation
17
+
18
+
To deploy a scenario, simply copy it to `/etc/crowdsec/scenarios/`.
19
+
20
+
### Verification
21
+
22
+
Use `cscli scenarios list` to view all your installed scenarios:
23
+
24
+
-`Name` presents the `name` field of the yaml file.
25
+
-`Version` represents the version of the scenario according to the hub. Versions increment on upstream changes.
26
+
-`Local path` represents the local path to the scenario file.
27
+
-`📦 Status` indicates the state:
28
+
29
+
| Status | Description |
30
+
|--------|-------------|
31
+
|`✔️ enabled`| Scenario is from the hub and up-to-date |
32
+
|`🏠 enabled,local`| This is a custom scenario |
33
+
|`⚠️ enabled,tainted`| This is an upstream scenario that has been modified |
0 commit comments