Overview
Rules written by hand describe the application someone remembered. Rules learned from traffic describe the requests that happened to arrive. Neither knows about the debug endpoint that shipped last week, because nobody wrote a rule for it and nobody has called it yet.
The application's surface is already written down, in its own source. Microglia's AI agents read it there and compile it into the rule types Synapse already enforces. The rules are positive: they describe what the application is, so a request outside that shape stands out.
When you see this
- Nobody is sure the WAF rules still match the routes the application serves.
- A route, debug endpoint or admin path is reachable that nobody meant to expose.
- Releases change the application faster than anyone updates its rules.
Steps
- 01
Put Synapse in front of the app
WAF rules run in proxy mode: Synapse terminates TLS, applies policy and forwards to the unchanged application.
/etc/synapse/config.yaml mode: "proxy" proxy: address_http: "0.0.0.0:80" address_tls: "0.0.0.0:443" upstream: conf: "/etc/synapse/upstreams.yaml" - 02
Let Microglia read the application
Microglia reads the source: the routes the application serves, what each route expects to receive, which routes sit behind authentication, and where the application connects out to. That surface is the Application Surface Model. Connecting a repository is not in the docs yet; talk to us to set it up.
- 03
Review what it compiled
What comes out are ordinary Synapse rules: WAF rules in the documented expression language, IDS signatures and firewall rules. The two below show the shape of compiled WAF rules: one for the routes the code serves, one for what a route accepts.
Illustrative: the routes the code serves, action block http.request.path not in {"/", "/login", "/api/orders", "/api/orders/status", "/health"}Illustrative: what one route accepts, action block http.request.path == "/api/orders" and http.request.content_type != "application/json"DecisionIs every route the application serves in the surface?Yes Carry on.
No A positive rule refuses what it does not know, so the missing route will return 403. Fix the surface before you enforce.
- 04
Put your exceptions above the compiled rules
Evaluation stops at the first matching rule. An allow you need, for a health checker or a partner's callback, goes above the compiled rules or it never runs.
WAF rule, action allow, placed above the compiled rules ip.src in {192.0.2.0/24} - 05
Ship the rules with the code
Microglia is wired into CI/CD, so the rules are compiled from the code that is being released, not from what the application looked like when someone last wrote a rule.
- 06
Virtual-patch what the agents find
When the agents find a flaw, they write the virtual patch: a rule for the request shape that reaches it, enforced until the fix ships. The virtual patching playbook covers what to do while it is in place.
Common mistakes
- Enforcing compiled rules before checking that every route the application serves is in the surface.
- Placing exceptions below the compiled rules: evaluation stops at the first match.
- Treating a virtual patch as the fix.
Escalate when
- Requests to routes outside the surface that come from inside your network.
- A flaw the agents found in a route that is already reachable from the internet.
Where this stops working
- The rules are as current as the code they were compiled from: code that reaches production another way is not described by them.
- Only traffic through the proxy is protected. Make the proxy the only way in.