How aashmitmckenzie/cyber-shield works
Project type and purpose
• This is an open-source research pipeline (CyberShield) that simulates broken access control (BAC) attacks in Dockerized web apps and then applies a machine-learning pipeline to detect and mitigate those attacks in real time. It is not a traditional full-stack web app but a data-driven ML framework with three phases: attack simulation, feature engineering, and model training/evaluation.
File structure
• Top-level scripts:
• bac_attack_automation.py → orchestrates BAC attack simulation against DVWA, WebGoat, Juice Shop
• get_ml_processed_features.py → transforms raw logs and JSON profiles into feature CSVs
• adv_model_training.ipynb & model_training.ipynb → Jupyter notebooks for training and comparing ML models
• Data artifacts:
• resource_access_patterns.json, user_behavior_profiles.json → JSON sources of simulated behavior
• *.csv Example files → intermediate and enhanced feature sets
• No nested directories—this is a linear, single-repo pipeline.
Insights from the README
• Three logical stages (Simulation, Preprocessing, Modeling)
• External dependencies: Dockerized target apps, JWT manipulation, multi-threading
• Key technologies: Python 3.8+, Jupyter, scikit-learn, XGBoost, JSON/CSV data stores
Diagramming the architecture
a. Main components
• External Targets (DVWA, WebGoat, JuiceShop in Docker)
• Attack Simulation Engine (bac_attack_automation.py)
• Raw Data Store (JSON logs, request traces)
• Feature Engineering Module (get_ml_processed_features.py)
• Feature Artifacts (ml_processed_features.csv, ml_enhanced_features.csv, ml_training_features.csv)
• Model Training & Evaluation (model_training.ipynb, adv_model_training.ipynb)
• Output Reports/Results (enhanced_bac_results.csv)
b. Relationships & interactions
1. Simulation Engine → sends HTTP requests / manipulates JWT → writes raw logs & JSON profiles
2. Raw Data → consumed by Feature Engineering → emits cleaned CSV feature sets
3. CSV Features → input to Model Training notebooks → produces trained models & evaluation metrics
4. Evaluation metrics → saved as CSV reports
c. Architectural patterns & principles
• Linear pipeline (batch processing)
• Modular separation: Simulation vs. Preprocessing vs. Modeling
• Data-driven research: raw data artifacts archived for reproducibility
d. Key technologies & frameworks
• Python scripts (automation, preprocessing)
• Jupyter Notebooks (interactive model training)
• Docker containers (target apps for simulation)
• scikit-learn, XGBoost, pandas for ML & data manipulation