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
custom_binary.sh del 192.168.1.1/32 3600 "test blacklist" <json_object>
206
211
```
207
212
208
213
214
+
### Stdin mode
215
+
216
+
In this mode, the custom binary will be executed when the bouncer starts and is expected to read data from stdin.
217
+
218
+
If the binary exits for any reason, it will be reinvoked up to `max_retries` times. If the maximum number of retries is exhausted, the bouncer will quit.
219
+
220
+
For each decision, the custom binary will be fed the serialized JSON object on stdin, one object per line.
221
+
222
+
The JSON object is:
223
+
```json
224
+
{
225
+
"duration": "143h58m15s",
226
+
"origin": "CAPI",
227
+
"scenario": "ssh:bruteforce",
228
+
"scope": "Ip",
229
+
"type": "ban",
230
+
"value": "160.187.109.6",
231
+
"id": 83676344,
232
+
"action": "add"
233
+
}
234
+
```
235
+
236
+
-`duration`: duration of the decision, in the [go time.Duration format](https://pkg.go.dev/time#Duration). Can be negative for delete decisions.
237
+
-`origin`: origin the decision. Can be `crowdsec`, `cscli`, `cscli-import`, `CAPI`, `lists`.
238
+
-`scenario`: scenario that triggered the decision.
239
+
-`scope`: Scope of the decision. Most likely `Ip` or `Range` with the default config, but can be any value set in your scenarios.
240
+
-`type`: Type of the decision. Most likely `ban` or `captcha` with the default config, but can be any value set in your profiles.
241
+
-`value`: Target of the decision.
242
+
-`id`: id of the decision in the crowdsec database.
243
+
-`action`: Either `add` or `del`.
244
+
245
+
209
246
## Configuration Reference
210
247
211
248
### `bin_path`
@@ -216,7 +253,9 @@ Absolute path to the binary that will be invoked
216
253
### `bin_args`
217
254
> []string
218
255
219
-
Array of argument to give to the script that will be invoked
256
+
Array of argument to give to the script that will be invoked.
257
+
258
+
This option is only supported if `feed_via_stdin` is set to `true`.
0 commit comments