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
Copy file name to clipboardExpand all lines: README.md
+32-27Lines changed: 32 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,14 +14,16 @@ Generate a variety of suspect actions that are detected by Falco rulesets.
14
14
For example, some actions modify files and directories below /bin, /etc, /dev, etc.
15
15
Make sure you fully understand what is the purpose of this tool before running any action.
16
16
17
+
**Notice** — From version `v0.11.0` the `event-generator` requires Falco 0.37.0 or newer. Previous versions of the `event-generator` might be compatible with older versions of Falco, however, we do not guarantee it.
18
+
17
19
## Usage
18
20
19
21
The full command line documentation is [here](./docs/event-generator.md).
20
22
21
23
### List actions
22
24
23
25
```shell
24
-
$ event-generator list
26
+
$ event-generator list --all
25
27
26
28
helper.ExecLs
27
29
helper.NetworkActivity
@@ -41,14 +43,17 @@ k8saudit.K8SServiceCreated
41
43
k8saudit.K8SServiceaccountCreated
42
44
syscall.ChangeThreadNamespace
43
45
syscall.CreateFilesBelowDev
46
+
syscall.CreateSymlinkOverSensitiveFiles
44
47
syscall.DbProgramSpawnedProcess
48
+
syscall.DirectoryTraversalMonitoredFileRead
45
49
syscall.MkdirBinaryDirs
46
50
syscall.ModifyBinaryDirs
47
51
syscall.NonSudoSetuid
48
52
syscall.ReadSensitiveFileTrustedAfterStartup
49
53
syscall.ReadSensitiveFileUntrusted
50
54
syscall.RunShellUntrusted
51
55
syscall.ScheduleCronJobs
56
+
syscall.SearchPrivateKeysOrPasswords
52
57
syscall.SystemProcsNetworkActivity
53
58
syscall.SystemUserInteractive
54
59
syscall.UserMgmtBinaries
@@ -61,24 +66,32 @@ syscall.WriteBelowRpmDatabase
61
66
```
62
67
event-generator run [regexp]
63
68
```
64
-
Without arguments, it runs all actions; otherwise, only those actions matching the given regular expression.
69
+
Without arguments, it runs all actions; otherwise, only those actions match the given regular expression.
65
70
66
-
For example, to run `syscall.MkdirBinaryDirs` and
67
-
`syscall.ModifyBinaryDirs` actions only:
68
-
```shell
69
-
$ sudo event-generator run syscall\.\*BinaryDirs
71
+
For example, to run only those actions containing the word `Files` in their name:
70
72
71
-
INFO sleep for 1s action=syscall.MkdirBinaryDirs
72
-
INFO writing to /bin/directory-created-by-event-generator action=syscall.MkdirBinaryDirs
73
-
INFO sleep for 1s action=syscall.ModifyBinaryDirs
74
-
INFO modifying /bin/true to /bin/true.event-generator and back action=syscall.ModifyBinaryDirs
73
+
```shell
74
+
$ sudo event-generator run syscall\.\*Files\.\*
75
+
76
+
INFO sleep for 100ms action=syscall.ReadSensitiveFileUntrusted
77
+
INFO action executed action=syscall.ReadSensitiveFileUntrusted
78
+
INFO sleep for 100ms action=syscall.CreateSymlinkOverSensitiveFiles
79
+
INFO action executed action=syscall.CreateSymlinkOverSensitiveFiles
80
+
INFO sleep for 100ms action=syscall.DirectoryTraversalMonitoredFileRead
81
+
INFO action executed action=syscall.DirectoryTraversalMonitoredFileRead
82
+
INFO sleep for 100ms action=syscall.ReadSensitiveFileTrustedAfterStartup
83
+
INFO spawn as "httpd" action=syscall.ReadSensitiveFileTrustedAfterStartup args="^syscall.ReadSensitiveFileUntrusted$ --sleep 6s"
84
+
INFO sleep for 6s action=syscall.ReadSensitiveFileUntrusted as=httpd
85
+
INFO action executed action=syscall.ReadSensitiveFileUntrusted as=httpd
75
86
```
76
87
77
88
Useful options:
78
89
-`--loop` to run actions in a loop
79
90
-`--sleep` to set the length of time to wait before running an action (default to `1s`)
80
91
81
-
All other options are documented [here](./docs/event-generator_run.md).
92
+
Also, note that not all actions are enabled by default. To run all actions, use the `--all` option.
93
+
94
+
Further options are documented [here](./docs/event-generator_run.md).
82
95
83
96
84
97
#### With Docker
@@ -138,9 +151,10 @@ The above command loops forever, incessantly generating a sample event each seco
138
151
### Generate activity for the k8s audit rules
139
152
The `k8saudit` collection generates activity that matches the [k8s audit event ruleset](https://github.com/falcosecurity/falco/blob/master/rules/k8s_audit_rules.yaml).
140
153
154
+
Note that all `k8saudit` are disabled by default. To enable them, use the `--all` option.
141
155
142
156
```shell
143
-
$ event-generator run k8saudit --loop --namespace `falco-eg-sandbox`
157
+
$ event-generator run k8saudit --all --loop --namespace `falco-eg-sandbox`
Note that to test `k8saudit` events, you need [Kubernetes audit log] enabled both in Kubernetes and Falco.
206
+
207
+
Note that to test `k8saudit` events, you need _Kubernetes Audit Log_ functionality enabled in Kubernetes and the [k8saudit plugin](https://github.com/falcosecurity/plugins/tree/master/plugins/k8saudit) in Falco.
193
208
194
209
## Benchmark
195
210
196
211
Since `v0.5.0`, the `event-generator` can also be used for benchmarking a running instance of Falco. The command `event-generator bench` generates a high number of Event Per Second (EPS) to show you events throughput allowed by your Falco installation.
197
212
198
-
> This feature requires Falco 0.24.0 or newer. Before using the command in the section below, you need [Falco installed](https://falco.org/docs/installation/) and running with the [gRPC Output](https://falco.org/docs/grpc/) enabled.
199
-
200
-
Finally, be aware that Falco embeds a rate-limiter for notifications that affect the gRPC Outputs APIs too. You probably need to increase the `outputs.rate` and `outputs.max_burst` values [within the Falco configuration](https://github.com/falcosecurity/falco/blob/e2bf87d207a32401da271835e15dadf957f68e8c/falco.yaml#L90-L104), otherwise EPS will be rate-limited by the throttling mechanism.
213
+
Be aware that before Falco 0.37 a rate-limiter for notifications that affects the gRPC Outputs APIs was present. You probably need to increase the `outputs.rate` and `outputs.max_burst` values [within the Falco configuration](https://github.com/falcosecurity/falco/blob/e2bf87d207a32401da271835e15dadf957f68e8c/falco.yaml#L90-L104), otherwise EPS will be rate-limited by the throttling mechanism.
201
214
202
215
### Run a benchmark
203
216
@@ -209,18 +222,10 @@ Please, keep in mind that not all actions can be used for benchmarking since som
209
222
210
223
**Benchmark example**
211
224
212
-
Once you have relaxed the rate-limiter in the Falco configuration, for example by setting:
213
-
214
-
```yaml
215
-
outputs:
216
-
rate: 1000000000
217
-
max_burst: 1000000000
218
-
```
219
-
220
-
Then, a common way for benchmarking a local Falco instance is by running the following command (that connects via Unix socket to `/run/falco/falco.sock` by default):
225
+
A common way for benchmarking a local Falco instance is by running the following command (that connects via Unix socket to `/run/falco/falco.sock` by default):
0 commit comments