Files
Toiminnanohjaus/.htaccess
petriandClaude Opus 5.5 1acdaa5b19 Harden the app: block project files, add rate limits and security headers
- Root .htaccess refuses everything outside public/, because local Apache
  serves the whole project folder (.env, logs with set-password links, .git).
- Login allows 20 failed attempts a minute per IP across accounts, besides
  5 per email and IP; the forgot-password page 5 requests a minute per IP.
- A global middleware sends X-Frame-Options, frame-ancestors, nosniff,
  Referrer-Policy, Permissions-Policy and HSTS over HTTPS, and drops
  X-Powered-By.
- The weekly time sheet locks the shown week and selected day, so the
  browser cannot set them.
- Users who may not see personal identity codes can save a new code at
  most 10 times an hour, so the duplicate check cannot be used to test codes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 06:25:26 +02:00

20 lines
624 B
ApacheConf

# Local XAMPP serves the whole project folder (DocumentRoot is htdocs), so
# only public/ may be reached: .env, storage/logs, .git, vendor and the rest
# are refused. In production the web server's document root is public/.
<IfModule mod_rewrite.c>
Options -Indexes
RewriteEngine On
# The project folder itself goes to the application.
RewriteRule ^$ public/ [R=302,L]
# Everything outside public/ is forbidden.
RewriteRule !^public(/|$) - [F,L]
</IfModule>
# Without mod_rewrite nothing outside public/ can be told apart: refuse all.
<IfModule !mod_rewrite.c>
Require all denied
</IfModule>