Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
Machine Learning for Accessible Threat Modeling Based on Software Requirements
Blekinge Institute of Technology, Faculty of Computing, Department of Computer Science.
Blekinge Institute of Technology, Faculty of Computing, Department of Computer Science.
2025 (English)Independent thesis Advanced level (professional degree), 20 credits / 30 HE creditsStudent thesis
Abstract [en]

Background. Threat modeling is a proven way to prevent costly software vulnerabilities, yet many teams postpone or skip it because manual analysis demands security expertise, time,and money which are in scarce supply. Recent advances in large language models(LLMs) and retrieval-augmented generation (RAG) suggest that portions of this effort could be automated by reasoning directly over natural-language requirements such as user stories.

Objectives. This thesis investigates whether an accessible, ML-powered tool can extract action-able security threats from natural language user stories, surface risks that human experts might overlook, and do so with enough accuracy and speed to be useful in an agile workflow.

Methods. Following Design Science Research, a two-step artifact was built: a lightweight classifier filters security-irrelevant user stories, after which a RAG-grounded LLM maps the remaining stories to threat database techniques and mitigations. The tool was evaluated on two open-source web projects (51+55 user stories) through quantitative metrics-precision, Exclusive Discovery Rate and qualitative review by a security professional.

Results. The best pipeline achieved 83% precision and a 9% Exclusive Discovery Rate, meeting all SMART targets while analyzing 51 user stories in under three minutes on consumer hardware. In several cases the model identified subtle credential-access and discovery vectors initially missed by the expert.

Conclusions. Grounded LLMs can reliably transform textual requirements into early-phase threat models, acting as a “second pair of eyes” that lowers the cost and cognitive load of secure-by-design development. While expert validation remains essential, integrating such tools into sprint rituals promises faster, broader, and more consistent threat coverage; future work should generalise beyond web systems and explore interactive,explainable workflows.

Abstract [sv]

Bakgrund. Hotmodellering är ett effektivt sätt att motverka dyra sårbarheter i mjukvara, mentas ofta inte på det allvar som behövs. Ofta skjuts det upp, eller ignoreras fullständigt då det krävs tid, pengar och skicklighet för att utföra ett bra arbete. Medhjälp av den stora utvecklingen som skett inom Large Language Models (LLMs) ochRetrieval-Augmented Generation (RAG) så undersöker vi om det är möjligt att utföra effektiv hotmodellering utifrån User Stories med hjälp av LLM-verktyg, och påså sätt göra hotmodellering mer lättillgängligt.

Syfte. Denna avhandling undersöker om det är möjligt och lämpligt att med hjälp av ett ML-baserat hjälpmedel utföra hotmodellering. Kan ett ML-baserat verktyg hitta och resonera kring möjliga hot med enbart informationen som finns i ett projekts User Stories, och göra detta med tillräcklig precision för att användas i utveckling?

Metod. I enlighet med Design Science Research tillverkades en produkt. Denna produktbestår av två delar: en klassificerare som filtrerar ut User Stories som inte är relevanta för säkerhet, och en LLM som med hjälp av RAG länkar User Stories tillmöjliga attack tekniker från en hotdatabas. Verktyget evaluerades på två projekt med öppen källkod, vilka tillsammans har 106 User Stories. För kvantitativ evaluering användes Precision och Exclusive Discovery Rate (EDR). Kvalitativ evaluering utfördes av en säkerhetsexpert.

Resultat. De bästa resultaten som uppnåddes var 83% precision, och 9% EDR. Detta innebäratt verktyget nådde alla SMART-mål uppsatta på en analys av 51 user stories, vilket tog mindre än tre minuter på konsumenthårdvara. Det förekom flera fall då verktyget identifierade hot som säkerhetsexperten till en början hade missat.

Slutsatser. LLM:er med RAG kan på ett tillförlitligt sätt hämta information från User Stories och använda denna information för att hitta möjliga hot i ett projekts tidiga skede,och kan användas för att lätta det kognitiva arbetet som krävs av en expert som utför hotmodellering. Validering från mänskiga experter är fortfarande nödvändigt, men verktyg som detta skulle kunna användas för att förbättra kvaliteten på hot-modellering i många utvecklingsprojekt.

Place, publisher, year, edition, pages
2025. , p. 46
Keywords [en]
Machine Learning, Requirements Engineering, Threat Modeling, Cybersecurity
Keywords [sv]
Maskininlärning, Requirements Engineering, Hotmodellering, Cybersäkerhet
National Category
Artificial Intelligence Security, Privacy and Cryptography Information Systems
Identifiers
URN: urn:nbn:se:bth-28182OAI: oai:DiVA.org:bth-28182DiVA, id: diva2:1975130
External cooperation
Knowit Cybersecurity & Law
Subject / course
Degree Project in Master of Science in Engineering 30,0 hp
Educational program
DVADS Master of Science in Engineering: Computer Security
Supervisors
Examiners
Available from: 2025-06-24 Created: 2025-06-23 Last updated: 2025-09-30Bibliographically approved

Open Access in DiVA

fulltext(11195 kB)844 downloads
File information
File name FULLTEXT01.pdfFile size 11195 kBChecksum SHA-512
6c9505e84cb62587e54900bc086343a10b44bd4a9104abeb87d24d8da2381cdbca74a5ab28e0fa54c0a55aebe51d144001ca576e6b43b9c5503b887e46ae493d
Type fulltextMimetype application/pdf

Search in DiVA

By author/editor
Karlsson, MarkusJohansson, Daniel
By organisation
Department of Computer Science
Artificial IntelligenceSecurity, Privacy and CryptographyInformation Systems

Search outside of DiVA

GoogleGoogle Scholar
Total: 844 downloads
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

urn-nbn

Altmetric score

urn-nbn
Total: 208 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf