Skip to content

Commit 78e115c

Browse files
leogrpoiana
authored andcommitted
docs(README.md): adapt for Falco 0.37
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
1 parent 993434d commit 78e115c

File tree

1 file changed

+32
-27
lines changed

1 file changed

+32
-27
lines changed

README.md

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@ Generate a variety of suspect actions that are detected by Falco rulesets.
1414
For example, some actions modify files and directories below /bin, /etc, /dev, etc.
1515
Make sure you fully understand what is the purpose of this tool before running any action.
1616

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+
1719
## Usage
1820

1921
The full command line documentation is [here](./docs/event-generator.md).
2022

2123
### List actions
2224

2325
```shell
24-
$ event-generator list
26+
$ event-generator list --all
2527

2628
helper.ExecLs
2729
helper.NetworkActivity
@@ -41,14 +43,17 @@ k8saudit.K8SServiceCreated
4143
k8saudit.K8SServiceaccountCreated
4244
syscall.ChangeThreadNamespace
4345
syscall.CreateFilesBelowDev
46+
syscall.CreateSymlinkOverSensitiveFiles
4447
syscall.DbProgramSpawnedProcess
48+
syscall.DirectoryTraversalMonitoredFileRead
4549
syscall.MkdirBinaryDirs
4650
syscall.ModifyBinaryDirs
4751
syscall.NonSudoSetuid
4852
syscall.ReadSensitiveFileTrustedAfterStartup
4953
syscall.ReadSensitiveFileUntrusted
5054
syscall.RunShellUntrusted
5155
syscall.ScheduleCronJobs
56+
syscall.SearchPrivateKeysOrPasswords
5257
syscall.SystemProcsNetworkActivity
5358
syscall.SystemUserInteractive
5459
syscall.UserMgmtBinaries
@@ -61,24 +66,32 @@ syscall.WriteBelowRpmDatabase
6166
```
6267
event-generator run [regexp]
6368
```
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.
6570

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:
7072

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
7586
```
7687

7788
Useful options:
7889
- `--loop` to run actions in a loop
7990
- `--sleep` to set the length of time to wait before running an action (default to `1s`)
8091

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).
8295

8396

8497
#### With Docker
@@ -138,9 +151,10 @@ The above command loops forever, incessantly generating a sample event each seco
138151
### Generate activity for the k8s audit rules
139152
The `k8saudit` collection generates activity that matches the [k8s audit event ruleset](https://github.com/falcosecurity/falco/blob/master/rules/k8s_audit_rules.yaml).
140153

154+
Note that all `k8saudit` are disabled by default. To enable them, use the `--all` option.
141155

142156
```shell
143-
$ event-generator run k8saudit --loop --namespace `falco-eg-sandbox`
157+
$ event-generator run k8saudit --all --loop --namespace `falco-eg-sandbox`
144158
```
145159
> N.B.: the namespace must exist already.
146160
@@ -189,15 +203,14 @@ helm install event-generator falcosecurity/event-generator \
189203
--set config.command=test \
190204
--set config.actions=""
191205
```
192-
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.
193208

194209
## Benchmark
195210

196211
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.
197212

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.
201214

202215
### Run a benchmark
203216

@@ -209,18 +222,10 @@ Please, keep in mind that not all actions can be used for benchmarking since som
209222

210223
**Benchmark example**
211224

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):
221226

222227
```shell
223-
sudo event-generator bench "ChangeThreadNamespace|ReadSensitiveFileUntrusted|WriteBelowBinaryDir" --loop --pid $(ps -ef | awk '$8=="falco" {print $2}')
228+
sudo event-generator bench "ChangeThreadNamespace|ReadSensitiveFileUntrusted" --all --loop --sleep 10ms --pid $(pidof -s falco)
224229
```
225230

226231
## FAQ
@@ -231,7 +236,7 @@ See the [events registry](https://github.com/falcosecurity/event-generator/tree/
231236
### Can I contribute by adding new events?
232237
Sure!
233238

234-
Check out the [events registry](https://github.com/falcosecurity/event-generator/tree/main/events) conventions, then feel free to open a P.R.
239+
Check out the [events registry](https://github.com/falcosecurity/event-generator/tree/main/events) conventions, then feel free to open a PR!
235240

236241
Your contribution is highly appreciated.
237242

0 commit comments

Comments
 (0)