-
-
Notifications
You must be signed in to change notification settings - Fork 173
Refactor and improve security headers, file blocks, etc #631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release/bugfixes-and-dependency-updates
Are you sure you want to change the base?
Refactor and improve security headers, file blocks, etc #631
Conversation
|
Thanks for the PR! I will review soon 👍 |
|
Great PR, running into this issue right now. However, I'd add some more common endpoints for web apps, at least |
d7aed51 to
00df1ca
Compare
@wapacro Thank you for your feedback. I've added your endpoints in this PR. |
|
@jaydrogers Any estimation when this can be reviewed and merged on your side? |
|
Could we also include support for |
…plementing best practices for HTTP headers and file access restrictions. Added protections against clickjacking, MIME type sniffing, and sensitive file exposure while allowing necessary access to well-known URIs as per RFC 8615.
|
@marns93 I appreciate your efforts on this. I had a chance to take a look at your PR. Instead of blocking everything from I also standardized these rules across all 3 web server variations. I am keeping an updated summary here: #631 (comment) |
Important
This PR was co-authored by @jaydrogers and had it's original comment modified to provide the latest summary. View the original post by @marns93 below if you'd like to see the content of the original submission
Testing this PR
You can test this PR by using any tag with this prefix:
docker.io/serversideup/php-dev:631-*View related images →
Summary
This PR standardizes and improves security configurations across nginx, Apache, and FrankenPHP/Caddy variations to ensure consistent behavior and proper documentation with references to authoritative sources.
Authoritative Sources Referenced
All configurations now cite their sources for transparency and credibility:
Security Headers (Consistent Across All Variations)
X-Frame-OptionsSAMEORIGINX-Content-Type-OptionsnosniffReferrer-Policystrict-origin-when-cross-originStrict-Transport-Securitymax-age=31536000; includeSubDomainsBlocked File Extensions
Based on H5BP server configs with a conservative approach to avoid breaking legitimate use cases:
.bak.conf.config.dist.inc.ini.log.sh.sql.swp/.swo~#*#*/.*✅ Explicitly Allowed
/.well-known/*- Required by RFC 8615 for ACME challenges other standardized endpoints❌ Intentionally NOT Blocked (too aggressive for general use)
.zip,.tar,.tgz- Legitimate downloads.yml,.json- Could be API responses.psd,.fla- Low security riskKey Changes from Previous Configuration
.well-knownexception - Properly allows RFC 8615 endpoints (fixes FrankenPHP returns 403 for commonly used hidden folders like .well-known/ #626).confblocking - More relevant for Linux/PHP environments than.configalone.fla,.psd,.orig,.inci,.swopremoved (not in official H5BP or too aggressive)Referrer-Policy- Changed tostrict-origin-when-cross-originacross all variationsTesting Checklist
/.well-known/paths are accessible (ACME, security.txt, etc.).zipdownloads (should work)Original post by @marns93