Analysis results and exports
SPARTA shows the threats it elicits for a model, together with their estimated risk, in the ThreatAnalysis view. You can export the results to a CSV file, an Excel workbook (XLSX) or a LaTeX report. This page describes the analysis, the view and the exports in detail. For the meaning of the risk values and how SPARTA computes them, see How SPARTA computes risk.
Running an analysis
In the SPARTA perspective, the ThreatAnalysis view is located to the right of the editor area, in a tab next to the PatternSupport view. If you closed it, reopen it through and select the view ThreatAnalysis in the category ThreatAnalysis. also restores it.
To analyze a model:
Open the DFD model in an editor: either a Data Flow Diagram or the SPARTA Model Editor (the tree editor).
Make sure that editor is the active editor. In the tree editor, select an element of the DFD model.
Select , press Ctrl+Alt+A (Cmd+Alt+A on macOS), or click
in the main toolbar or in the toolbar of the ThreatAnalysis view.
SPARTA analyzes the model of the active editor only. For a diagram, this is the model file that contains the diagram’s DFD model; for the tree editor, it is the file of the selected element. The model must be a file in a workspace project. The view shows one analysis at a time: a new analysis first discards the previous one, so the table is empty and the exports are disabled until the new analysis has finished.
The analysis runs in the background as the job Loading SPARTA threat analysis.
You can keep working while it runs; its progress appears at the bottom right of the window.
To stop it, click that progress indicator, which opens the Progress view, and click the red stop button next to the job.
A cancelled analysis shows no results.
Running Load and Analyze Model again, or Clear Analysis Engine, also stops an analysis that is still running.
When the analysis has finished, the ThreatAnalysis view lists the threats and the exports are enabled.
What is analyzed
The analysis covers the model file itself plus every file that the model references directly. Typically these are the threat type catalogs, attacker models, data models and solution catalogs listed in the DFD model’s Resource property. A catalog or attacker model that the DFD model does not reference is ignored, even if it is in the same project.
Threats are elicited from the threat types in the referenced threat type catalogs: from their threat patterns (see Writing threat type patterns) and from the legacy key-based threat type definitions.
Risk is calculated with every attacker profile in the referenced attacker models. If there is no attacker profile at all, SPARTA uses a built-in default profile (see Defaults when information is missing).
Note
In SPARTA 2026.3, the Enabled property and threat specifications have no effect on threats from threat patterns, neither on the threat type nor on its groups: every threat type with threat patterns in scope is used. Enabled is also ignored for attacker profiles: every attacker profile in scope is used. They only affect the legacy key-based threat types.
If the PatternSupport view is open, Load and Analyze Model also lists the threat patterns that could not be parsed in that view, so you can see why a threat type produces no threats (see PatternSupport View).
Problems during an analysis
If SPARTA cannot start the analysis, a dialog titled Load and Analyze Model says why:
No active editor found. Open a SPARTA model or diagram editor first.The active editor does not show a SPARTA model. Open a SPARTA model or diagram editor first.The model could not be analysed., with the reason under Details, for example<model> is not a resource in the workspace. Open the model from a workspace project to analyse it.
If the analysis itself fails, an error dialog Problem Occurred says that 'Loading SPARTA threat analysis' has encountered a problem., followed by the message The analysis engine could not analyse <model>: <reason>, and the ThreatAnalysis view stays empty.
SPARTA writes the following problem to the Eclipse error log, without showing a dialog:
Risk calculation failed for threat on '<element>'SPARTA could not calculate the risk of a threat on that element, for example because an estimate is invalid (see Estimates). The threat is listed, but its risk values are
0. Export Threats to CSV and Export Threats to XLSX fail for such a threat (see Exporting results).
To see these entries, open the Error Log view with and select Error Log in the category General. Double-click an entry to see the cause. The reasons that the error dialogs above show are also written to the error log.
If the ThreatAnalysis view stays empty or lists fewer threats than you expect, without an error dialog, see Known limitations in 2026.3.
Note
In SPARTA 2026.3, opening a diagram writes errors to the error log that have nothing to do with your model: Failed to read system packages for JavaSE-9 up to JavaSE-20 (plug-in org.eclipse.pde.build), each with the detail Failed to init ct.sym for ... (plug-in org.eclipse.jdt.core).
They come from the Java runtime that the SPARTA application includes, and you can ignore them.
When SPARTA discards an earlier analysis, which Load and Analyze Model and Clear Analysis Engine do, it can also write a series of errors Erroneous removal of unattached notification adapter from notifier ... (plug-in org.eclipse.viatra.query.patternlanguage.emf.ui); they do not affect the results, and you can ignore them as well.
The ThreatAnalysis view
The ThreatAnalysis view (right) with the analysis results of an example model.
The view consists of a toolbar, a summary header and the threat table.
Toolbar
The view toolbar contains five buttons; their names appear as tooltips. The same commands are in the SPARTA menu and in the main toolbar, which also work while the view is closed.
Load and Analyze ModelAnalyzes the model of the active editor (see Running an analysis).
Clear Analysis EngineDiscards the current analysis (see Clearing the analysis).
Export Threats to CSVWrites all threats to
threats.csv(see Exporting threats to CSV and XLSX).
Export Threats to XLSXWrites all threats to
threats.xlsx(see Exporting threats to CSV and XLSX).
Export Threat ReportWrites a LaTeX threat analysis report (see Exporting a LaTeX report).
The view has no context menu and no view menu. If you open the view after an analysis, it shows the current results.
Risk summary header
The header above the table summarizes all listed threats.
- Threatcount:
The number of threats (rows) in the table.
- Risk reduction progress:
The sentence “X of total risk Y reduced.”, where X is the mitigated annualized risk and Y the total annualized risk below, with a progress bar that shows X relative to Y.
- Mitigated annualized risk:
Total risk minus residual risk: the risk that the applied solutions remove.
- Total annualized risk:
The sum of the potential risk of all threats: the risk if no countermeasure applied to any threat.
- Residual annualized risk:
The sum of the risk of all threats, taking the countermeasures of the applied solutions into account (the sum of the Risk column).
- Maximum single loss event:
The largest value in the SLE (Single Loss Event) column.
The header is updated when threats appear or disappear and when SPARTA recalculates threats (see When results are updated).
Threat table
The table contains one row per elicited threat. Its columns, from left to right:
- Location
The name of the threatened DFD element.
- Type
The name of the top-level threat type group that contains the threat type (or the threat type’s own name if it is not in a group), with placeholders replaced, for example
SpoofingorTamperingin a STRIDE catalog, orLinkingin a LINDDUN catalog.- Name
The name of the threat type, with its placeholders (such as
<$location$>) replaced by the names of the matched model elements. For example,<$location$> SpoofedbecomesWeb App Spoofed.- Flow
The name of the data flow where the threat occurs. It is empty for threats whose pattern has no data flow, such as the patterns of a STRIDE-per-element catalog.
- Risk
The expected residual risk per year, taking applicable countermeasures into account, in the unit of your loss estimates (for example EUR).
- SLE (Single Loss Event)
The expected loss of a single loss event (the median of the sampled loss magnitude), in the unit of your loss estimates.
- Vulnerability
The probability, between 0 and 1, that an attack succeeds against the applicable countermeasures. It is
1when no countermeasure applies.- LEF (Loss Event Frequency)
The expected number of loss events per year.
- Description
The description of the threat pattern, with its placeholders replaced, or
Description missing.if the pattern has none.
When several attacker profiles apply, or the threatened element processes personal data, a threat’s risk consists of several components (see How SPARTA computes risk). Risk and SLE (Single Loss Event) are the sum over these components; Vulnerability and LEF (Loss Event Frequency) are averages. The lower and upper bounds of the risk are not shown in the table; the CSV and XLSX exports contain them.
Row colors
Each row has a background color that reflects the threat’s Risk relative to the largest potential risk among all listed threats: green for a risk of 0, orange for half of the largest potential risk, and red for the largest potential risk, with gradual transitions in between. Because the scale is based on potential risk rather than residual risk, a threat whose risk is fully mitigated turns green.
Sorting and arranging columns
Click a column header to sort the table by that column. Successive clicks on the same header sort ascending, then descending, and then restore the original order. The numeric columns sort by value, not by the displayed text; the text columns sort alphabetically (case-sensitive).
Note
Each Load and Analyze Model and each recalculation gives slightly different risk values, because SPARTA draws new random samples for every calculation (see How SPARTA computes risk and When results are updated). Threats with similar risk can therefore swap places in a sorted table.
You can drag the headers of all columns except Location to reorder the columns. The sort order and column order only affect the view; the exports do not use them.
Threat details
Double-click a row to open a dialog titled <Name> threat with details about the threat.
If the threat pattern has a description, the dialog shows:
Type: <Type>
Threat: <Name>
Description: <description>
Risk: <Risk>
Vulnerability: <Vulnerability>
Single Loss Event: <SLE>
Info: <long description>
Clearing the analysis
Clear Analysis Engine discards the current analysis: it stops an analysis that is still running, empties the table, resets the summary header, and stops following your edits of the model (see When results are updated).
After clearing, there are no results to export, so the exports are disabled.
When results are updated
After Load and Analyze Model, the threat list follows your edits to the DFD model: when you add, remove or reconnect elements and flows, in the diagram or in the tree editor, matching threats appear in or disappear from the table.
SPARTA also recalculates the risk of the listed threats that an edit affects, without analyzing the model again. Threats that the edit does not affect keep their values. The summary header and the row colors follow the recalculated values.
When SPARTA notices an edit depends on where you make it:
Edits in the diagram that you analyzed, including its Properties view, take effect right away.
Edits in the tree editor of the model file take effect when you save the file.
Edits in other files, for example in the editor of a solution catalog, do not take effect, also not after you save them: run Load and Analyze Model again.
What SPARTA recalculates depends on what you change:
SPARTA recalculates a threat when you change one of its inputs: the threatened element, the data flow with its sender and recipient, the other model elements that the threat pattern matched (including what they contain, such as their estimates), the threat type and its groups, and the role bindings on the involved elements with their roles and the countermeasures of those roles. For example, when you apply a solution, bind a role or change an estimate, SPARTA recalculates the threats concerned.
When you edit an attacker model or attacker profile, a data subject type or a data type, SPARTA recalculates all threats.
When you only change the name or description of a model element, SPARTA recalculates no threats.
Changes to the threat patterns of a catalog, and catalogs or attacker models that you add to the Resource property after Load and Analyze Model, are not picked up until you run Load and Analyze Model again.
Changed in version 2026.3: The risk of the threats affected by an edit is recalculated immediately; before, you had to run Load and Analyze Model again after changing estimates, solutions, role bindings or attacker profiles.
Exporting results
SPARTA offers three exports: a CSV file and an Excel workbook (XLSX) with all threats, and a LaTeX report. Start them from the SPARTA menu, the main toolbar or the toolbar of the ThreatAnalysis view (see Toolbar). All exports work the same way:
They export all threats of the current analysis, so run Load and Analyze Model first. The exports are disabled until an analysis has finished, and after Clear Analysis Engine.
They write into the project that contains the analyzed model, without asking for a location, and replace earlier output (except
report.texandintroduction.tex, see Generated files).They export the current risk values, including those that SPARTA recalculated after your edits (see When results are updated).
After an export, SPARTA refreshes the exported file or folder in the workspace and shows a dialog with its location, for example CSV export complete with the message
12 threat(s) exported to: /webshop/threats.csv, XLSX export complete with12 threat(s) exported to: /webshop/threats.xlsx, or Report export complete withThreat report exported to: /webshop/report.If an export fails, an error dialog shows the reason: CSV export failed with the message
Could not write threats.csv: <reason>, XLSX export failed withCould not write threats.xlsx: <reason>, or Report export failed with the messageCould not export the report: <reason>. The error is also written to the Eclipse error log (see Problems during an analysis).
Warning
In SPARTA 2026.3, Export Threats to CSV and Export Threats to XLSX fail when the risk calculation of a threat failed (see Problems during an analysis).
The export writes a threats.csv or threats.xlsx that only contains the column headers, without any threat, and shows none of the dialogs described above.
The error log contains Command '...csvexport' failed (or ...xlsxexport) with the cause risk not yet calculated for this threat.
Fix the cause that the error log shows, or use Export Threat Report, which shows -- as the risk of such a threat.
The command-line tool sparta-cli can also export analysis results, including the LaTeX report, per-threat text files and threat statistics. See Command-line tools.
Exporting threats to CSV and XLSX
Click
Export Threats to CSV to write all threats to the file threats.csv, or
Export Threats to XLSX to write them to the Excel workbook threats.xlsx.
Both files are written to the root folder of the project that contains the analyzed model, also when the model is in a subfolder.
An existing file is overwritten without confirmation.
Both files contain the same columns, and one row per threat, in the order in which SPARTA found the threats (not the order of the table).
Added in version 2026.3: Export Threats to XLSX.
The columns, in order:
Column |
Content |
|---|---|
|
The top-level threat type group (or the threat type itself if it is not in a group), as in the Type column of the view. |
|
The threat type name with placeholders replaced, as in the Name column. |
|
The name of the threatened DFD element. |
|
The name of the sender of the data flow. Empty for threats without a data flow. |
|
The name of the data flow. Empty for threats without a data flow. |
|
The name of the recipient of the data flow. Empty for threats without a data flow. |
|
The expected vulnerability, between 0 and 1. |
|
The expected residual risk, as in the Risk column. |
|
The lower bound of the residual risk. |
|
The upper bound of the residual risk. |
|
The expected potential risk: the risk if no countermeasure applied. |
|
|
|
The smallest number of trust boundaries that enclose the sender or the recipient of the data flow, or, for a threat without a data flow, the number of trust boundaries that enclose the threatened element.
|
|
The largest such number. |
|
The name of the DFD element that directly contains the sender: a trust boundary or a decomposed element. Empty when the sender is not inside another DFD element, and for threats without a data flow. |
|
The same for the recipient. |
|
The names of all trust boundaries that enclose the sender, outermost first, separated by |
|
The same for the recipient. |
|
The solutions whose countermeasures the risk calculation of the threat took into account, separated by |
Added in version 2026.3: The columns from Crosses Trust Boundary to Mitigating Solutions.
The CSV file has the following format:
The first line is a header with the column names; then follows one line per threat.
Fields are separated by semicolons (
;), and every field, including the header names, is enclosed in double quotes. A double quote inside a value is written twice (""), so values may contain"and;.A value that starts with
=,+,-,@, a tab or a carriage return gets a leading apostrophe (for example'=1+2), so that a spreadsheet application does not run it as a formula.Numbers have a period as decimal separator, no thousands separator, and up to four decimals, for example
12345.6789, whatever the locale of your system.The file is written in UTF-8 without a byte order mark, with the line endings of your operating system.
Changed in version 2026.3: Numbers are written without thousands separator (12345.6789 instead of 12,345.6789), and values that start with a formula character get a leading apostrophe.
For example (illustrative values):
"Type";"Name";"Location";"Flow From";"Data Flow";"Flow To";"Vulnerability";"Risk";"Risk (lower)";"Risk (upper)";"Risk (potential)";"Crosses Trust Boundary";"Trust Boundary Depth (min)";"Trust Boundary Depth (max)";"Flow From Parent";"Flow To Parent";"Flow From Trust Boundaries";"Flow To Trust Boundaries";"Mitigating Solutions"
"Information Disclosure";"Data flow login is sniffed";"login";"Browser";"login";"Web App";"1";"12345.6789";"1002.5";"98765.4321";"12345.6789";"true";"0";"1";"";"Internal";"";"Internal";""
When you open the file in a spreadsheet application, choose the semicolon as separator and a locale that uses a period as decimal separator, such as English (United States).
The XLSX workbook contains one worksheet, without formatting.
The first row contains the column names; then follows one row per threat.
Numbers are numeric cells with the full calculated value, Crosses Trust Boundary is a boolean cell, and the other values are text cells.
Exporting a LaTeX report
Click
Export Threat Report to generate a threat analysis report as LaTeX sources.
SPARTA writes the files into the folder report in the root of the project that contains the analyzed model and creates that folder if needed.
All .tex files are written in UTF-8.
You then complete the report and compile it with LaTeX yourself.
If an error occurs, the export stops and shows the error dialog Report export failed; the files written before the error stay in the folder.
Generated files
SPARTA writes the following files to the folder report:
report.texThe main document: title page, table of contents, and the chapters below.
introduction.texThe chapter “Introduction”, with placeholder text for you to replace.
description.texThe chapter “System description”, with the data flow diagram of the model (see Data flow diagram).
threatcatalog.texThe chapter “Threat catalog” with all threats.
tufte-book-local.texPackage loading, styles and title page layout for the document class.
SPARTA.pngThe SPARTA logo for the title page.
tikz/dfdstyle.tex,tikz/flow_template.tex,tikz/styles.texTikZ styles for the diagrams.
On a later export, SPARTA regenerates all files except report.tex and introduction.tex.
Once these two exist, SPARTA never overwrites them: it writes the fresh templates to report-empty.tex and introduction-empty.tex instead, and overwrites those on every later export.
You can therefore edit report.tex and introduction.tex and export again later without losing your changes.
To start again from the templates, delete report.tex or introduction.tex before exporting.
Do not edit description.tex, threatcatalog.tex or the support files: the next export overwrites them.
Report structure
The report uses the tufte-book document class on A4 paper and contains:
a title page with the title “Threat Analysis Report”, the SPARTA logo and the publisher line “SPARTA Threat Modeling Tool”;
a page with the SPARTA website URL and “Version 1” with the month and year of compilation;
the table of contents;
the chapter “Introduction” (
introduction.tex);the chapter “System description” (
description.tex), with the section “Diagrams”;the chapter “Threat catalog” (
threatcatalog.tex).
The threat catalog has one section per top-level threat type group (the Type column), in the order in which the groups first occur in the analysis. Each section has one subsection per threat, sorted by descending risk. A threat’s subsection contains:
a small diagram of the data flow, from sender to recipient, with the threatened element (or the arrow, if the threat is located at the flow) drawn in red; for a threat without a data flow, only the threatened element, in red;
a description list with “Type”, “Summary” (the threat description), “DFD Elements” (the sender, data flow and recipient), “Affected element” (the threatened element) and “Risk” (the expected residual risk with up to four decimals, a period as decimal separator and no thousands separator, for example
1234.5679).
If the risk calculation of a threat failed (see Problems during an analysis), “Risk” shows --, and the threat is sorted as if its risk were 0.
Changed in version 2026.3: “Risk” is rounded to four decimals; before, it was written in full, and large or very small values in scientific notation.
Data flow diagram
The section “Diagrams” of the chapter “System description” shows the data flow diagram of the analyzed DFD model, drawn with TikZ and scaled to the width of the text.
SPARTA takes the positions of the elements from the first .aird file that it finds in the project of the analyzed model, so the diagram looks like the Data Flow Diagram that you arranged:
If the
.airdfile contains several diagrams, SPARTA uses the one with the most positioned elements.Elements without a position in that diagram are left out.
The subsection title is the name of the DFD model, not the name of the diagram.
If the project has no .aird file, SPARTA cannot read it, or it contains no diagram, SPARTA computes a layout of its own, which is the same on every export.
If none of the positioned elements belongs to the analyzed model, the report has no section “Diagrams”.
The report contains only this one data flow diagram.
Completing the report
Before you compile the report for others, edit the following:
In
report.tex, set\title{...}.\author{Author Name}is a placeholder; the title page does not print the author.In
introduction.tex, replace the line “TODO: provide a short description of the threat model.”. The introduction also refers tosec:model,sec:goalsandsec:threats, which no generated file defines, so these references appear as “??”. Remove or adjust these sentences.Add your own system description, for example to
introduction.texor to a file of your own that you include fromreport.tex, becausedescription.texis regenerated on every export.
Compiling the report
Compile report.tex in the report folder with pdfLaTeX, and run it twice so that the table of contents and cross-references are resolved:
cd report
pdflatex report.tex
pdflatex report.tex
The label of a threat subsection is threat- followed by the model ID of the threatened element, with every character other than a letter or digit replaced by a hyphen, for example \label{threat-mZxy8Mk7EeeheeqXVGLgxA}.
XeLaTeX (xelatex report.tex) works as well. LuaLaTeX does not: it stops at the title page with the error Argument of \MakeTextUppercase has an extra }.
The report needs the following LaTeX packages, all of which are part of a full TeX Live installation:
the
tufte-latexbundle, which provides thetufte-bookclass (it loadstufte-book-local.texautomatically);FiraSans,tikz,booktabs,graphicx,fancyvrb,xspace,mdframed,enumitem,multirow,adjustbox,cleveref,pdfprivacyandifxetex;fontspec, when you compile with XeLaTeX.
The warnings about the undefined references sec:model, sec:goals and sec:threats are expected until you edit introduction.tex.
Known limitations in 2026.3
The Enabled property and threat specifications have no effect on threats from threat patterns, and Enabled is ignored for attacker profiles (see What is analyzed).
Export Threats to CSV and Export Threats to XLSX fail, without a dialog, when the risk calculation of a threat failed (see Exporting results).
The PatternSupport view stays empty if you show it for the first time after an analysis, and Clear Analysis Engine does not empty it (see PatternSupport View).
After you analyzed another model in the same session, Load and Analyze Model can leave the ThreatAnalysis view empty or list only part of the threats, without an error dialog. Running the analysis again does not help. Restart SPARTA with and run Load and Analyze Model again.
In the LaTeX report, the labels of the threat subsections are derived from the threatened element, so several threats on the same element cause “multiply defined” label warnings.
In the LaTeX report, “DFD Elements” of a threat without a data flow shows only the separators (
, ,).