Skip to content

About

LLM-powered DevSecOps agent for generating vulnerable cyber ranges from natural language.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

AutoVuln-Builder: LLM-Powered CyberRange Generator

AutoVuln-Builder is an autonomous DevSecOps agent that translates natural language requests into ready-to-deploy, intentionally vulnerable Infrastructure as Code (IaC) for cybersecurity training and CyberRange environments.

Architecture & Guardrails

This project demonstrates how to tame a Large Language Model (LLM) for precise infrastructure generation by decoupling the "decision making" from the "code writing".

  1. The Brain (LLM & LangChain): Analyzes the user's scenario request and selects the appropriate services, ports, and vulnerabilities.
  2. The Guardrail (Pydantic): Enforces strict mathematical and logical rules (e.g., valid ports, allowed vulnerability types, database dependencies) to prevent AI hallucinations.
  3. The Factory (Jinja2): Takes the validated AI output and injects it into rigid, syntactically perfect templates to generate docker-compose.yml and .Dockerfile files.

Features

  • Natural Language to Infrastructure (Prompt-to-IaC).
  • Autonomous database provisioning if an application requires it.
  • Built-in conditional logic (e.g., dynamically installing mysqli only for PHP containers).
  • 100% syntactically correct YAML and Dockerfile generation.

Prerequisites

  • Python 3.10+
  • Docker & Docker Compose
  • OpenAI API Key

Installation

  1. Clone the repository:

    git clone https://github.com/Augustin-Br/autovuln_builder.git
    cd autovuln_builder
  2. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Set up your API Key: Rename .env.example to .env and add your OpenAI API key:

    OPENAI_API_KEY=sk-...

Usage

  1. Generate the Scenario: Run the orchestrator script. It will call the AI and generate the infrastructure files in the output_scenario/ folder.

    python main.py
  2. Deploy the CyberRange:

    cd output_scenario
    sudo docker compose up --build
  3. Test the Vulnerability (Example: SQLi): Open a new terminal and send an encoded payload to the generated web service:

    curl -v -G "http://localhost:8080/index.php" --data-urlencode "user=' OR 1=1 -- "

Watch the Docker logs to confirm the payload successfully traversed the PHP backend and hit the database layer!

About

LLM-powered DevSecOps agent for generating vulnerable cyber ranges from natural language.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages