Adversarial defence for ML-based IDS
Apollon answers every request with a classifier drawn by Thompson sampling. Attackers cannot learn a boundary that keeps moving. Detection stays accurate.
The problem
ZOO and HopSkipJump query an IDS, estimate where its decision boundary lies and push an attack just across it. That only works if the same model answers every query.
Thousands of queries, each a slightly modified attack flow.
Every answer refines their estimate of where benign begins.
The smallest change that flips the verdict becomes the evasion.
Same attack, same query budget: a decision-based attack (as HopSkipJump) binary-searches the perturbation δ that flips the verdict, then reuses it. Illustration of the mechanism; measured results are in the paper.
How it works
Every classifier keeps a Beta posterior of how often it is right. Each request draws one value per classifier; the highest draw answers. Good classifiers answer most requests, but no answer is predictable.
K-Means splits traffic; every classifier is trained per cluster.
One Beta draw per classifier; the highest answers this request.
Analyst feedback updates the posteriors online.
Use it
A scikit-learn estimator for your pipelines and a command line for experiments. Four commands take a CIC dataset from raw CSV files to an adversarial evaluation.
from apollon import ApollonMAB
from apollon.data import prepare
data = prepare("cic-ids2017", ["data/CIC-IDS2017/"])
model = ApollonMAB(random_state=0)
model.fit(data.X_train, data.y_train)
# one Thompson draw per request
pred, arms = model.predict(data.X_test, return_arms=True)
# analyst feedback updates the posteriors
model.update(X_reviewed, y_reviewed)
fit, predict, predict_proba, get_params. Any classifier can join the pool.
API reference →prepare, train, evaluate, attack, demo. JSON output for pipelines.
CLI guide →CIC-IDS2017, CSE-CIC-IDS2018 and CIC-DDoS2019 with the paper's preprocessing.
Datasets →ZOO and HopSkipJump through ART, direct and transfer, functional features fixed.
Adversarial evaluation →Evaluation
The paper evaluates Apollon on three public datasets of the Canadian Institute for Cybersecurity, against black-box attacks, and compares it with each classifier of its pool used alone.
Score-based, zeroth-order optimisation of the attack towards benign.
Decision-based: needs only the predicted label.
Direct queries to Apollon, and transfer from a surrogate model.
No more than a single model: each request costs one cluster assignment, one Beta draw per classifier and one classifier evaluation. Training fits every classifier on every cluster.
Yes. Any scikit-learn classifier with predict_proba can be passed in ApollonMAB(arms=[...]); the paper's pool is RF, DT, NB, LR and MLP.
No. Labels are needed to train. Afterwards, analyst feedback is optional: when it arrives, update moves the posteriors of the classifiers that answered.
ZOO and HopSkipJump, targeted towards the benign class, with functional features kept fixed, both querying Apollon directly and transferring from a surrogate.
Predictions are reproducible with a seed, and every answer reports which classifier produced it (return_arms=True), so alerts stay auditable.
Cite the article in Computers & Security 136, 103546 (2024). BibTeX, APA and IEEE formats are on the citation page.
Install the package, run the demo, then point it at your traffic.
pip install "apollon-ids[attacks] @ git+https://github.com/antoniopaya22/apollon"