Skip to content

feat(use-cases): run a Lua snippet on every captured flow with axon - #44

Merged
pigri merged 1 commit into
mainfrom
feat/axon-flow
Nov 30, 2026
Merged

pigri merged 1 commit into
mainfrom
feat/axon-flow

Conversation

@pigri

@pigri pigri commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

An agent-mode example of axon: a flow_by_axon snippet runs on every flow the smart firewall evaluated, and tags it. It never blocks: allow_block is off.

flow.lua tags SSH from a public address as ssh-from-public, and a connection to port 443 from an address with a threat score of 80 or more as tls-to-risky, through a named expression under filters:.

test.sh runs the set's own snippet: block on live captured traffic. It makes two network namespaces joined by a veth pair, runs the agent in one with AF_PACKET capture and firewall.mode: none, and connects from a public and a private address in the other. The host's interfaces and firewall are not touched. test/threat.mmdb scores only the documentation range 203.0.113.0/24, at 90. The test needs root.

Tested

Against a Synapse 0.8.10 build with --features axon:

  • synapse --check-config passes for the set, and rejects a malformed filters: expression.
  • test.sh as root: 6 of 6 checks pass.
  • Mutants of the set:
Mutant Checks that fail
snippet.enabled: false snippet loaded, ssh-from-public, tls-to-risky
is_private check negated public SSH tagged, private SSH not tagged
filter call removed tls-to-risky
SSH tag returned as a block, with allow_block: true public SSH tagged, every tag log only
a snippet runtime error tls-to-risky, no snippet error

Not run: capture with XDP.

  • checks pass

Not reviewed: 4d8d142 — examples and test scripts only

@pigri
pigri added this pull request to stack #45 November 15, 2026 21:47
@pigri
pigri marked this pull request as ready for review November 15, 2026 21:53
Base automatically changed from feat/axon-access to main November 30, 2026 08:39
@pigri
pigri merged commit 9574ab9 into main Nov 30, 2026
3 checks passed
@pigri
pigri deleted the feat/axon-flow branch November 30, 2026 08:39
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