AgentT1071.001

Contain a compromised host

When you no longer trust a host, cut its outbound paths instead of pulling the cable. Allow only what the investigation needs, deny all other egress below those exceptions, keep watching what the host tries to reach, and block by SNI through Amygdala where a port is not specific enough.

Overview

Pulling the network cable destroys the volatile evidence you need and takes the service down with it. What you usually want is narrower: stop it reaching anything new, keep watching it, and leave the machine running while you investigate.

Firewall rules match in both directions and run statelessly in the kernel at the TC hook, so nothing sits in the application's path and a compromised userspace process cannot bypass them.

When you see this

  1. A host beacons to a destination nobody recognises.
  2. An IDS alert and a model score agree that a host's traffic looks like command and control.

Steps

  1. 01

    See what the host is talking to

    Before you cut anything, record where the host is connecting. Look at it across every layer in the event log.

    Everything involving the host
    jq -c 'select(.src_ip == "10.0.4.21")' /var/log/synapse/events.log
  2. 02

    Allow what the investigation needs

    Your log collector and your management plane stay reachable. Give these rules a low order value so they are evaluated first.

  3. 03

    Deny all other egress

    Add a drop for egress with a higher order value than the exceptions. Evaluation stops at the first matching rule, lowest order first.

    DecisionDid a connection you need get cut?

    Yes Its allow has a higher order than the deny. Give it a lower one.

    No The containment shape is in place.

  4. 04

    Block by name where a port is not enough

    Firewall rules stop at the transport header: you can cut a destination and a port, not a TLS SNI. Amygdala evaluates the SNI on the host and installs the resulting block.

    Smart firewall rule, action drop
    tls.sni == "cdn-update.example.net"
  5. 05

    Check what the kernel enforces

    Only active rules are loaded, so a disabled rule is gone from the datapath rather than resident and inert.

    Rules the kernel is enforcing
    sudo synapse --show-firewall-rules json

Common mistakes

  1. Placing the exceptions below the deny: they never run.
  2. Forgetting that rules are stateless: a reply needs a rule of its own.
  3. Treating containment as the fix. It buys time and limits blast radius; rebuild the host.

Escalate when

  • The host held credentials or keys that other systems trust.
  • The same destination appears from a second host.

Where this stops working

  • A local-only compromise is untouched: egress rules do nothing about something that never leaves the box.
  • Matching stops at the transport header; anything finer is Amygdala's job.
Run it here

Send the request. Watch where it stops.

Edit the request or any rule and the pipeline runs again. The rules are real wirefilter expressions, evaluated the way the agent evaluates them; the traffic and model scores are samples. It all runs in your browser.

Try this Set ip.dst to 10.0.9.5 and the port to 6514, the log collector: allowed. Then give the deny-all rule order 5, and the collector is cut too.

The request

egress · agent mode

Every value is a rule field. Change one and the pipeline re-runs.

Connection
Fingerprints, from Dendrite
Model scores, sample output from Cortex
Flow behaviour, per source
Payload, what Thalamus inspects
Result Dropped at the TC hook
ResultDropped at the TC hookHillock · firewall rules · Logged by Amygdala
  1. 01Capture and fingerprintDendrite · On the wireObserved

    Computed JA4, JA4T for this connection. Capture only: Dendrite never blocks.

  2. 02Access rulesHillock · XDP hook, before routingNot used

    Access rules answer whether a source may reach this host, so they apply to inbound traffic only.

  3. 03Intrusion detectionThalamus · On the hostFlagged

    Alert on sid 9000101. IDS context becomes rule fields: ids.alert_count, ids.sids.

    sid 9000101Sample: periodic TLS beacon to a newly seen hostMatched

    Thalamus runs Suricata-compatible signatures across thirty-plus protocols. Here a signature is reduced to one content match.

  4. 04Behavioural modelsCortex · On the host CPUObserved

    Sample scores, 0 to 100: C2 97, scan 3, malicious flow 88. Nothing leaves the machine to be scored.

  5. 05Service graphHippocampus · On the hostNot used

    No workload identity on this flow.

  6. 06Smart firewall rulesAmygdala · Decided on the host, enforced in nftablesFlagged

    Matched a log rule: recorded what it would have done, enforced nothing.

    Matched
  7. 07Firewall rulesHillock · TC hook, in the kernelDropped

    Rule 100 drops egress tcp/443 to 203.0.113.50. Enforced in the kernel, so a process on the host cannot bypass it.

    Log collectorNo match
    Management planeNo match
    Deny all other egressMatched

    Lowest order first, first match wins. Stateless: a reply needs a rule of its own.

  8. 08WAF rulesProxy · In the proxy, after decryptionNot reached

    Agent mode does no HTTP proxying, so there is no request for the WAF to read.

  9. 09Content scanningProxy · ClamAV, before forwardingNot reached

    No WAF rule selected this request for scanning, so nothing was scanned.

Field names and operators follow the docs: WAF and Smart Firewall. A rule that names an unknown field does not load; a field the request does not carry never matches.

What lands in the event log
{
  "ts": "2026-11-17T09:41:07.212Z",
  "layer": "ids",
  "action": "notice",
  "source": "ids",
  "rule_id": "sid:9000101",
  "rule_msg": "Sample: periodic TLS beacon to a newly seen host",
  "src_ip": "10.0.4.21",
  "src_port": 54321,
  "dst_ip": "203.0.113.50",
  "dst_port": 443,
  "fingerprints": {
    "ja4t": "64240_2-4-8-1-3_1460_10",
    "ja4": "t13d0911h1_4b22cbed5bed_6d0c5a0d3e8f"
  }
}
{
  "ts": "2026-11-17T09:41:07.212Z",
  "layer": "smart_firewall",
  "action": "log",
  "source": "traffic_classifier",
  "signals": [
    "traffic_classifier",
    "ids"
  ],
  "rule_id": "s14",
  "src_ip": "10.0.4.21",
  "src_port": 54321,
  "dst_ip": "203.0.113.50",
  "dst_port": 443,
  "fingerprints": {
    "ja4t": "64240_2-4-8-1-3_1460_10",
    "ja4": "t13d0911h1_4b22cbed5bed_6d0c5a0d3e8f"
  }
}

The firewall rule's drop is not shown: the documented event layers are access rules, smart firewall, IDS and WAF.

Shaped like the documented event schema; the timestamp, ports, rule ids and ban duration are illustrative.

Now on your own traffic.

A demo runs the same pipeline against real packets, with the engineers who built it.