-
Notifications
You must be signed in to change notification settings - Fork 7
Add Coraza WAF to Caddy for Enhanced Security #2538
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: main
Are you sure you want to change the base?
Conversation
Co-authored-by: DerekRoberts <[email protected]>
Co-authored-by: DerekRoberts <[email protected]>
Co-authored-by: DerekRoberts <[email protected]>
Co-authored-by: DerekRoberts <[email protected]>
Co-authored-by: DerekRoberts <[email protected]>
Co-authored-by: DerekRoberts <[email protected]>
Co-authored-by: DerekRoberts <[email protected]>
…nsitive path protection Co-authored-by: DerekRoberts <[email protected]>
frontend/coraza.conf
Outdated
|
|
||
| # Null byte injection | ||
| SecRule REQUEST_URI|ARGS|REQUEST_HEADERS "@rx \x00" \ | ||
| "id:1008,phase:2,block,log,msg:'Null Byte Injection Detected',status:403" No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Please make sure all files have the correct line endings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in f0dee6f. Added final newline to coraza.conf to comply with .editorconfig (insert_final_newline = true). All files now use LF line endings with proper final newlines.
Co-authored-by: DerekRoberts <[email protected]>
Description
Integrates Coraza WAF v2 with Caddy server to provide application-layer security against common web attacks.
Fixes #1724
Type of change
Changes
Multi-stage Docker build (
frontend/Dockerfile)xcaddywithgithub.com/corazawaf/coraza-caddy/v2/tmp/coraza/) with 700 permissionsWAF configuration (
frontend/coraza.conf)sp_,xp_,exec)%252e%252e) and mixed-case variants.env,.git,.ssh,.aws,.htaccess,.htpasswd,web.config,admin,config,backup,tmp,logs,wp-admin.editorconfigstandardsCaddyfile integration (
frontend/Caddyfile)Documentation (
README.md)How Has This Been Tested?
WAF functionality will be validated through existing CI/CD pipeline:
Checklist
Further comments
Security rules use defense-in-depth approach:
Regex patterns optimized with lazy matching (
.*?) and word boundaries (\b) to balance security effectiveness with performance and false positive rates.All files follow
.editorconfigstandards with LF line endings and final newlines.References:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.