HUB
Sign inSign up
caddy-reverse-proxy logo

jujhars13/caddy-reverse-proxy

By jujhars13

•Updated 1 day ago

Caddy with Coraza WAF + OWASP Core Rule Set

Image
Networking
Security
Web servers
0

538

jujhars13/caddy-reverse-proxy repository overview

⁠Caddy build with Coraza WAF

https://github.com/jujhars13/caddy-reverse-proxy-build/⁠

Builds and publishes Caddy with integrated Coraza WAF⁠ - based on Alpine base images (post 2026 sshhole⁠ vuln)

Published to:

⁠Usage

See compose.example.yaml and Caddyfile.example

{
	http_port 80
	https_port 443
	order coraza_waf first
	log {
		output stdout
		format console
		level debug
		include "http.handlers.waf"
	}
}

widget.home.lan:443 192.168.99.23:443 {
	#tls internal
	tls /certs/widget.fullchain.pem /certs/widget-key.pem

	coraza_waf {
		load_owasp_crs
		directives `
		Include @coraza.conf-recommended
		Include /ruleset/1_crs_setup.conf
		Include @owasp_crs/*.conf
		SecDefaultAction "phase:3,log,auditlog,pass"
		SecDefaultAction "phase:4,log,auditlog,pass"
		SecDefaultAction "phase:5,log,auditlog,pass"
		SecRuleEngine On
		SecDebugLog /tmp/coraza_debug.log
		SecDebugLogLevel 9
		SecRule REQUEST_URI "@streq /admin" "id:101,phase:1,t:lowercase,deny,status:403"
		SecRule REQUEST_BODY "@rx maliciouspayload" "id:102,phase:2,t:lowercase,deny,status:403"
		SecRule RESPONSE_STATUS "@rx 406" "id:103,phase:3,t:lowercase,deny,status:403"
		SecResponseBodyAccess On
		SecResponseBodyMimeType application/json
		SecRule RESPONSE_BODY "@contains responsebodycode" "id:104,phase:4,t:lowercase,deny,status:403"
		SecAuditEngine On
		SecAuditLog /tmp/corza_audit.log
		SecAuditLogFormat json
		`
	}

	reverse_proxy widget:8090

	handle {
		encode gzip
		header Strict-Transport-Security max-age1536000;
		header Access-Control-Allow-Origin "*"
		header Access-Control-Allow-Methods "OPTIONS,HEAD,GET,POST,PUT,PATCH,DELETE"
	}
}

⁠To deploy new version

# increment the version number
npm version {major,minor,patch}

# now docker commit your commit or use

./commit.sh

⁠Sources

Tag summary

Content type

Image

Digest

sha256:d5e0df784…

Size

48.6 MB

Last updated

1 day ago

docker pull jujhars13/caddy-reverse-proxy