Skip to content

Commit 2722f54

Browse files
committed
improve english
1 parent a0f5034 commit 2722f54

1 file changed

Lines changed: 29 additions & 29 deletions

File tree

crowdsec-docs/unversioned/user_guides/log_centralization.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,35 @@ sidebar_position: 10
88

99
If you expose services on the internet from multiple servers, setting up crowdsec on all of them might make the overall setup more complex.
1010

11-
In order to keep things simpler, you can use a central server that will receive all your logs, and only run a single instance of crowdsec on this server
11+
To simplify things, you can use a central server to receive all your logs and only run a single instance of crowdsec on this server.
1212

13-
In this guide, our goal is to centralize 2 types of logs:
13+
In this guide, our goal is to centralize two types of logs:
1414
- Nginx logs
1515
- SSH auth logs
1616

17-
We'll configure nginx to directly forward the access logs to our central rsyslog server.<br/>
18-
For the auth logs, we'll configure a local rsyslog on each web server to forward them to our central server.
17+
We'll configure nginx to forward the access logs to our central rsyslog server.<br/>
18+
We'll configure a local rsyslog for the auth logs on each web server and forward them to our central server.
1919

20-
On the central server, a rsyslog server will receive those logs and write them to files.<br/>
21-
On this same server, the Security Engine will analyze those logs to detect malicious behaviors in them.<br/>
22-
Finally, we will have a Firewall Remediation Component running on each of our web server to block the malicious IPs.
20+
On the central server, a rsyslog server will receive those logs and write them into files.<br/>
21+
The Security Engine will analyze those logs on this same server to detect malicious behaviours.<br/>
22+
Finally, we will have a Firewall Remediation Component running on each web server to block the malicious IPs.
2323

2424

2525
Our infrastructure will look like this:
2626

2727
![target-infra](/img/user_guide_log_centralization.svg)
2828

2929
Before diving into the setup, a few key points:
30-
- If you have a firewall, you will need to allow communication on 514/UDP (syslog) and 8080/TCP (crowdsec LAPI) from the web servers to the central server
31-
- By default, rsyslog is a clear-text protocol. If you all the machines interact over LAN, this is probably not an issue, but they are communication over internet, you will probably want to setup TLS on the syslog server.
30+
- If you have a firewall, you will need to allow communication on 514/UDP (Syslog) and 8080/TCP (crowdsec LAPI) from the web servers to the central server
31+
- By default, rsyslog is a clear-text protocol. If all the machines interact over LAN, this is probably not an issue, but if they communicate over the internet, you will probably want to set up TLS on the syslog server.
3232

3333
## Rsyslog Server Setup
3434

3535
Let's start by setting up our central rsyslog.
3636

3737
If rsyslog is not installed, you can install it with `apt install rsyslog` (assuming a debian-like distribution).
3838

39-
First step is to configure rsyslog with an UDP listener and a template to write the received logs to disk.
39+
The first step is to configure rsyslog with a UDP listener and a template to write the received logs to disk.
4040

4141
Create the file `/etc/rsyslog.d/10_remote.conf` with the following content:
4242
```
@@ -48,32 +48,32 @@ input(type="imudp" port="514")
4848
template(name="NginxLogs" type="string" string="/var/log/remote-logs/nginx/%HOSTNAME%.log")
4949
template(name="AuthLogs" type="string" string="/var/log/remote-logs/auth/%HOSTNAME%.log")
5050
51-
# Both access logs and error logs will be written to the same file for simplicity
52-
# You can split them by using a custom program name on nginx side
51+
# Rsyslog will write both access logs and error logs to the same file
52+
# You can split them by using a custom program name on the nginx side
5353
if ($inputname == 'imudp' and $programname == 'nginx') then ?NginxLogs
5454
& stop
5555
5656
# Write SSH logs to auth.log
5757
if ($inputname == 'imudp' and $programname == 'sshd') then ?AuthLogs
5858
& stop
5959
60-
# Drop everything else, we are not interested in them
60+
# Drop everything else; we are not interested in them
6161
if ($inputname == 'imudp') then stop
6262
```
6363

64-
Then, we need to create the `/var/log/remote-logs/` directory in which the logs will be stored:
64+
Then, we need to create the `/var/log/remote-logs/` to store logs:
6565
```bash
6666
$ sudo mkdir /var/log/remote-logs/ && sudo chown syslog:syslog /var/log/remote-logs/
6767
```
6868

69-
You will also need to edit `/etc/rsyslog.conf` to make sure `$RepeatedMsgReduction` is set to `off` (some distributions set it to `on` by defautl, but this is rarely recommended, especially when consuming potentially a high volume of logs)
69+
You will also need to edit `/etc/rsyslog.conf` to make sure `$RepeatedMsgReduction` is set to `off` (some distributions set it to `on` by default, but this is rarely recommended, especially when consuming potentially a high volume of logs)
7070

7171
Finally, restart rsyslog to use the new configuration:
7272
```bash
7373
systemctl restart rsyslog
7474
```
7575

