Repository navigation
feat(use-cases): axon scan detection pipeline and threat-score blocking - #46
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two
flow_by_axonuse-cases that go pastaxon-flow's single snippet file: a multi-file pipeline with shared state, and a snippet that blocks.axon-scan-detectionFour Lua files run as one pipeline (
files:). Stage 0 works out the direction once and hands it down inaxon.stash. The other stages count over time windows in two shared dictionaries. Tags only:outbound-portscanoutbound-sweepinbound-subnet-scanaxon-threat-blockallow_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.mmdbis written bytest/make-threat-mmdb.py, with no dependencies and unsigned scores, so every release decodes it.Testing
Each set has a
test.shin the style ofaxon-flow. It makes two network namespaces, runs the agent with AF_PACKET capture andfirewall.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: falsemakes it fail.scripts/check.sh(--check-config): both sets pass with no warnings.check-expressions.shand yamllint 1.35.1 are clean.Run on a Synapse 0.8.10 release-branch build.
Notes
tcpdump -dd, so both tests check fortcpdumpup front.axon-flow/test.shdoes not list it.