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/USER_GUIDE.md
+63-9
Original file line number
Diff line number
Diff line change
@@ -119,82 +119,136 @@ Here is the list of available settings:
119
119
120
120
##### LAPI Connection
121
121
122
-
-`api_key`: Key generated by the cscli (CrowdSec cli) command like `cscli bouncers add bouncer-php-library`
122
+
-`auth_type`: Select from `api_key` and `tls`. Choose if you want to use an API-KEY or a TLS (pki) authentification.
123
+
TLS authentication is only available if you use CrowdSec agent with a version superior to 1.4.0.
124
+
125
+
126
+
-`api_key`: Key generated by the cscli (CrowdSec cli) command like `cscli bouncers add bouncer-php-library`.
127
+
Only required if you choose `api_key` as `auth_type`.
128
+
129
+
130
+
-`tls_cert_path`: absolute path to the bouncer certificate (e.g. pem file).
131
+
Only required if you choose `tls` as `auth_type`.
132
+
133
+
134
+
-`tls_key_path`: Absolute path to the bouncer key (e.g. pem file).
135
+
Only required if you choose `tls` as `auth_type`.
136
+
137
+
138
+
-`tls_verify_peer`: This option determines whether request handler verifies the authenticity of the peer's certificate.
139
+
Only required if you choose `tls` as `auth_type`.
140
+
When negotiating a TLS or SSL connection, the server sends a certificate indicating its identity.
141
+
If `tls_verify_peer` is set to true, request handler verifies whether the certificate is authentic.
142
+
This trust is based on a chain of digital signatures,
143
+
rooted in certification authority (CA) certificates you supply using the `tls_ca_cert_path` setting below.
144
+
145
+
146
+
-`tls_ca_cert_path`: Absolute path to the CA used to process peer verification.
147
+
Only required if you choose `tls` as `auth_type` and `tls_verify_peer` is set to true.
148
+
123
149
124
150
-`api_url`: Define the URL to your LAPI server, default to `http://localhost:8080`.
125
151
152
+
126
153
-`api_timeout`: In seconds. The timeout when calling LAPI. Must be greater or equal than 1. Default to 1 sec.
127
154
155
+
128
156
-`use_curl`: By default, this lib call the REST LAPI using `file_get_contents` method (`allow_url_fopen` is required).
129
157
You can set `use_curl` to `true` in order to use `cURL` request instead (`curl` is in then required)
130
158
159
+
131
160
##### Debug
132
161
-`debug_mode`: `true` to enable verbose debug log. Default to `false`.
133
162
163
+
134
164
-`disable_prod_log`: `true` to disable prod log. Default to `false`.
135
165
136
-
-`log_directory_path`: Absolute path to store log files. Important note: be sur this path won't be publicly accessible
166
+
167
+
-`log_directory_path`: Absolute path to store log files. Important note: be sur this path won't be publicly
168
+
accessible.
169
+
137
170
138
171
-`display_errors`: true to stop the process and display errors on browser if any.
139
172
173
+
140
174
-`forced_test_ip`: Only for test or debug purpose. Default to empty. If not empty, it will be used instead of the
141
175
real remote ip.
142
176
177
+
143
178
-`forced_test_forwarded_ip`: Only for test or debug purpose. Default to empty. If not empty, it will be used
144
179
instead of the real forwarded ip. If set to `no_forward`, the x-forwarded-for mechanism will not be used at all.
145
180
146
181
##### Bouncer behavior
147
182
148
183
-`bouncing_level`: Select from `bouncing_disabled`, `normal_bouncing` or `flex_bouncing`. Choose if you want to apply CrowdSec directives (Normal bouncing) or be more permissive (Flex bouncing). With the `Flex mode`, it is impossible to accidentally block access to your site to people who don’t deserve it. This mode makes it possible to never ban an IP but only to offer a Captcha, in the worst-case scenario.
149
184
185
+
150
186
-`fallback_remediation`: Select from `bypass` (minimum remediation), `captcha` or `ban` (maximum remediation). Default to 'captcha'. Handle unknown remediations as.
151
187
188
+
152
189
-`max_remediation_level`: Select from `bypass`,`captcha` or `ban`. Default to 'ban'. Cap the
153
190
remediation to the selected one.
154
191
192
+
155
193
-`trust_ip_forward_array`: If you use a CDN, a reverse proxy or a load balancer, set an array of IPs. For other IPs, the bouncer will not trust the X-Forwarded-For header.
156
194
157
-
-`excluded_uris`: array of URIs that will not be bounced
195
+
196
+
-`excluded_uris`: array of URIs that will not be bounced.
158
197
159
198
##### Cache
160
199
161
200
-`cache_system`: Select from `phpfs` (File system cache), `redis` or `memcached`.
162
201
202
+
163
203
-`fs_cache_path`: Will be used only if you choose File system as cache_system. Important note: be sur this path
164
204
won't be publicly accessible.
165
205
166
-
-`redis_dsn`: Will be used only if you choose Redis cache as cache_system
167
206
168
-
-`memcached_dsn`: Will be used only if you choose Memcached as cache_system
207
+
-`redis_dsn`: Will be used only if you choose Redis cache as cache_system.
208
+
209
+
210
+
-`memcached_dsn`: Will be used only if you choose Memcached as cache_system.
211
+
169
212
170
213
-`clean_ip_cache_duration`: Set the duration we keep in cache the fact that an IP is clean. In seconds. Defaults to 5.
171
214
215
+
172
216
-`bad_ip_cache_duration`: Set the duration we keep in cache the fact that an IP is bad. In seconds. Defaults to 20.
173
217
218
+
174
219
-`captcha_cache_duration`: Set the duration we keep in cache the captcha flow variables for an IP. In seconds.
175
220
Defaults to 86400.. In seconds. Defaults to 20.
176
221
222
+
177
223
-`geolocation_cache_duration`: Set the duration we keep in cache a geolocation result for an IP . In seconds.
178
224
Defaults to 86400. Depends on the below `geolocation[save_result]` configuration.
179
225
226
+
180
227
-`stream_mode`: true to enable stream mode, false to enable the live mode. Default to false. By default, the `live mode` is enabled. The first time a stranger connects to your website, this mode means that the IP will be checked directly by the CrowdSec API. The rest of your user’s browsing will be even more transparent thanks to the fully customizable cache system. But you can also activate the `stream mode`. This mode allows you to constantly feed the bouncer with the malicious IP list via a background task (CRON), making it to be even faster when checking the IP of your visitors. Besides, if your site has a lot of unique visitors at the same time, this will not influence the traffic to the API of your CrowdSec instance.
181
228
182
229
##### Geolocation
183
230
184
231
-`geolocation`: Settings for geolocation remediation (i.e. country based remediation).
232
+
185
233
-`geolocation[enabled]`: true to enable remediation based on country. Default to false.
186
-
-`geolocation[type]`: Geolocation system. Only 'maxmind' is available for the moment. Default to `maxmind`
234
+
235
+
-`geolocation[type]`: Geolocation system. Only 'maxmind' is available for the moment. Default to `maxmind`.
236
+
187
237
188
238
-`geolocation[save_result]`: true to store the geolocalized country in cache. Default to true. Setting true
189
-
will avoid multiple call to the geolocalized system (e.g. maxmind database)
190
-
-`geolocation[maxmind]`: MaxMind settings
239
+
will avoid multiple call to the geolocalized system (e.g. maxmind database).
240
+
241
+
-`geolocation[maxmind]`: MaxMind settings.
242
+
191
243
-`geolocation[maxmind][database_type]`: Select from `country` or `city`. Default to `country`. These are the two available MaxMind database types.
192
-
-`geolocation[maxmind][database_path]`: Absolute path to the MaxMind database (mmdb
244
+
245
+
-`geolocation[maxmind][database_path]`: Absolute path to the MaxMind database (e.g. mmdb file)
193
246
194
247
195
248
##### Captcha and ban wall settings
196
249
197
250
-`hide_mentions`: true to hide CrowdSec mentions on ban and captcha walls.
0 commit comments