ThreatPlaybook - Guide
Installation Instructions and QuickStart for ThreatPlaybook
This is still a pre-release version and might be buggy :) However, we encourage you to use it. Please let us know if you need any help with this
Installation
Components Required
MongoDB 3.X
Python 2.7 (Sorry this is still not 3.0 because several important libs in Robot Framework don't support Py3)
Robot Framework Libs as required
Mermaid CLI (for Diagrams)
Mermaid CLI is a Node application and needs to be installed with the instructions given here: https://github.com/mermaidjs/mermaid.cli
I'd highly recommend that you install Mermaid CLI globally with:
npm install -g mermaid.cli
Installation
Create
virtualenv
in the directory you want to run ThreatPlaybook inMake sure that MongoDB is installed and running
Install ThreatPlaybook by running
pip install ThreatPlaybook
Once ThreatPlaybook is installed, you need to run a command to create some boilerplate directories and files for your project. These would be the directories and files you need to capture Use Cases, Abuse Cases, Threat Models and so on
To create the boilerplate, run the following:
threat-playbook <ProjectName>
This creates the following directories in the current working directory with some boilerplate yaml files and a single robot Test Suite file
Your Folder Structure must look like this:
Now you are ready to start. Let's understand some of the key files and components you need for this
Key Components
.robot Test Suite
This is the Test Suite file that will run all the test cases within the file and produce the desired outputs. Nearly all the outputs are stored in the MongoDB instance that you have setup.
This is the file that robot framework will use to run the:
processing of various threat models, security test cases, abuse cases and user stories
run automation of different security tools (with Robot Libraries) like Zap, Burp, Nmap, etc
Basically, this is the file that controls the entire flow of ThreatPlaybook for your project
Resources
Please see the example TestRobot.robot for additional references.
Consider learning Robot Framework with a quick Robot Framework Tutorial
entities_connections.yml
This file captures all the entities and their connections. Entities are any elements or objects that you would use to capture process flows in your Threat Model. Entities are typically functionality/pages/features within the application. They are connected to other features and functions and data flows and there's data shared between these entities
For example, below is a simple process flow in an application that is used for Expense Management Application
User logs in (Login Feature) => Dashboard(Feature) => Add Expenses (Feature) => Upload Expense File(Feature)
Details of all the entities and connections of the entities are captured in this yaml file.