|
1 | 1 | # Configuring Tracee |
2 | 2 |
|
3 | 3 | Tracee has many different options and settings that control how Tracee operates. |
4 | | -This section presents available configuration options. To learn about how to apply configuration to Tracee, please refer to the [CLI](./cli.md) or [Kubernetes](./kubernetes.md) specific guides. |
| 4 | + |
| 5 | + |
| 6 | +To learn about how to apply configuration to Tracee, please refer to the [CLI](./cli.md) or [Kubernetes](./kubernetes.md) specific guides, depending on how you deploy Tracee. |
5 | 7 |
|
6 | 8 | A complete config file with all available options can be found [here](https://github.com/aquasecurity/tracee/blob/main/examples/config/global_config.yaml). Most of the options are documented in different sections in the documentation. |
7 | 9 |
|
8 | | -```yaml |
9 | | -blob-perf-buffer-size: 1024 |
10 | | -cache: |
11 | | - type: none |
12 | | - size: 1024 |
13 | | - |
14 | | -proctree: |
15 | | - source: none |
16 | | - cache: |
17 | | - process: 8192 |
18 | | - thread: 4096 |
19 | | - |
20 | | -capabilities: |
21 | | - bypass: false |
22 | | - add: |
23 | | - - cap_sys_admin |
24 | | - - cap_syslog |
25 | | - drop: |
26 | | - - cap_chown |
27 | | - |
28 | | -cri: |
29 | | - - runtime: |
30 | | - name: containerd |
31 | | - socket: /var/run/containerd/containerd.sock |
32 | | - - runtime: |
33 | | - name: docker |
34 | | - socket: /var/run/docker.sock |
35 | | - |
36 | | -healthz: false |
37 | | -install-path: /tmp/tracee |
38 | | -listen-addr: :3366 |
39 | | -log: |
40 | | - level: info |
41 | | - file: "/path/to/log/file.log" |
42 | | - aggregate: |
43 | | - enabled: true |
44 | | - flush-interval: "5s" |
45 | | - filters: |
46 | | - libbpf: false |
47 | | - in: |
48 | | - msg: |
49 | | - - SampleMessage1 |
50 | | - - SampleMessage2 |
51 | | - pkg: |
52 | | - - package1 |
53 | | - - package2 |
54 | | - file: |
55 | | - - file1.go |
56 | | - - file2.go |
57 | | - level: |
58 | | - - warn |
59 | | - - error |
60 | | - regex: |
61 | | - - ^pattern1 |
62 | | - - ^pattern2 |
63 | | - out: |
64 | | - msg: |
65 | | - - ExcludedMessage1 |
66 | | - pkg: |
67 | | - - excludedPackage |
68 | | - file: |
69 | | - - excludedFile.go |
70 | | - level: |
71 | | - - debug |
72 | | - regex: |
73 | | - - ^excludedPattern |
74 | | - |
75 | | -metrics: false |
76 | | -output: |
77 | | - json: |
78 | | - files: |
79 | | - - stdout |
80 | | - |
81 | | - table: |
82 | | - files: |
83 | | - - /path/to/table1.out |
84 | | - - /path/to/table2.out |
85 | | - |
86 | | - table-verbose: |
87 | | - files: |
88 | | - - stdout |
89 | | - |
90 | | - gotemplate: |
91 | | - template: /path/to/my_template1.tmpl |
92 | | - files: |
93 | | - - /path/to/output1.out |
94 | | - - /path/to/output2.out |
95 | | - |
96 | | - forward: |
97 | | - - forward1: |
98 | | - protocol: tcp |
99 | | - user: user |
100 | | - password: pass |
101 | | - host: 127.0.0.1 |
102 | | - port: 24224 |
103 | | - tag: tracee1 |
104 | | - - forward2: |
105 | | - protocol: udp |
106 | | - user: user |
107 | | - password: pass |
108 | | - host: 127.0.0.1 |
109 | | - port: 24225 |
110 | | - tag: tracee2 |
111 | | - |
112 | | - webhook: |
113 | | - - webhook1: |
114 | | - protocol: http |
115 | | - host: localhost |
116 | | - port: 8000 |
117 | | - timeout: 5s |
118 | | - gotemplate: /path/to/template/test.tmpl |
119 | | - content-type: application/json |
120 | | - - webhook2: |
121 | | - protocol: http |
122 | | - host: localhost |
123 | | - port: 9000 |
124 | | - timeout: 3s |
125 | | - gotemplate: /path/to/template/test.tmpl |
126 | | - content-type: application/json |
127 | | - |
128 | | - options: |
129 | | - none: false |
130 | | - stack-addresses: true |
131 | | - exec-env: false |
132 | | - exec-hash: dev-inode |
133 | | - parse-arguments: true |
134 | | - sort-events: false |
135 | | - |
136 | | -perf-buffer-size: 1024 |
137 | | -pprof: false |
138 | | -pyroscope: false |
139 | | -rego: |
140 | | - partial-eval: true |
141 | | - aio: true |
142 | | -signatures-dir: "" |
143 | | -``` |
| 10 | + - __NOTE__: The YAML examples can be translated to JSON as well |
| 11 | + |
| 12 | +## Common configurations |
| 13 | + |
| 14 | +### Policy |
| 15 | + |
| 16 | +- **`--policy` (`-p`)**: Specifies a policy file or directory of policies that define what to trace. |
| 17 | + |
| 18 | + __NOTE__: You can view more in the [policy section](../../policies/index.md). |
| 19 | + |
| 20 | + YAML: |
| 21 | + ```yaml |
| 22 | + policy: |
| 23 | + - /path/to/policy.yaml |
| 24 | + ``` |
| 25 | +
|
| 26 | +
|
| 27 | +### Output |
| 28 | +
|
| 29 | +- **`--output` (`-o`)**: Controls how and where the output is printed. |
| 30 | + |
| 31 | + __NOTE__: You can view more in the [output section](../../outputs/index.md). |
| 32 | + |
| 33 | + YAML: |
| 34 | + ```yaml |
| 35 | + output: |
| 36 | + - json |
| 37 | + ``` |
| 38 | + |
| 39 | + |
| 40 | +### Server |
| 41 | + |
| 42 | + |
| 43 | +- **`--metrics-endpoint`**: Enables the metrics endpoint. |
| 44 | + |
| 45 | + __NOTE__: You can view more in the [Prometheus section](../prometheus.md). |
| 46 | + |
| 47 | + YAML: |
| 48 | + ```yaml |
| 49 | + metrics-endpoint: true |
| 50 | + ``` |
| 51 | + |
| 52 | +- **`--grpc-listen-addr`**: Specifies the address for the gRPC server. |
| 53 | + |
| 54 | + YAML: |
| 55 | + ```yaml |
| 56 | + grpc-listen-addr: tcp:50051 |
| 57 | + ``` |
| 58 | + |
| 59 | + |
| 60 | +### Process Tree |
| 61 | + |
| 62 | +- **`--proctree` (`-t`)**: Controls process tree options. |
| 63 | + |
| 64 | + |
| 65 | + __NOTE__: You can view more in the [Process Tree section](../../advanced/data-sources/builtin/process-tree.md). |
| 66 | + |
| 67 | + YAML: |
| 68 | + ```yaml |
| 69 | + proctree: |
| 70 | + - process |
| 71 | + ``` |
| 72 | + |
| 73 | +### Install Path |
| 74 | + |
| 75 | +- **`--install-path`**: Specifies the directory where Tracee will install or look for its resources. If not specified, the default installation directory is `/tmp/tracee`. |
| 76 | + |
| 77 | + YAML: |
| 78 | + ```yaml |
| 79 | + install-path: /opt/tracee |
| 80 | + ``` |
| 81 | + |
| 82 | + __NOTE__: This option is useful when running Tracee in environments where `/tmp` is not suitable or secure. |
| 83 | + |
| 84 | +### Log |
| 85 | + |
| 86 | +- **`--log` (`-l`)**: Controls the verbosity level of Tracee's logging system. The default log level is `info`. |
| 87 | + |
| 88 | + |
| 89 | + __NOTE__: You can view more in the [Tracee Logs section](../../outputs/logging.md). |
| 90 | + |
| 91 | + YAML: |
| 92 | + ```yaml |
| 93 | + log: |
| 94 | + - level: debug |
| 95 | + ``` |
| 96 | + |
| 97 | +### Container |
| 98 | + |
| 99 | +- **`--no-containers`**: Disables container information enrichment in events. |
| 100 | + |
| 101 | + YAML: |
| 102 | + ```yaml |
| 103 | + no-containers: true |
| 104 | + ``` |
| 105 | + |
| 106 | + __NOTE__: You can view more in the [cri section](../../flags/containers.1.md). |
| 107 | + |
| 108 | +- **`--cri`**: Defines connected container runtimes in the format `<runtime:socket>`. |
| 109 | + |
| 110 | + YAML: |
| 111 | + ```yaml |
| 112 | + cri: |
| 113 | + - docker:/var/run/docker.sock |
| 114 | + ``` |
| 115 | + |
| 116 | +### DNS Cache |
| 117 | + |
| 118 | +- **`--dnscache`**: Enables DNS caching in Tracee. |
| 119 | + |
| 120 | + __NOTE__: You can view more in the [DNS Cache section](../../advanced/data-sources/builtin/dns.md). |
| 121 | + |
| 122 | + YAML: |
| 123 | + ```yaml |
| 124 | + dnscache: enable |
| 125 | + ``` |
| 126 | + |
| 127 | +### Capabilities |
| 128 | + |
| 129 | +- **`--capabilities` (`-C`)**: Define specific capabilities for Tracee to run with. This allows you to either bypass, add, or drop certain capabilities based on your security and operational needs. |
| 130 | + |
| 131 | + |
| 132 | + __NOTE__: You can view more in the [Tracee Capabilities section](../../flags/capabilities.1.md) |
| 133 | + |
| 134 | + YAML: |
| 135 | + ```yaml |
| 136 | + capabilities: |
| 137 | + - add: |
| 138 | + - CAP_SYS_ADMIN |
| 139 | + - drop: |
| 140 | + - CAP_NET_RAW |
| 141 | + ``` |
| 142 | + |
| 143 | + __NOTE__: Capabilities are Linux-specific permissions that control which privileged operations a program can perform. |
| 144 | + |
| 145 | + |
| 146 | +### Capture |
| 147 | + |
| 148 | +- **`--capture` (`-c`)**: Captures artifacts such as files or network packets that are written or executed. |
| 149 | + |
| 150 | + |
| 151 | + __NOTE__: You can view more in the [Capture section](../../flags/capture.1.md). |
| 152 | + |
| 153 | + YAML: |
| 154 | + ```yaml |
| 155 | + capture: |
| 156 | + - write |
| 157 | + ``` |
| 158 | + |
| 159 | +### Buffer and Cache |
| 160 | + |
| 161 | +- **`--perf-buffer-size` (`-b`)**: Specifies the size of the internal perf ring buffer in pages. |
| 162 | + |
| 163 | + Default: `1024` (4 MB) |
| 164 | + |
| 165 | + YAML: |
| 166 | + ```yaml |
| 167 | + perf-buffer-size: 2048 |
| 168 | + ``` |
| 169 | + |
| 170 | +- **`--blob-perf-buffer-size`**: Specifies the size of the internal perf ring buffer used to send blobs from the kernel. |
| 171 | + |
| 172 | + Default: `1024` (4 MB) |
| 173 | + |
| 174 | + YAML: |
| 175 | + ```yaml |
| 176 | + blob-perf-buffer-size: 2048 |
| 177 | + ``` |
| 178 | + |
| 179 | +- **`--pipeline-channel-size`**: Specifies the size of each pipeline stage's output channel. |
| 180 | + |
| 181 | + Default: `10000` |
| 182 | + |
| 183 | + YAML: |
| 184 | + ```yaml |
| 185 | + pipeline-channel-size: 2048 |
| 186 | + ``` |
| 187 | + |
| 188 | +- **`--cache` (`-a`)**: Controls event caching options. |
| 189 | + |
| 190 | + YAML: |
| 191 | + ```yaml |
| 192 | + cache: |
| 193 | + - mem-cache-size=512 |
| 194 | + ``` |
0 commit comments