Skip to content

Commit a493b93

Browse files
committed
rework multiserver guide
1 parent 6c56b35 commit a493b93

File tree

1 file changed

+6
-53
lines changed

1 file changed

+6
-53
lines changed

crowdsec-docs/unversioned/user_guides/multiserver_setup.md

Lines changed: 6 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ Because a log processor can push arbitrary alerts to LAPI (and hence can easily
7373

7474
Finally, restart crowdsec to apply the changes.
7575

76+
Note that LAPI only receives the alerts and turn them into decisions, this means:
77+
- You do not have to install any parser or scenario on it, they must be installed on the log processors directly.
78+
- If you want to have custom decisions (custom duration for example), you need to modify the file `/etc/crowdsec/profiles.yaml` on the LAPI, not on the log processors.
79+
7680
### Log processors
7781

7882
Again, follow the [getting started guide](/docs/next/getting_started/install_crowdsec) to install Crowdsec.
@@ -141,7 +145,7 @@ Since crowdsec v1.6.4, multiple remediations components running on different mac
141145

142146
On installation, remediations components will try to automatically create an API key if they are installed on the same machine as LAPI, which likely won't be the case for a multi-server installation.
143147

144-
In this case, you will need to manually create an API key for you remediation component:
148+
In this case, you will need to manually create an API key for you remediation component by running this command on your LAPI instance:
145149

146150
```bash
147151
$ sudo cscli bouncers add MyBouncer
@@ -154,55 +158,4 @@ Please keep this key since you will not be able to retrieve it!
154158

155159
Next, update the remediation component configuration file with the API key that you created and the URL to LAPI.
156160

157-
Remediation components will generally store their configuration in `/etc/crowdsec/bouncers/`, and the configuration directives naming for the API key and URL might vary from one remediation component to the other, please refer to the specific documentation of the component you have installed.
158-
159-
160-
A typical multi server setup should thus have:
161-
162-
1. **Log processors push alerts to LAPI** :
163-
- The [local_api_credentials.yaml](/docs/configuration/crowdsec_configuration#client) should point to LAPI's Ip
164-
- The log processor should be registered to the local api
165-
166-
**Using login/password authentication**
167-
- By running `cscli machines add MyMachine` on the LAPI (and copy the generated credentials to the log processor configuration)
168-
- By running `cscli lapi register --machine MyMachine --url <lapi_url> --token <token>` on the log processor for automatic validation of the machine if configured
169-
- or by running `cscli lapi register --machine MyMachine --url http://<lapi>` on the log processor and accepting the machine from LAPI with `cscli machines validate MyMachine`
170-
171-
**Using client cert authentication**
172-
- By using setting the [client verification method](/docs/next/configuration/crowdsec_configuration#client_verification)
173-
- And setting the appropriate [allowed agents ou](/docs/next/configuration/crowdsec_configuration#agents_allowed_ou)
174-
175-
Once done, you can check that the log processor can communicate with LAPI :
176-
177-
```bash
178-
# cscli lapi status
179-
INFO[20-12-2021 01:31:33 PM] Loaded credentials from /etc/crowdsec/local_api_credentials.yaml
180-
INFO[20-12-2021 01:31:33 PM] Trying to authenticate with username xxxx on http://<LAPI IP>:8080/
181-
INFO[20-12-2021 01:31:33 PM] You can successfully interact with Local API (LAPI)
182-
183-
```
184-
185-
186-
:::info
187-
To avoid any confusion, disabling the LAPI service on the machine running the agent can be done by commenting out the api->server section in the `config.yaml` file
188-
:::
189-
190-
191-
192-
2. **Bouncers speaking to LAPI**
193-
- :warning: Most of the bouncers installers are going to assume that LAPI is running on the same machine
194-
- You need to modify the bouncer's configuration (in `/etc/crowdsec/bouncers/`) to be sure they speak to the LAPI:
195-
- Create an API key from LAPI with `cscli bouncers add MyBouncer`
196-
- Or again, rely on [client certificate authentication](/docs/next/configuration/crowdsec_configuration#bouncers_allowed_ou) for the bouncers that support it
197-
- Edit the bouncer's configuration file to be sure it points to the LAPI uri and uses the newly generated API key
198-
199-
200-
201-
## Things to keep in mind
202-
203-
- Parsers and Scenarios must be present on the agents. It's not useful to deploy them on LAPI
204-
- Decisions are made by LAPI. This is where you want to setup eventual custom profiles, and this is where you bouncers should point
205-
- You can use the [console](https://app.crowdsec.net), it supports multiserver setups!
206-
- If you have an important setup, switching LAPI backend from SQLite to MySQL/PgSQL is strongly advised
207-
208-
[This existing article](https://www.crowdsec.net/blog/multi-server-setup/) might as well be useful!
161+
Remediation components will generally store their configuration in `/etc/crowdsec/bouncers/`, and the configuration directives naming for the API key and URL might vary from one remediation component to the other, please refer to the specific documentation of the component you have installed.

0 commit comments

Comments
 (0)