Upload via GUI (5 Dateien)
This commit is contained in:
@@ -0,0 +1,192 @@
|
|||||||
|
# BackendJoinGuard
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
BackendJoinGuard blockiert direkte Joins auf Backend-Servern und erlaubt nur Verbindungen vom Proxy.
|
||||||
|
|
||||||
|
Wichtig:
|
||||||
|
- Dieses Plugin kommt auf jeden Backend-Server.
|
||||||
|
- Es kommt nicht auf den Proxy.
|
||||||
|
- Es kann komplett eigenständig genutzt werden.
|
||||||
|
- Optional kann es seine Regeln zentral von StatusAPI beziehen.
|
||||||
|
|
||||||
|
## Zweck
|
||||||
|
|
||||||
|
BackendJoinGuard verhindert, dass Spieler einen Unterserver direkt betreten und damit den Proxy-Schutz umgehen.
|
||||||
|
|
||||||
|
Das Plugin prüft beim Login die Quell-IP des Spielers.
|
||||||
|
Nur erlaubte Proxy-IPs oder CIDR-Netze dürfen durchgelassen werden.
|
||||||
|
Alle anderen Verbindungen werden direkt vor dem Join geblockt.
|
||||||
|
|
||||||
|
## Betriebsarten
|
||||||
|
|
||||||
|
### Standalone
|
||||||
|
|
||||||
|
BackendJoinGuard nutzt nur seine eigene config.yml.
|
||||||
|
Das ist sinnvoll, wenn du keinen zentralen Sync willst oder das Plugin unabhängig von StatusAPI betreiben möchtest.
|
||||||
|
|
||||||
|
### StatusAPI Sync
|
||||||
|
|
||||||
|
BackendJoinGuard lädt seine Schutzregeln regelmäßig von StatusAPI.
|
||||||
|
Wenn der Sync ausfällt, bleiben die lokalen Werte aus der config.yml als Fallback erhalten.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
1. Die JAR in den plugins-Ordner jedes Backend-Servers kopieren.
|
||||||
|
2. Server starten, damit die config.yml erzeugt wird.
|
||||||
|
3. Konfiguration anpassen.
|
||||||
|
4. Server neu starten oder /backendguard reload ausführen.
|
||||||
|
|
||||||
|
## Konfiguration
|
||||||
|
|
||||||
|
Datei: config.yml
|
||||||
|
|
||||||
|
### Lokale Guard-Werte
|
||||||
|
|
||||||
|
- enforcement-enabled
|
||||||
|
Aktiviert oder deaktiviert den Direktjoin-Schutz.
|
||||||
|
|
||||||
|
- log-blocked-attempts
|
||||||
|
Loggt geblockte Direktjoin-Versuche in die Konsole.
|
||||||
|
|
||||||
|
- kick-message
|
||||||
|
Nachricht für geblockte Spieler.
|
||||||
|
|
||||||
|
- allowed-proxy-ips
|
||||||
|
Liste exakter Proxy-IPs.
|
||||||
|
|
||||||
|
- allowed-proxy-cidrs
|
||||||
|
Liste erlaubter Netze im CIDR-Format.
|
||||||
|
|
||||||
|
Beispiel:
|
||||||
|
|
||||||
|
```yml
|
||||||
|
enforcement-enabled: true
|
||||||
|
log-blocked-attempts: true
|
||||||
|
kick-message: "&cBitte verbinde dich nur ueber den Proxy-Server."
|
||||||
|
|
||||||
|
allowed-proxy-ips:
|
||||||
|
- "127.0.0.1"
|
||||||
|
- "::1"
|
||||||
|
- "185.123.45.67"
|
||||||
|
|
||||||
|
allowed-proxy-cidrs:
|
||||||
|
- "10.0.0.0/24"
|
||||||
|
```
|
||||||
|
|
||||||
|
### StatusAPI Sync
|
||||||
|
|
||||||
|
Konfigurationsblock:
|
||||||
|
|
||||||
|
```yml
|
||||||
|
statusapi-sync:
|
||||||
|
enabled: true
|
||||||
|
base-url: "http://127.0.0.1:9191"
|
||||||
|
endpoint-path: "/network/backendguard/config"
|
||||||
|
api-key: "DEIN_SYNC_KEY"
|
||||||
|
interval-seconds: 60
|
||||||
|
log-sync-errors: true
|
||||||
|
```
|
||||||
|
|
||||||
|
Bedeutung:
|
||||||
|
|
||||||
|
- enabled
|
||||||
|
Aktiviert den zentralen Abruf über StatusAPI.
|
||||||
|
|
||||||
|
- base-url
|
||||||
|
Basis-URL deiner StatusAPI auf dem Proxy.
|
||||||
|
|
||||||
|
- endpoint-path
|
||||||
|
Standard-Endpunkt für den Guard-Sync.
|
||||||
|
|
||||||
|
- api-key
|
||||||
|
Optionaler Schutz für den Sync-Endpunkt.
|
||||||
|
Muss identisch zu backendguard.sync.api_key in StatusAPI sein.
|
||||||
|
|
||||||
|
- interval-seconds
|
||||||
|
Wie oft BackendJoinGuard die Regeln neu abruft.
|
||||||
|
|
||||||
|
- log-sync-errors
|
||||||
|
Loggt Sync-Probleme in die Backend-Konsole.
|
||||||
|
|
||||||
|
## Passende StatusAPI-Konfiguration
|
||||||
|
|
||||||
|
Wenn du den Sync-Modus nutzen willst, pflegst du die zentralen Werte in StatusAPI über network-guard.properties.
|
||||||
|
|
||||||
|
Relevante Schlüssel:
|
||||||
|
|
||||||
|
```properties
|
||||||
|
backendguard.enforcement_enabled=true
|
||||||
|
backendguard.log_blocked_attempts=true
|
||||||
|
backendguard.kick_message=&cBitte verbinde dich nur ueber den Proxy-Server.
|
||||||
|
backendguard.allowed_proxy_ips=127.0.0.1,::1,185.123.45.67
|
||||||
|
backendguard.allowed_proxy_cidrs=10.0.0.0/24
|
||||||
|
backendguard.sync.api_key=DEIN_SYNC_KEY
|
||||||
|
```
|
||||||
|
|
||||||
|
## Beispiele
|
||||||
|
|
||||||
|
### Alles auf einer Maschine
|
||||||
|
|
||||||
|
Nutze in der Regel:
|
||||||
|
|
||||||
|
- allowed-proxy-ips: 127.0.0.1, ::1
|
||||||
|
- base-url: http://127.0.0.1:9191
|
||||||
|
|
||||||
|
### Proxy auf einem anderen Host
|
||||||
|
|
||||||
|
Nutze die echte Proxy-IP:
|
||||||
|
|
||||||
|
- allowed-proxy-ips: 185.123.45.67
|
||||||
|
- base-url: http://185.123.45.67:9191
|
||||||
|
|
||||||
|
### Internes Netzwerk
|
||||||
|
|
||||||
|
Nutze interne IP oder CIDR:
|
||||||
|
|
||||||
|
- allowed-proxy-ips: 10.0.0.10
|
||||||
|
- allowed-proxy-cidrs: 10.0.0.0/24
|
||||||
|
- base-url: http://10.0.0.10:9191
|
||||||
|
|
||||||
|
## Befehl
|
||||||
|
|
||||||
|
| Command | Beschreibung |
|
||||||
|
|---|---|
|
||||||
|
| /backendguard reload | Lädt die Config neu und startet bei aktivem Sync sofort einen neuen Abruf |
|
||||||
|
|
||||||
|
## Permission
|
||||||
|
|
||||||
|
| Permission | Beschreibung |
|
||||||
|
|---|---|
|
||||||
|
| backendguard.admin | Darf BackendJoinGuard verwalten |
|
||||||
|
|
||||||
|
## Funktionsweise
|
||||||
|
|
||||||
|
BackendJoinGuard prüft beim PreLogin die IP-Adresse des Clients.
|
||||||
|
|
||||||
|
- Erlaubte Proxy-IP: Join erlaubt
|
||||||
|
- Erlaubtes CIDR-Netz: Join erlaubt
|
||||||
|
- Alles andere: Join wird direkt geblockt
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
### Spieler werden trotz Proxy geblockt
|
||||||
|
|
||||||
|
- Prüfe, ob wirklich die Proxy-IP in allowed-proxy-ips eingetragen ist.
|
||||||
|
- Prüfe bei mehreren Netzsegmenten, ob ein CIDR-Eintrag sinnvoller ist.
|
||||||
|
- Prüfe, ob Velocity/Bungee korrekt als vorgeschalteter Proxy arbeitet.
|
||||||
|
|
||||||
|
### Sync mit StatusAPI funktioniert nicht
|
||||||
|
|
||||||
|
- Prüfe base-url.
|
||||||
|
- Prüfe, ob StatusAPI auf dem konfigurierten Port erreichbar ist.
|
||||||
|
- Prüfe, ob api-key identisch zu backendguard.sync.api_key ist.
|
||||||
|
- Prüfe die Backend-Konsole bei aktiviertem log-sync-errors.
|
||||||
|
|
||||||
|
### Standalone oder Sync?
|
||||||
|
|
||||||
|
- Wenn du maximale Einfachheit willst: Standalone.
|
||||||
|
- Wenn du zentrale Verwaltung willst: StatusAPI Sync.
|
||||||
|
- Wenn StatusAPI ausfällt, bleiben im Sync-Modus die lokalen Werte als Absicherung bestehen.
|
||||||
+46
-46
@@ -1,46 +1,46 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<groupId>net.viper.backend</groupId>
|
<groupId>net.viper.backend</groupId>
|
||||||
<artifactId>backend-join-guard</artifactId>
|
<artifactId>backend-join-guard</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>BackendJoinGuard</name>
|
<name>BackendJoinGuard</name>
|
||||||
<description>Blocks direct joins to backend servers and only allows proxy IPs.</description>
|
<description>Blocks direct joins to backend servers and only allows proxy IPs.</description>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<id>papermc</id>
|
<id>papermc</id>
|
||||||
<url>https://repo.papermc.io/repository/maven-public/</url>
|
<url>https://repo.papermc.io/repository/maven-public/</url>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.papermc.paper</groupId>
|
<groupId>io.papermc.paper</groupId>
|
||||||
<artifactId>paper-api</artifactId>
|
<artifactId>paper-api</artifactId>
|
||||||
<version>1.20.6-R0.1-SNAPSHOT</version>
|
<version>1.20.6-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<finalName>BackendJoinGuard</finalName>
|
<finalName>BackendJoinGuard</finalName>
|
||||||
<resources>
|
<resources>
|
||||||
<resource>
|
<resource>
|
||||||
<directory>src/main/resources</directory>
|
<directory>src/main/resources</directory>
|
||||||
<filtering>false</filtering>
|
<filtering>false</filtering>
|
||||||
</resource>
|
</resource>
|
||||||
</resources>
|
</resources>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
+515
-509
File diff suppressed because it is too large
Load Diff
@@ -1,29 +1,29 @@
|
|||||||
# BackendJoinGuard
|
# BackendJoinGuard
|
||||||
# Dieses Plugin kommt auf JEDEN Unterserver (Paper/Spigot), nicht auf den Proxy.
|
# Dieses Plugin kommt auf JEDEN Unterserver (Paper/Spigot), nicht auf den Proxy.
|
||||||
# Nur Verbindungen von diesen Proxy-IPs oder Netzbereichen duerfen joinen.
|
# Nur Verbindungen von diesen Proxy-IPs oder Netzbereichen duerfen joinen.
|
||||||
|
|
||||||
enforcement-enabled: true
|
enforcement-enabled: true
|
||||||
log-blocked-attempts: true
|
log-blocked-attempts: true
|
||||||
kick-message: "&cBitte verbinde dich nur ueber den Proxy-Server. Direkte Unterserver-Joins sind blockiert."
|
kick-message: "&cBitte verbinde dich nur ueber den Proxy-Server. Direkte Unterserver-Joins sind blockiert."
|
||||||
|
|
||||||
# Exakte Proxy-IPs
|
# Exakte Proxy-IPs
|
||||||
allowed-proxy-ips:
|
allowed-proxy-ips:
|
||||||
- "127.0.0.1"
|
- "127.0.0.1"
|
||||||
- "::1"
|
- "::1"
|
||||||
|
|
||||||
# Optional ganze Netze im CIDR-Format
|
# Optional ganze Netze im CIDR-Format
|
||||||
allowed-proxy-cidrs: []
|
allowed-proxy-cidrs: []
|
||||||
# Beispiel:
|
# Beispiel:
|
||||||
# allowed-proxy-cidrs:
|
# allowed-proxy-cidrs:
|
||||||
# - "10.0.0.0/24"
|
# - "10.0.0.0/24"
|
||||||
# - "192.168.178.10/32"
|
# - "192.168.178.10/32"
|
||||||
|
|
||||||
# Optional: zentrale Steuerung ueber StatusAPI
|
# Optional: zentrale Steuerung ueber StatusAPI
|
||||||
# Standard bleibt Standalone (enabled=false), damit BackendJoinGuard auch ohne StatusAPI nutzbar ist.
|
# Standard bleibt Standalone (enabled=false), damit BackendJoinGuard auch ohne StatusAPI nutzbar ist.
|
||||||
statusapi-sync:
|
statusapi-sync:
|
||||||
enabled: true
|
enabled: true
|
||||||
base-url: "http://127.0.0.1:9191"
|
base-url: "http://127.0.0.1:9191"
|
||||||
endpoint-path: "/network/backendguard/config"
|
endpoint-path: "/network/backendguard/config"
|
||||||
api-key: "bgSync_7Rk9pQ2nLm5xV8cH4tW1yZ6"
|
api-key: "bgSync_7Rk9pQ2nLm5xV8cH4tW1yZ6"
|
||||||
interval-seconds: 60
|
interval-seconds: 60
|
||||||
log-sync-errors: true
|
log-sync-errors: true
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
name: BackendJoinGuard
|
name: BackendJoinGuard
|
||||||
main: net.viper.backendguard.BackendJoinGuardPlugin
|
main: net.viper.backendguard.BackendJoinGuardPlugin
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
author: M_Viper
|
author: M_Viper
|
||||||
description: Blockiert direkte Joins auf Backendserver und erlaubt nur Proxy-IPs.
|
description: Blockiert direkte Joins auf Backendserver und erlaubt nur Proxy-IPs.
|
||||||
api-version: '1.20'
|
api-version: '1.20'
|
||||||
commands:
|
commands:
|
||||||
backendguard:
|
backendguard:
|
||||||
description: BackendJoinGuard neu laden
|
description: BackendJoinGuard neu laden
|
||||||
usage: /backendguard reload
|
usage: /backendguard reload
|
||||||
permissions:
|
permissions:
|
||||||
backendguard.admin:
|
backendguard.admin:
|
||||||
description: Darf BackendJoinGuard verwalten
|
description: Darf BackendJoinGuard verwalten
|
||||||
default: op
|
default: op
|
||||||
|
|||||||
Reference in New Issue
Block a user