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: docs/configuration.md
+16-4Lines changed: 16 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,8 +13,10 @@ This file holds the core settings for Glutton. Key configuration options include
13
13
-**udp:** The UDP port for intercepted packets (default: `5001`).
14
14
-**ssh:** Typically excluded from redirection to avoid interfering with SSH (default: `22`).
15
15
-**interface:** The network interface Glutton listens on (default: `eth0`).
16
-
-**max_tcp_payload:** Maximum TCP payload size in bytes (default: `4096`).
17
-
-**conn_timeout:** The connection timeout duration in seconds (default: `45`).
16
+
-**conn_timeout:** Idle I/O timeout, in seconds, for established connections (default: `45`).
17
+
-**max_tcp_payload:** Maximum TCP payload size in bytes (default: `4096`). Proxy TCP uses this as the per-direction captured payload cap.
18
+
-**dial_timeout:** Timeout, in seconds, for opening outbound proxy TCP target connections (default: `5`).
19
+
-**capture_traffic.enabled:** Enables raw payload capture in logs and produced decoded events. When disabled, proxy TCP still forwards traffic and logs metadata, but raw payload bytes are omitted from decoded events.
18
20
-**confpath:** The directory path where the configuration file resides.
19
21
-**producers:**
20
22
-**enabled**: Boolean flag to enable or disable logging/producer functionality.
@@ -55,6 +57,10 @@ producers:
55
57
56
58
conn_timeout: 45
57
59
max_tcp_payload: 4096
60
+
dial_timeout: 5
61
+
62
+
capture_traffic:
63
+
enabled: false
58
64
```
59
65
60
66
### config/rules.yaml
@@ -63,8 +69,8 @@ This file defines the rules that Glutton uses to determine which protocol handle
63
69
64
70
Key elements include:
65
71
66
-
- **type**: `conn_handler` to pass off to the appropriate protocol handler or `drop` to ignore packets.
67
-
- **target**: Indicates the protocol handler (e.g., "http", "ftp") to be used.
72
+
- **type**: `conn_handler` to pass off to the appropriate protocol handler, `proxy_tcp` to forward the TCP connection to an upstream target, or `drop` to ignore packets.
73
+
- **target**: For `conn_handler`, indicates the protocol handler (e.g., `http`, `ftp`) to use. For `proxy_tcp`, this must be the upstream target in `host:port` form.
68
74
- **match**: Define criteria such as source IP ranges or destination ports to match incoming traffic, according to [BPF syntax](https://biot.com/capstats/bpf.html).
69
75
70
76
Example rule:
@@ -80,8 +86,14 @@ rules:
80
86
- match: tcp dst port 6969
81
87
type: drop # drops any matching packets
82
88
target: bittorrent
89
+
- name: Proxy TCP example
90
+
match: tcp dst port 9889
91
+
type: proxy_tcp
92
+
target: 127.0.0.1:9889
83
93
```
84
94
95
+
`proxy_tcp`dials the configured `target` and forwards bytes in both directions between the incoming connection and the upstream service. Produced decoded events use the `proxy_tcp` protocol name and can include one captured payload entry per direction. Captured payloads are capped by `max_tcp_payload`; when a direction transfers more bytes than the cap, the decoded event is marked as truncated.
96
+
85
97
## Configuration Loading Process
86
98
Glutton uses the [Viper](https://github.com/spf13/viper) library to load configuration settings. The process works as follows:
0 commit comments