Research Project Β· Department of Computer Science & Engineering Β· SRM Institute of Science and Technology
π Paper under review β Journal of Information Security and Applications, Elsevier Β· Scopus Q1 Β· IF 3.7
Can Zero-Trust context-aware policies mitigate adversarial evasion attacks against ML-based network intrusion detection systems β without requiring adversarial retraining of the underlying model?
Answer: Yes. While FGSM/PGD adversarial attacks achieve a 65% bypass rate against the ML classifier alone, the Zero-Trust contextual policy layer reduces the effective system bypass rate to 2.2% β a 96.6% reduction β without any model retraining.
| Metric | UNSW-NB15 | CICIDS-2017 |
|---|---|---|
| ML Classifier Accuracy | 90.7% | 99.9% |
| Seeds (statistical validity) | 5 | 5 |
| Condition | Attack Bypass Rate |
|---|---|
| ML classifier alone (adversarial) | 65% |
| ML classifier + Zero-Trust context layer | 2.2% |
| Reduction | 96.6% |
All accuracy metrics are averaged across 5 independent random seeds for statistical robustness.
ML-based intrusion detection systems are vulnerable to adversarial evasion attacks β carefully crafted perturbations to network traffic features that cause the model to misclassify malicious flows as benign. This project investigates whether the contextual policy layer of a Zero-Trust Network Architecture (ZTNA) can compensate when the ML component is actively fooled, without needing to retrain the model against adversarial examples.
The key insight is dimensional orthogonality: gradient-based adversarial attacks operate in the network feature space of the ML model, while Zero-Trust contextual signals (device trust, geographic risk, identity tier, time-of-day) exist in a completely separate information space sourced from external systems that cannot be manipulated by crafting network packet features. An attacker who suppresses their ML risk score through adversarial perturbation still cannot escape a DENY decision if their device enrollment status or geographic IP reputation flags them as suspicious.
Network Traffic (UNSW-NB15 / CICIDS-2017 features)
β
βΌ
βββββββββββββββββββββββββββ
β ML Risk Classifier β β Neural Net: Input β 128 β 64 β 32 β 1 (PyTorch)
β Risk Score: 0.0 β 1.0 β
ββββββββββββ¬βββββββββββββββ
β β²
β β FGSM / PGD adversarial perturbation
β β (domain-constrained, Ξ΅-bounded)
βΌ
βββββββββββββββββββββββββββ
β Context Enrichment β β Device Trust Β· Geo-Risk Β· Identity Tier Β· Time-of-Day
ββββββββββββ¬βββββββββββββββ
βΌ
βββββββββββββββββββββββββββ
β Zero-Trust Policy β β Priority-ordered rule engine
β Engine β
ββββββββββββ¬βββββββββββββββ
βΌ
ALLOW / DENY / STEP_UP_AUTH / RATE_LIMIT / ISOLATE
β
βΌ
βββββββββββββββββββββββββββ
β SOC Telemetry Log β β Structured JSON audit trail
β Streamlit Dashboard β
βββββββββββββββββββββββββββ
| Dataset | Description | Features |
|---|---|---|
| UNSW-NB15 | Modern network intrusion dataset from the Australian Centre for Cyber Security | 49 features, 9 attack categories |
| CICIDS-2017 | Canadian Institute for Cybersecurity network traffic dataset | Benign + 14 attack types |
Both datasets were preprocessed through the same pipeline: feature selection, normalisation, and encoding of categorical fields before training.
FGSM (Fast Gradient Sign Method) β single-step attack, perturbs input features in the direction that maximally increases model loss:
x_adv = x + Ξ΅ Β· sign(β_x J(ΞΈ, x, y))
PGD (Projected Gradient Descent) β iterative, stronger attack; takes multiple small steps and projects back into the valid feature range after each step:
x_t+1 = Ξ _{x+S}(x_t + Ξ± Β· sign(β_x J(ΞΈ, x_t, y)))
Both attacks are domain-constrained: perturbations are bounded to realistic network traffic feature ranges. Features with physical constraints (e.g., non-negative packet sizes, valid port ranges) are clamped after each perturbation step to ensure the adversarial examples remain plausible network traffic.
| Signal | Low Risk | Medium Risk | High Risk |
|---|---|---|---|
| Device Trust | Enrolled, compliant | Unknown device | Untrusted / blacklisted |
| Geographic Risk | Home region | Unusual region | High-risk region |
| Identity Tier | Privileged user | Standard user | Guest / service account |
| Time-of-Day | Business hours | Off-hours | Unusual hours |
The policy engine combines the ML risk score with these four context signals through a priority-ordered rule set. An adversarial packet that suppresses the ML risk score still fails the policy check if any context signal exceeds its threshold for the requested resource.
The ablation study isolates the contribution of each context signal to the overall adversarial robustness:
| Configuration | Adversarial Bypass Rate |
|---|---|
| ML Classifier Only | 65.0% |
| ML + Device Trust Context | ~38% |
| ML + Geographic Risk Context | ~45% |
| Full System (All Context Signals) | 2.2% |
The full context combination is what drives the result β no single signal alone achieves comparable robustness.
Prerequisites: Python 3.10+
# 1. Clone the repository
git clone https://github.com/Aarnav-Singh/adversarial-ml-security-framework.git
cd adversarial-ml-security-framework
# 2. Install dependencies
pip install -r requirements.txt
# 3. Download datasets
# UNSW-NB15: https://research.unsw.edu.au/projects/unsw-nb15-dataset
# CICIDS-2017: https://www.unb.ca/cic/datasets/ids-2017.html
# Place files in the data/ folder
# 4. Train the ML classifier
python scripts/train_baseline.py
# 5. Launch the interactive SOC dashboard
streamlit run src/dashboard/app.py
# Open http://localhost:8501The dashboard has three tabs:
- SOC Console β live traffic simulation and real-time decision log
- Red Team β adversarial attack testing with configurable Ξ΅
- Blue Team β defense analytics and context signal breakdown
All experiments use fixed random seeds and are fully reproducible. Run in this order:
python scripts/train_multiseed.py # Train across 5 seeds β CI metrics
python scripts/run_ablation.py # 4-configuration ablation study
python scripts/run_epsilon_sweep.py # FGSM + PGD across Ξ΅ = 0.01 to 0.20Results are saved to results/ as JSON. The key output is results/ablation_results.json, which directly corresponds to the ablation table in the paper.
adversarial-ml-security-framework/
βββ src/
β βββ config.py # Central configuration & hyperparameters
β βββ data/network_loader.py # UNSW-NB15 / CICIDS-2017 loading & preprocessing
β βββ risk_engine/ # Neural network model definition & inference
β βββ attacks/ # FGSM, PGD, epsilon sweep, constraint validator
β βββ policy/ # Context enrichment & Zero-Trust rule engine
β βββ system/ # Full pipeline integration layer
β βββ evaluation/ # Multi-seed runner, statistics, reporting
β βββ training/ # Model training & adversarial retraining
β βββ logging/ # SOC telemetry & blue team analytics
β βββ dashboard/app.py # Streamlit interactive dashboard
βββ scripts/ # Runnable experiment scripts
β βββ train_baseline.py # β Start here
β βββ train_multiseed.py
β βββ run_ablation.py
β βββ run_epsilon_sweep.py
β βββ test_zero_trust_system.py
βββ docs/ # Full documentation
βββ data/ # Place dataset files here (not committed)
βββ models/ # Trained model checkpoints (generated locally)
βββ results/ # Experiment outputs (generated by scripts)
βββ figures/ # Architecture diagrams & paper figures
βββ requirements.txt
βββ LICENSE
For researchers:
- Research Methodology β Dataset preprocessing, model architecture, attack generation, evaluation metrics
- Architecture β Component design, data flow, policy rule table
- Threat Model β Attacker capabilities, domain constraints, security assumptions
- Adversarial Attacks β FGSM and PGD implementation details
For developers:
- Usage Guide β Dashboard walkthrough
- API Reference β Module and function documentation
- Deployment Guide β Production deployment considerations
- Troubleshooting
torch==2.0.1
numpy==1.24.3
pandas==2.0.3
scikit-learn==1.3.0
streamlit==1.28.0
plotly==5.17.0
joblib==1.3.2
This is the research paper basis:
"Zero-Trust Context-Aware Defense Against Adversarial Evasion Attacks on ML-Based Network Intrusion Detection Systems" Currently under review β Journal of Information Security and Applications, Elsevier, Scopus Q1, Impact Factor 3.7
Available on request.
Released under the MIT License for educational and research purposes. Adversarial attack implementations are included solely to evaluate and demonstrate defensive mechanisms β not for offensive use.
Aarnav Singh Β· Portfolio Β· LinkedIn Β· aarnavujji@gmail.com