76-
We will also setup logrotate to avoid filling our disk with the logs. Create a file `/etc/logrotate.d/remote-logs` with the following content:
76+
We will also set up Logrotate to avoid filling our disk with the logs. Create a file `/etc/logrotate.d/remote-logs` with the following content:
7777
```
7878
/var/log/remote-logs/*/*.log {
7979
daily
@@ -89,7 +89,7 @@ We will also setup logrotate to avoid filling our disk with the logs. Create a f
8989
}
9090
```
9191

92-
This will keep 7 days of compressed logs.
92+
This configuration will keep 7 days of compressed logs.
9393

9494
## Rsyslog Client Setup
9595

@@ -101,7 +101,7 @@ access_log syslog:server=<central-server-ip>;
101101
error_log syslog:server=<central-server-ip>;
102102
```
103103

104-
As nginx supports multiple `access_log` and `error_log` directives, you can keep the existing directives to still have a local copy of the logs.
104+
As nginx supports multiple `access_log` and `error_log` directives, you can keep the existing directives to keep a local copy of the logs.
105105

106106
### Auth logs
107107

@@ -115,7 +115,7 @@ Restart the rsyslog client:
115115
$ systemctl restart rsyslog
116116
```
117117

118-
## Crowdsec Setup
118+
## CrowdSec Setup
119119

120120
### Central Server
121121

@@ -131,7 +131,7 @@ Next, we install crowdsec:
131131
$ sudo apt install crowdsec
132132
```
133133

134-
Crowdsec will automatically detect we are running on a linux server, and install the base linux collection.
134+
CrowdSec will automatically detect we are running on a Linux server and install the base Linux collection.
135135

136136
But because our logs are not in a standard location, we need to configure the acquisition to tell crowdsec where our logs are.
137137

@@ -143,15 +143,15 @@ labels:
143143
type: syslog
144144
```
145145

146-
We now need to do the same thing for the auth logs, create a file `/etc/crowdsec/acquis.d/ssh.yaml` with the following content:
146+
Repeat for auth logs, create a file `/etc/crowdsec/acquis.d/ssh.yaml` with the following content:
147147
```
148148
filenames:
149149
- /var/log/remote-logs/auth/*.log
150150
labels:
151151
type: syslog
152152
```
153153

154-
Note that we are setting the type label to `syslog`. This will instruct crowdsec to use the `syslog` parser to extract the actual type from the log itself.
154+
Note that we are setting the type label to `syslog`, instructing crowdsec to use the `syslog` parser to extract the actual type from the log itself.
155155

156156
Then, we need to install the nginx collection for crowdsec to be able to detect attacks:
157157
```bash
@@ -173,11 +173,11 @@ $ sudo systemctl restart crowdsec
173173

174174
### Remediation components setup
175175

176-
Crowdsec by itself will only detect bad behaviors and take decisions against IPs, but will not block them.
176+
CrowdSec, by itself, will only detect bad behaviors and make decisions about IPs; it will not block them.
177177

178-
In order to block an IP, you need to install a [remediation component](/unversioned/bouncers/intro.md).
178+
To block an IP, you need to install a [remediation component](/unversioned/bouncers/intro.md).
179179

180-
For the purpose of this guide, we'll be using the [firewall remediation component](/unversioned/bouncers/firewall.mdx) that will add local firewall rules to block malicious IPs.
180+
For this guide, we'll be using the [firewall remediation component](/unversioned/bouncers/firewall.mdx) that will add local firewall rules to block malicious IPs.
181181

182182
On your web servers, add the crowdsec repository:
183183
```bash
@@ -222,13 +222,13 @@ $ sudo systemctl restart crowdsec-firewall-bouncer
222222

223223
Now that everything is setup, it's time to test !
224224

225-
We'll scan one of our web servers, and because both of them are querying the same crowdsec instance, if one of them is attacked, the attacker will also be blocked on the other.
225+
We'll scan one of our web servers, and because both of them are querying the same crowdsec instance if one detects the attack, the other server will also block the attacker.
226226

227227
```bash
228228
$ nikto -h 52.50.157.217
229229
```
230230

231-
After the scan is done, try to access the 2 servers with curl:
231+
After the scan is done, try to access the two servers with curl:
232232

233233
```bash
234234
$ curl --connect-timeout 2 52.50.157.217
@@ -237,7 +237,7 @@ $ curl --connect-timeout 2 3.254.76.247
237237
curl: (28) Connection timed out after 2002 milliseconds
238238
```
239239

240-
You can also check on the central server that everything is working properly:
240+
You can also check on the central server that everything is working correctly:
241241

242242
```bash
243243
$ sudo cscli metrics
@@ -265,4 +265,4 @@ $ sudo cscli decisions list
265265
╰───────┴──────────┴──────────────────┴──────────────────────────────────────┴────────┴─────────┴────────────────┴────────┴────────────┴──────────╯
266266
```
267267

268-
You can delete the decision with `cscli decision delete` to gain back access to the web servers.
268+
You can delete the decision with `cscli decision delete` to regain access to the web servers.

0 commit comments

Comments
 (0)