Leonidas is a framework for executing attacker actions in the cloud. It provides a YAML-based format for defining cloud attacker tactics, techniques and procedures (TTPs) and their associated detection properties. These definitions can then be compiled into:
- A web API exposing each test case as an individual endpoint
- Sigma rules (https://github.com/Neo23x0/sigma) for detection
- Documentation – see http://detectioninthe.cloud/ for an example
Deploying the API
The API is deployed via an AWS-native CI/CD pipeline. Instructions for this can be found at Deploying Leonidas.
Using the API
The API is invoked via web requests secured by an API key. Details on using the API can be found at Using Leonidas
Installing the Generator Locally
To build documentation or Sigma rules, you’ll need to install the generator locally. You can do this by:
Generating Sigma Rules
Sigma rules can be generated as follows:
poetry run ./generator.py sigma
The rules will then appear in
The documentation is generated as follows:
poetry run ./generator.py docs
This will produce markdown versions of the documentation available at
output/docs. This can be uploaded to an existing markdown-based documentation system, or the following can be used to create a prettified HTML version of the docs:
This will create a
output/site folder containing the HTML site. It is also possible to view this locally by running
mkdocs serve in the same folder.
The definitions are written in a YAML-based format, for which an example is provided below. Documentation on how to write these can be found in Writing Definitions
name: Enumerate Cloudtrails for a Given Region
author: Nick Jones
An adversary may attempt to enumerate the configured trails, to identify what actions will be logged and where they will be logged to. In AWS, this may start with a single call to enumerate the trails applicable to the default region.
aws cloudtrail describe-trails
result = clients["cloudtrail"].describe_trails()
- name: "cloudtrail"
eventSource: "*.cloudtrail.a mazonaws.com"
This project drew ideas and inspiration from a range of sources, including: