Abuse rules API v1

The anti-abuse system detects abuse on the proxy fleet (exploit scanning, brute force, spam, credential stuffing) and publishes the result as a policy: a versioned list of rules plus quarantine triggers. The proxy (Transit) does not define rules itself. It pulls the policy, checks every request against it before dialing, and writes the matching rule id to its access log.

1. Endpoints

Base URL: https://aisec.orb-labs.com/v1. All calls except /healthz and /docs need Authorization: Bearer <token>.

CallReturns
GET /v1/policyThe current policy (JSON, below). Sends an ETag; send it back as If-None-Match to get 304 Not Modified when nothing changed.
GET /v1/policy/metaVersion, expiry, rule counts per kind, size, ETag. Cheap check.
GET /v1/healthz{"ok":true}
GET /v1/docsThis page.

Errors: 401 bad or missing token, 503 no policy available yet.

curl -s -H "Authorization: Bearer $TOKEN" https://aisec.orb-labs.com/v1/policy/meta
curl -s -H "Authorization: Bearer $TOKEN" -H 'If-None-Match: "<etag>"' https://aisec.orb-labs.com/v1/policy -o policy.json -w '%{http_code}\n'

2. Distribution

3. Policy format

{
  "v": 1,
  "version": "20261119T101000Z",
  "generated": 1763547000,
  "expires": 1763554200,
  "rules": [
    {"id": "bl:malware-host.example", "kind": "blocklisted_host", "action": "log",
     "hosts": ["malware-host.example"], "expires": 0},
    {"id": "smtp:gw_203.0.113.7", "kind": "smtp_source", "action": "log",
     "src": ["203.0.113.7"], "ports": [25, 465, 587], "expires": 0},
    {"id": "ex:lv123:VPN_appliance", "kind": "exploit_source", "action": "log",
     "src": ["198.51.100.0/24"], "ports": [10443, 4443, 8443], "expires": 0}
  ],
  "quarantine": { ... section 5 ... }
}

4. Rules

FieldMeaning
idStable rule id. Characters A-Za-z0-9:._- only, no spaces, so it is safe in log lines.
kindblocklisted_host, smtp_target, exploit_source, smtp_source, credential_stuffing_source. For stats only, no effect on matching.
actionlog or block (see below).
srcClient IPs / CIDRs: the IP that connects to Transit (customer IP, or the gateway IP for gateway traffic).
userProxy usernames (optional; not used yet).
hostsExact target host names (lowercase, no trailing dot).
suffixesDomain suffixes: example.com matches example.com and *.example.com.
dstTarget IPs / CIDRs (an IP-literal target, or the resolved IP).
portsTarget ports.
expiresUnix seconds; 0 = valid until the policy expires.

Matching: a rule matches when every field it sets matches (AND). Inside one field, any value matches (OR). A field that is not set matches everything. Check every request (CONNECT, SOCKS, HTTP) before dialing, on gateway ports and direct (station) ports.

Action:

Today every rule is log. We switch rules to block once the log results are reviewed.

Access log: add two fields to the request line: rule=<id> (first matching rule, or -) and enf=block|log|quarantine|-. Also log one line per policy load with the version and the number of rules.

5. Quarantine

A quarantine denies all requests from one client (key src = client IP, or user) for a time. Transit counts the metrics itself, because only Transit sees every request. The policy carries the thresholds:

{
  "action": "log",
  "default_timeout_s": 3600,
  "manual": [],
  "triggers": [
    {
      "desc": "upstream connect failures (refused, timeout, unreachable, DNS error)",
      "id": "q-errors",
      "key": "src",
      "metric": "failed_connects",
      "threshold": 1000,
      "window_s": 1800
    },
    {
      "desc": "distinct destination IPs on attack ports (scanning)",
      "id": "q-sweep",
      "key": "src",
      "metric": "distinct_dst_ips",
      "ports": [
        23,
        102,
        135,
        139,
        389,
        445,
        502,
        636,
        943,
        1433,
        1883,
        2083,
        2087,
        2323,
        2375,
        2376,
        2379,
        3306,
        3389,
        3443,
        4433,
        4443,
        5432,
        5443,
        5900,
        5985,
        5986,
        6379,
        7001,
        7002,
        7443,
        8009,
        8088,
        8291,
        8443,
        8500,
        8834,
        9200,
        9443,
        10250,
        10443,
        11211,
        27017,
        50000,
        60443
      ],
      "threshold": 300,
      "window_s": 600
    },
    {
      "desc": "connections to one destination IP:port on attack ports (brute force)",
      "id": "q-hammer",
      "key": "src",
      "metric": "conns_per_dst",
      "ports": [
        23,
        102,
        135,
        139,
        389,
        445,
        502,
        636,
        943,
        1433,
        1883,
        2083,
        2087,
        2323,
        2375,
        2376,
        2379,
        3306,
        3389,
        3443,
        4433,
        4443,
        5432,
        5443,
        5900,
        5985,
        5986,
        6379,
        7001,
        7002,
        7443,
        8009,
        8088,
        8291,
        8443,
        8500,
        8834,
        9200,
        9443,
        10250,
        10443,
        11211,
        27017,
        50000,
        60443
      ],
      "threshold": 300,
      "window_s": 600
    },
    {
      "desc": "distinct mail servers contacted on 25/465/587 (spam)",
      "id": "q-smtp",
      "key": "src",
      "metric": "distinct_dst_ips",
      "ports": [
        25,
        465,
        587
      ],
      "threshold": 50,
      "window_s": 600
    }
  ]
}
FieldMeaning
actionlog: when a trigger fires, log quarantine_would_start trigger=<id> src=… and allow everything. block: quarantine for real. Today: log.
default_timeout_sQuarantine length, unless the trigger or manual entry sets timeout_s.
triggers[].metric failed_connects: upstream connect failures (refused, timeout, unreachable, DNS error) in the window.
distinct_dst_ips: distinct target IPs in the window (only ports, if set).
conns_per_dst: connections to one target IP:port in the window (only ports, if set).
threshold, window_sThe trigger fires at >= threshold within a sliding window of window_s seconds.
manualQuarantines set by the anti-abuse system: {"id":"qm:…","src":["IP/CIDR"],"user":"…","until":unix,"reason":"…"}. Applied while until is in the future.

Override: Transit's own admin API (in the fleet app) should list active quarantines and let an operator release or extend one. A release lasts until the end of that quarantine; it does not change the triggers. Exempt Transit's own health checks and internal IPs from all triggers.

6. Ports used above

Attack ports (VPN/appliance, SMB, RDP, WinRM, Redis/memcached, Docker/k8s/etcd, WebLogic, Elasticsearch, databases, LDAP/RPC, VNC, IoT/ICS, Hadoop/Consul/Jenkins): 23, 102, 135, 139, 389, 445, 502, 636, 943, 1433, 1883, 2083, 2087, 2323, 2375, 2376, 2379, 3306, 3389, 3443, 4433, 4443, 5432, 5443, 5900, 5985, 5986, 6379, 7001, 7002, 7443, 8009, 8088, 8291, 8443, 8500, 8834, 9200, 9443, 10250, 10443, 11211, 27017, 50000, 60443. SMTP: 25, 465, 587.