Härtung: Backup vollständig, Caddy-Konfiguration, POST statt GET
All checks were successful
CI / PHP Lint (pull_request) Successful in 35s
CI / PHP Lint-1 (pull_request) Successful in 34s
CI / Unit Tests & Static Analysis (pull_request) Successful in 38s
CI / PHP Lint (push) Successful in 34s
CI / PHP Lint-1 (push) Successful in 32s
CI / Unit Tests & Static Analysis (push) Successful in 36s
All checks were successful
CI / PHP Lint (pull_request) Successful in 35s
CI / PHP Lint-1 (pull_request) Successful in 34s
CI / Unit Tests & Static Analysis (pull_request) Successful in 38s
CI / PHP Lint (push) Successful in 34s
CI / PHP Lint-1 (push) Successful in 32s
CI / Unit Tests & Static Analysis (push) Successful in 36s
Backup (das war eine echte Lücke): admin/backup.php sicherte nur Einstellungen, Sites und Profile – die Display-Seiten fehlten. Nach einem Restore wären alle Kiosk-Links weg gewesen und aufgehängte QR-Codes hätten ins Leere gezeigt. Sie werden jetzt mitgesichert, inklusive Token, damit vorhandene Aufkleber weiter funktionieren; Site und Profil werden über den Namen verknüpft, weil die IDs auf der Zielinstallation andere sind. Caddy: die mitgelieferte .htaccess wird von Caddy nicht gelesen – damit griffen weder die Sicherheits-Header noch die Sperre, die PHP unterhalb von uploads/ verbietet. docs/Caddyfile.example enthält beides, die README verweist darauf. Verändernde Aktionen laufen jetzt über POST statt über Links mit CSRF-Token in der URL (Sites, Benutzer, Profile, API-Schlüssel, Display- Seiten). Token in URLs landen in Server-Logs, Referer-Headern und der Browser-Chronik. Neuer Helfer Ui::actionForm() hält das Markup kurz. Entfernt: login_simple.php und m365_debug.php. login_simple.php war eine zweite Login-Implementierung, die den Rückgabewert von Auth::login() als Boolean behandelte – 'totp_required' und 'rate_limited' sind truthy, also wurde auf index.php weitergeleitet, ohne dass eine Sitzung bestand. Kein Bypass (setUserSession lief nicht), aber genau die Art Altlast, aus der später einer wird. Database::getInstance() bricht nicht mehr mit die() samt PDO-Meldung ab (die Host und Datenbanknamen enthält), sondern zeigt im Web eine schlichte 503-Seite und wirft auf der Kommandozeile weiter. Neu: Warnung im Tab "Integration & Wartung", wenn eine Anfrage über einen Proxy kam, aber kein vertrauenswürdiger Proxy eingetragen ist – dann sehen Rate-Limit und Audit-Log für alle Gäste dieselbe IP. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
3a09e35097
commit
f26684b128
27 changed files with 381 additions and 423 deletions
|
|
@ -77,6 +77,12 @@ $oidcScopes = $db->getSetting('oidc_scopes', 'openid profile email');
|
|||
$oidcSecretSet = $db->getSetting('oidc_client_secret', '') !== '';
|
||||
$dailyLimit = (int)$db->getSetting('user_daily_voucher_limit', 0);
|
||||
$trustedProxy = $db->getSetting('trusted_proxy', '');
|
||||
|
||||
// Hinweis, wenn die Anfrage offensichtlich über einen Proxy kam, aber keiner
|
||||
// eingetragen ist: dann zählt das Rate-Limit alle Gäste als eine Adresse.
|
||||
$remoteAddr = (string)($_SERVER['REMOTE_ADDR'] ?? '');
|
||||
$proxyWarning = trim($trustedProxy) === ''
|
||||
&& (!empty($_SERVER['HTTP_X_FORWARDED_FOR']) || !empty($_SERVER['HTTP_X_REAL_IP']));
|
||||
$webhookEnabled = $db->getSetting('webhook_enabled', '0') === '1';
|
||||
$webhookUrl = $db->getSetting('webhook_url', '');
|
||||
$cleanupExpired = (int)$db->getSetting('cleanup_expired_days', 0);
|
||||
|
|
@ -134,6 +140,15 @@ $adminBase = '';
|
|||
<h2><?= __('int_proxy') ?></h2>
|
||||
<p class="muted"><?= __('int_proxy_hint') ?> <code>X-Forwarded-For</code> <?= __('int_proxy_hint2') ?></p>
|
||||
<input class="input" type="text" name="trusted_proxy" value="<?= htmlspecialchars($trustedProxy) ?>" placeholder="z.B. 10.0.0.1, 172.18.0.1">
|
||||
<?php if ($proxyWarning): ?>
|
||||
<div class="alert alert-warning" style="margin-top:12px;">
|
||||
<i class="fas fa-triangle-exclamation" aria-hidden="true"></i>
|
||||
<span>
|
||||
<?= str_replace('{ip}', htmlspecialchars($remoteAddr), __('int_proxy_warning')) ?><br>
|
||||
<?= __('int_proxy_suggestion') ?> <code><?= htmlspecialchars($remoteAddr) ?></code>
|
||||
</span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue