diff --git a/.env.example b/.env.example index 49be7c4..27913bd 100644 --- a/.env.example +++ b/.env.example @@ -55,3 +55,4 @@ AWS_SECRET_ACCESS_KEY=your_aws_secret_key_here # Other API Keys (optional) BW_CLIENTSECRET=your_bw_client_secret_here +SECURITY_CONTACT=security@stargirlnails.de # E-Mail für Sicherheitsmeldungen diff --git a/README.md b/README.md index 7cddde8..0b1ca9c 100644 --- a/README.md +++ b/README.md @@ -187,6 +187,7 @@ docker run -d \ - ⏰ **Stornierungsfrist**: Konfigurierbare Mindestfrist vor dem Termin (MIN_STORNO_TIMESPAN) - 📋 **Impressum/Datenschutz**: Rechtliche Seiten mit konfigurierbaren Daten - 🔐 **Admin-Panel**: Geschützter Bereich für Inhaber +- 🛡️ **Security.txt**: RFC 9116 konformer Endpoint für Sicherheitsmeldungen ## Admin-Zugang @@ -201,3 +202,24 @@ Nach dem Setup kannst du dich mit den in der `.env` konfigurierten Admin-Credent - Das Passwort wird als Base64-Hash in der `.env` Datei gespeichert - Verwende ein sicheres Passwort und generiere den entsprechenden Hash - Die `.env` Datei sollte niemals in das Repository committet werden + +### Security.txt Endpoint + +Die Anwendung bietet einen RFC 9116 konformen Security.txt Endpoint unter `/.well-known/security.txt`: + +- **Kontakt**: Konfigurierbar über `SECURITY_CONTACT` Umgebungsvariable +- **Ablauf**: Automatisch gesetzt auf Ende des aktuellen Jahres +- **Sprachen**: Deutsch und Englisch bevorzugt +- **Caching**: 24 Stunden Cache-Header für bessere Performance + +**Beispiel-Konfiguration:** +```env +SECURITY_CONTACT=security@stargirlnails.de +``` + +**Zugriff:** +```bash +curl https://your-domain.com/.well-known/security.txt +``` + +Dies ermöglicht Sicherheitsforschern, Sicherheitslücken verantwortungsvoll zu melden. diff --git a/src/server/index.ts b/src/server/index.ts index c24253e..8bf3e6d 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -28,6 +28,31 @@ app.get("/api/legal-config", async (c) => { } }); +// Security.txt endpoint (RFC 9116) +app.get("/.well-known/security.txt", (c) => { + const securityContact = process.env.SECURITY_CONTACT || "security@example.com"; + const securityText = `Contact: ${securityContact} +Expires: 2025-12-31T23:59:59.000Z +Preferred-Languages: de, en +Canonical: https://${process.env.DOMAIN || 'localhost:5173'}/.well-known/security.txt + +# Security Policy +# Please report security vulnerabilities responsibly by contacting us via email. +# We will respond to security reports within 48 hours. +# +# Scope: This security policy applies to the Stargirlnails booking system. +# +# Rewards: We appreciate security researchers who help us improve our security. +# While we don't have a formal bug bounty program, we may offer recognition +# for significant security improvements. +`; + + return c.text(securityText, 200, { + "Content-Type": "text/plain; charset=utf-8", + "Cache-Control": "public, max-age=86400", // Cache for 24 hours + }); +}); + app.route("/rpc", rpcApp); app.get("/*", clientEntry);