A Layered Reference Model for Penetration Testing with Reinforcement Learning and Attack Graphs

Tyler CodyarXiv 2022

Abstract: This paper considers key challenges to using reinforcement learning (RL) with attack graphs to automate penetration testing in real-world applications from a systems perspective. RL approaches to automated penetration testing are actively being developed, but there is no consensus view on the representation of computer networks with which RL should be interacting. Moreover, there are significant open challenges to how those representations can be grounded to the real networks where RL solution methods are applied. This paper elaborates on representation and grounding using topic challenges of interacting with real networks in real-time, emulating realistic adversary behavior, and handling unstable, evolving networks. These challenges are both practical and mathematical, and they directly concern the reliability and dependability of penetration testing systems. This paper proposes a layered reference model to help organize related research and engineering efforts. The presented layered reference model contrasts traditional models of attack graph workflows because it is not scoped to a sequential, feed-forward generation and analysis process, but to broader aspects of lifecycle and continuous deployment. Researchers and practitioners can use the presented layered reference model as a first-principles outline to help orient the systems engineering of their penetration testing systems.

Introduction

In the field of AI-driven cybersecurity, "grounding" is the critical challenge of ensuring an agent's internal mathematical representation of the world accurately matches physical reality. For automated penetration testing, researchers typically employ attack graphs—maps of potential exploit paths—to train reinforcement learning (RL) agents. However, a significant disconnect persists between these abstract models and the messy, evolving nature of production networks.

This paper identifies three primary hurdles to effective grounding: the difficulty of real-time interaction with live systems, the need for realistic adversary behavior modeling beyond simple shortest-path finding, and the inherent instability of networks that change faster than an agent can learn. To address these, the authors introduce LRM-RAG, a layered reference model designed to bridge the gap between abstract RL agents and real-world computer networks.

The LRM-RAG Framework

Instead of treating attack graph generation as a monolithic, one-off process, LRM-RAG breaks the system into four distinct layers of abstraction. This structure allows researchers to isolate specific engineering problems without losing sight of the overall system lifecycle.

  1. Layer 1: Real Network Processes: This layer includes the actual hardware/software and the network interface (automated or human-operated) used to interact with the live environment.
  2. Layer 2: Attack Graph Generation: This provides structural abstraction, defining the network topology and vulnerabilities to create a comprehensive map of potential threats.
  3. Layer 3: MDP Construction: This layer introduces behavioral abstraction. The static map is converted into a Markov Decision Process (MDP) by adding transition probabilities and rewards. It introduces concepts like "Cyber Terrain" (e.g., firewalls as obstacles) and Adversary Profiles.
  4. Layer 4: Machine Learning: The top layer houses the RL agent and meta-learning processes that allow the system to adapt to new tasks or changing network conditions.
The LRM-RAG model illustrates the hierarchy from real network processes to abstract machine learning agents.

Key Insights and System Realism

A core contribution of this work is the identification of the "Needle-in-a-Haystack" Fallacy. Traditional attack graph generation often strives for exhaustiveness, which can create a computational bottleneck for RL agents. The authors argue that agents do not need to find every possible path, but rather the most realistic ones.

Furthermore, the model distinguishes between Terrain MDPs (general network constraints) and Task MDPs (specific mission goals). This separation is vital for Transfer Learning, enabling an agent to apply knowledge of a network's "terrain" to entirely new objectives.

Finally, the paper addresses the rate differential problem: in modern software-defined networks (SDNs), the environment may change in seconds, while generating a new attack graph can take minutes. This leads to "stale grounding," a challenge that requires RL agents capable of learning effectively under unstable conditions.

Literature Analysis and Scalability

To contextualize the LRM-RAG model, the paper provides a meta-analysis of existing literature, highlighting that current research is heavily focused on Layer 3 (MDP construction) while often neglecting the complexities of Layer 1 (the actual network interface).

A summary of existing literature categorized by network size, task, and model type, highlighting the diversity of current research.

The analysis also reviews the computational complexity of various generation methods. While some older methods are exponential ($O(2^n)$), newer approaches like NetSPA have achieved log-linear growth ($O(n \log n)$), which is essential for scaling automated penetration testing to real-world enterprise networks.

Conclusion

LRM-RAG serves as a first-principles outline for the systems engineering of penetration testing platforms. By moving toward a "heterarchical" view that accounts for continuous deployment and the system lifecycle, the model provides a roadmap for closing the "actuation gap"—the translation of RL decisions back into real-world network commands. Future work must focus on integrating meta-learning more deeply to handle the dynamic grounding required by modern, unstable network environments.

Summary updated

BibTeX
@misc{cody2022layered,
  author = {Tyler Cody},
  title = {{A Layered Reference Model for Penetration Testing with Reinforcement Learning and Attack Graphs}},
  year = {2022},
  eprint = {2206.06934},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2206.06934},
}
Figure