Skip to content

Configuration

All configuration lives in the .env file in the project root, which is read by docker-compose.yml. A small number of additional, mostly-optional values can be overridden by exporting them in the calling shell.

Authentication (required)

VariableDescription
BASIC_AUTH_USERNAMEHTTP Basic auth username for the web UI and API
BASIC_AUTH_PASSWORDHTTP Basic auth password (use a strong password)
SECRET_KEYHMAC key used to sign JWT access and refresh tokens. Auto-generated when empty, but tokens then invalidate on every restart — set a stable value in production

TLS for the web UI

VariableDefaultDescription
LETSENCRYPT_DOMAINemptyWhen set together with LETSENCRYPT_EMAIL, the web service obtains a real certificate via Let's Encrypt
LETSENCRYPT_EMAILemptyEmail address used for the ACME account
CORS_ALLOWED_ORIGINShttps://localhost:8443Comma-separated list of origins allowed by the backend CORS policy. Add your public hostname when fronting the UI behind your own domain.

Networking

VariableDefaultDescription
BACKEND_URLhttp://backend:5000Backend URL the web service uses on the internal Docker network
REQUEST_TIMEOUT120Web UI request timeout in seconds
PROXY_HOSTproxySquid container hostname (used by the backend to send reload requests)
PROXY_PORT3128Squid proxy port
PROXY_BIND_IP0.0.0.0Host interface that the Squid port is bound to. Set to 127.0.0.1 to restrict access to the local machine
PROXY_CONTAINER_NAMEsecure-proxy-manager-proxyDocker container name used when issuing reconfigure signals
PROXY_IPemptyLAN IP of the host. When set, dnsmasq publishes a WPAD record for browser auto-discovery
GUI_IP_WHITELISTemptyComma-separated client IPs allowed to connect to the proxy on the management ports even when blocked by other rules

WAF

VariableDefaultDescription
BASIC_AUTH_USERNAME / BASIC_AUTH_PASSWORD(required)Used to authenticate the WAF when it calls back to POST /api/internal/alert
WAF_BLOCK_THRESHOLD10Anomaly score at or above which a request is blocked
WAF_DISABLED_CATEGORIESemptyComma-separated rule category names to disable globally (for example DEBUG_LEAK,RESPONSE_ANOMALY)
WAF_H_ENTROPY1Toggle the Shannon entropy heuristic
WAF_H_ENTROPY_MAX7.5Maximum allowed entropy before the heuristic contributes to the score
WAF_H_BEACONING1Toggle C2 beaconing detection
WAF_H_PII1Toggle the PII leak heuristic
WAF_H_SHARDING1Toggle the destination sharding heuristic
WAF_H_MORPHING0Toggle the header morphing heuristic (off by default; noisy)
WAF_H_GHOSTING1Toggle the protocol ghosting heuristic
WAF_H_SEQUENCE0Toggle the request sequence heuristic (off by default; needs tuning)

Each toggle accepts 1/0 or true/false.

DNS

VariableDefaultDescription
DNS_UPSTREAM_11.1.1.3Primary upstream resolver (Cloudflare malware-blocking)
DNS_UPSTREAM_29.9.9.9Secondary upstream resolver (Quad9)
DNS_UPSTREAM_38.8.8.8Tertiary upstream resolver (Google)

Tailscale (optional sidecar)

VariableDefaultDescription
TS_AUTHKEYemptyTailscale authentication key. The sidecar refuses to start without one
TAILSCALE_HOSTNAMEsecure-proxyHostname registered on the tailnet

The sidecar only runs under docker compose --profile tailscale.

Squid configuration

The proxy/startup.sh script generates squid.conf at container start. You cannot replace the base configuration entirely — the startup script enforces certain protections (direct-IP block ACLs, ICAP integration, log paths) regardless. You can append custom directives by placing them at:

/config/custom_squid_extra.conf

The file is concatenated to the generated squid.conf at startup. If a legacy /config/custom_squid.conf exists, it is renamed to custom_squid_extra.conf automatically.

WARNING

Custom directives are appended after the base configuration; later directives override earlier ones in Squid only for a subset of options. Test your additions with docker compose exec proxy squid -k parse before relying on them.

Default Squid settings

SettingDefault
Listening port3128
Memory cache (PROXY_MEMORY_CACHE_MB)256 MB
Disk cache (PROXY_CACHE_SIZE_MB)2000 MB at /var/spool/squid
Maximum object size100 MB
connect_timeout30 seconds
dns_timeout5 seconds

These can be overridden through the Settings page of the web UI, which writes the values to /config/squid_settings.env.

WAF custom rules

Create /config/waf_custom_rules.txt with one regex per line. Lines starting with # are ignored. Each line is rejected if longer than 512 characters or if it contains a NUL byte. Restart the waf service to reload:

bash
docker compose restart waf

Example:

# Block requests containing internal codename
project-codename
(?i)pre-release-build

SSL certificates (HTTPS filtering)

If /config/ssl_cert.pem and /config/ssl_key.pem are missing, the proxy generates a self-signed RSA-2048 certificate valid for 3 650 days (ten years) at first start.

To install your own certificate:

bash
cp your-cert.pem config/ssl_cert.pem
cp your-key.pem config/ssl_key.pem
docker compose restart proxy

Clients must trust this certificate to avoid browser warnings when SSL bump (HTTPS filtering) is active.

Installing the CA on clients

PlatformSteps
WindowsImport to Trusted Root Certification Authorities via certmgr.msc
macOSAdd to Keychain Access, then mark Always Trust for SSL
LinuxCopy to /usr/local/share/ca-certificates/ and run update-ca-certificates
iOS / AndroidEmail the .pem file to the device, install via Settings → General → VPN and Device Management (iOS) or Security → Install certificate (Android)

Released under the MIT License.