Write or edit JavaScript in the editor on the left and annotate the code with ThreatSpec tags. Then run Parse & Report to generate the HTML report on the right. You can also view the intermediate JSON file.
The \ character can be used to split the DESCRIPTION, MITIGATION, EXPOSURE, TRANSFER and ACCEPTANCE values into multiple lines for readability. Multiple lines are joined together into a single value.
REFERENCES are optional and must enclosed by ( ). Multiple REFERENCES are supported using comma separation.
Developers, QA, operations, and security engineers work closely together reviewing and annotating code with threat modeling metadata. This can even apply to Infrastructure as Code.
Use a parser to turn ThreatSpec code annotations into an intermediate JSON file. You'd probably want to make this part of your build pipeline and then publish the JSON files somewhere.
Run a report against one or more intermediate JSON files, even if they originate from different languages. Use the reports to further guide your threat modelling. You could even display the current report in your SOC.
More languages to come...
More reporting tools coming soon
ThreatSpec is an open source project that aims to close the gap between development and security by bringing the threat modelling process further into the development process. This is achieved by having developers and security engineers write threat specifications alongside code, then dynamically generating reports and data-flow diagrams from the code.
Security testing is shifting left, from annual pentests to the realm of unit testing and test-driven development, by taking advantage of automation and agile practices. ThreatSpec is an attempt to continue the evolution.
For a fully comprehensive introduction to threat modelling, check out the book Threat Modeling: Designing for Security by Adam Shostack.
This topic was presented at the DevSecCon conference in London in October 2015.
The slides are available on SlideShare.
If you have an idea, suggestion, criticism or any other feedback regarding ThreatSpec or code-driven threat modelling in general, get in touch! If you'd like to write a parser or reporting tool in your favourite language, we'd also love to hear from you.