Security controls
Access controls in WasFor are per-site and per-account. This page covers the controls you can enable from a site's Settings tab, plus account-level protections.
Basic authentication
Add a username and password in front of a site or a single path — useful for staging environments and internal tools.
Realm: Staging
User: acme
Password: <generated>
Protected paths: / (whole site)WasFor writes an htpasswd file outside the document root and adds the auth_basic directives to the vhost. Passwords are hashed with bcrypt.
IP allow and deny lists
| Mode | Behaviour |
|---|---|
| Allow list | Only listed addresses may connect |
| Deny list | Listed addresses are blocked; everyone else may connect |
Both modes accept single addresses and CIDR blocks:
203.0.113.10
198.51.100.0/24
2001:db8::/48Combine a deny list with Basic Auth for admin paths: the list stops noisy scanners, the password stops the rest.
If you enable an allow list, add your own address first. The panel offers a one-click "add my current IP" action to avoid locking yourself out.
Maintenance mode
Maintenance mode returns 503 with a Retry-After header while letting chosen addresses through:
HTTP/1.1 503 Service Unavailable
Retry-After: 3600Use it during migrations and deploys that cannot be zero-downtime. The custom maintenance page is editable per site.
Rate limiting
Rate limits protect login forms, APIs and expensive endpoints.
| Field | Example | Meaning |
|---|---|---|
| Zone | /api/ | Path prefix |
| Rate | 10r/s | Requests per second |
| Burst | 20 | Queue above the rate |
| Action | 429 | Status returned when exceeded |
limit_req_zone $binary_remote_addr zone=api:10m rate=10r/s;
location /api/ {
limit_req zone=api burst=20 nodelay;
}Start generous and tighten using traffic logs. An aggressive limit on a shared egress IP can affect legitimate users.
Hotlink protection
Hotlink protection blocks other sites from embedding your images and media:
Allowed referrers: example.com, *.example.com
Blocked extensions: jpg, jpeg, png, gif, webp, mp4Requests with no referrer are allowed by default so direct navigation and privacy-focused browsers keep working.
Reverse proxy
Proxy a path or a subdomain to an application listening on a local port — Node.js, Python, Go or a container:
Source: api.example.com
Target: http://127.0.0.1:3000
WebSocket: enabledWasFor writes the proxy_pass block, forwards Host, X-Real-IP, X-Forwarded-For and X-Forwarded-Proto, and keeps TLS termination at the edge. Bind the upstream to 127.0.0.1, never to a public interface.
Account-level protections
| Control | Recommendation |
|---|---|
| Two-factor authentication | Required for owner and admin roles |
| Session timeout | 30 minutes idle for admin roles |
| Active sessions | Review and revoke unknown devices monthly |
| Password policy | 14+ characters, checked against breach lists |
| API keys | Scoped, rotated every 90 days |
| Login alerts | Email on new device or country |
Headers WasFor sets
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
Referrer-Policy: strict-origin-when-cross-originAdd a Content-Security-Policy per site under Settings → Headers once you know which origins your application needs. Start in report-only mode, review violations, then enforce.
Incident checklist
- Revoke suspicious sessions and API keys.
- Rotate database and mailbox passwords.
- Enable maintenance mode if the site is serving malicious content.
- Pull the access and error logs for the affected window.
- Restore from the last known-good snapshot if files were modified.
- Open a ticket with the timeline and evidence — see AI & support.