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: README.md
+42-1Lines changed: 42 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ See [atrium.yaml](https://github.com/nicolaspernoud/atrium/blob/main/backend/atr
19
19
20
20
The `hostname` configuration can be overridden with the environment variable `MAIN_HOSTNAME`.
21
21
22
-
## DNS
22
+
###DNS
23
23
24
24
Your DNS configuration should be as below :
25
25
|Domain|Type|Target|
@@ -28,6 +28,47 @@ Your DNS configuration should be as below :
28
28
|your.hostname|AAAA|Your machine IPv6|
29
29
|\*.your.hostname|CNAME|your.hostname|
30
30
31
+
### Fail2ban
32
+
33
+
To block IPs that are trying to access files without authorization, you can use the provided fail2ban configuration, which runs in a Docker container.
34
+
35
+
#### Prerequisites
36
+
37
+
- Docker and Docker Compose must be installed on your system.
38
+
39
+
#### Installation & Configuration
40
+
41
+
1.**Navigate to the fail2ban directory:**
42
+
43
+
```bash
44
+
cd scripts/fail2ban
45
+
```
46
+
47
+
2. **Verify Configuration:**
48
+
49
+
- **Container:** Open `docker-compose.yml`. Alter the timezone and ensure the host side of the log volume mount (`/remotelogs/atrium`) points to your actual atrium log directory.
50
+
```yaml
51
+
environment:
52
+
# ...
53
+
- TZ=Europe/Paris # <- Alter the timezone to match the one of the server
54
+
volumes:
55
+
# ...
56
+
- <path to atrium logs directory>:/remotelogs/atrium # <- Alter this path
57
+
```
58
+
- **Ignore IPs:** To prevent being locked out, add your own IP addresses to the `ignoreip` list in`jail.local`.
59
+
```
60
+
ignoreip = 127.0.0.1/8 ::1 YOUR.IP.HERE
61
+
```
62
+
63
+
3. **Start the container:**
64
+
65
+
```bash
66
+
./up.sh
67
+
```
68
+
69
+
The fail2ban service will now monitor the atrium logs and automatically ban IPs that trigger the "FILE ACCESS DENIED" or the "AUTHENTICATION ERROR" rules.
70
+
The new logs won't be added automatically, so use the reload.sh script a a crontab to load new log files : `crontab -e` => `10 * * * * /services/fail2ban/reload.sh >/dev/null 2>&1`
71
+
31
72
## Development
32
73
33
74
### Update main from development and set development to follow main
0 commit comments