Skip to content

feat(use-cases): axon scan detection pipeline and threat-score blocking - #46

Merged
pigri merged 1 commit into
mainfrom
feat/axon-scan-detection-threat-block
Nov 30, 2026
Merged

pigri merged 1 commit into
mainfrom
feat/axon-scan-detection-threat-block

Conversation

@pigri

@pigri pigri commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Two flow_by_axon use-cases that go past axon-flow's single snippet file: a multi-file pipeline with shared state, and a snippet that blocks.

axon-scan-detection

Four Lua files run as one pipeline (files:). Stage 0 works out the direction once and hands it down in axon.stash. The other stages count over time windows in two shared dictionaries. Tags only:

Tag When
outbound-portscan a home host on 25+ ports of one outside host within 10 min
outbound-sweep a home host on one uncommon port of 40+ outside hosts within 10 min (web, DNS, mail, push and VPN ports are left out)
inbound-subnet-scan 3+ addresses of one outside /24 on 15+ ports within an hour: scanners that spread over many addresses and never reach a per-source rule

axon-threat-block

allow_block: true. Blocks an outside source with a threat score of 50–89 once there is evidence too: an IDS alert, a scan or brute-force verdict of the traffic classifier, or 10+ ports. Scores of 90 and up are left to a policy rule. The block goes through the smart firewall's per-address ban and its never-ban guards. test/threat.mmdb is written by test/make-threat-mmdb.py, with no dependencies and unsigned scores, so every release decodes it.

Testing

Each set has a test.sh in the style of axon-flow. It makes two network namespaces, runs the agent with AF_PACKET capture and firewall.mode: none, sends real traffic, and checks each case against a control.

  • axon-scan-detection: 10/10 pass. Each scan is tagged exactly once; 20 ports, port 443 and a /24 with only 10 ports are not tagged. Raising the port threshold to 35 makes it fail.
  • axon-threat-block: 8/8 pass. The score-70 source is blocked from its 10th port on, and the ban length rises. Score 70 with 5 ports, score 95, and no score are not blocked. allow_block: false makes it fail.
  • scripts/check.sh (--check-config): both sets pass with no warnings. check-expressions.sh and yamllint 1.35.1 are clean.

Run on a Synapse 0.8.10 release-branch build.

Notes

  • The blocking test uses the benchmarking range 198.18.0.0/15, because Synapse never bans a documentation address. Its README explains this.
  • AF_PACKET capture compiles its filter with tcpdump -dd, so both tests check for tcpdump up front. axon-flow/test.sh does not list it.

Two flow_by_axon sets beyond axon-flow's single file:

- axon-scan-detection: four files in one pipeline, axon.stash and shared
  dictionaries counting over time windows. Tags outbound-portscan (25+
  ports of one host), outbound-sweep (one uncommon port on 40+ hosts) and
  inbound-subnet-scan (3+ addresses of one /24 on 15+ ports). Tags only.
- axon-threat-block: allow_block on, blocks an outside source with a
  threat score of 50-89 once it trips the IDS, the traffic classifier or
  10+ ports. test/threat.mmdb is written by make-threat-mmdb.py.

Each has a test.sh that runs live traffic between two network namespaces,
with a control per check. The blocking test uses the benchmarking range
198.18.0.0/15: Synapse never bans a documentation address. Both tests need
tcpdump, which AF_PACKET capture uses to compile its filter.
@pigri
pigri merged commit e75ff37 into main Nov 30, 2026
3 checks passed
@pigri
pigri deleted the feat/axon-scan-detection-threat-block branch November 30, 2026 10:32
@linear-code

linear-code Bot commented Nov 30, 2026

Copy link
Copy Markdown

SYN-1426

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant