Gowafp
A Web Application Firewall for PHP written in Go
Install / Use
/learn @levidurfee/GowafpREADME
gowafp
A Go WAF (Web Application Firewall) that sits between your webserver (nginx) and your FastCGI application.
nginx <- (tcp) -> gowafp <- (FastCGI) -> PHP-FPM
The goal of this package is to prevent any attacks from reaching the FastCGI application. It should block all SQL injection attempts and filter XSS attempts. Maybe down the road it could also handle CSRF.
The Application and the Web Application Firewall should not be on different servers. While the services out there do a good job, they're expensive and slower. Of course, you could recompile your web server with some additional features, but that is harder to deploy while scaling.
usage
First, you need to have Go get the repo.
go get github.com/levidurfee/gowafp
Below is simple main.go example.
package main
import (
"github.com/levidurfee/gowafp"
"log"
"net/http"
)
func main() {
http.Handle("/", gowafp.AnalyzeRequest(gowafp.PhpHandler("/app/index.php", "tcp", "127.0.0.1:9000")))
log.Fatal(http.ListenAndServe(":8080", nil))
}
Then build and run it.
go build main.go
./main
Related Skills
healthcheck
337.3kHost security hardening and risk-tolerance configuration for OpenClaw deployments
node-connect
337.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
xurl
337.3kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
prose
337.3kOpenProse VM skill pack. Activate on any `prose` command, .prose files, or OpenProse mentions; orchestrates multi-agent workflows.
