Advanced concepts in SPARTA
This section explains the full SPARTA meta-model. These concepts are mainly relevant if you are programmatically processing models, writing threat type patterns, or extending SPARTA. For the modeling concepts from a user’s perspective and the exact risk calculation, see Concepts used in SPARTA.
The meta-model is an EMF Ecore model with the following identifiers:
EPackage
spartamodel, namespace URIhttp://distrinet.cs.kuleuven.be/spartamodel, namespace prefixspartamodel.Generated Java package
be.kuleuven.cs.distrinet.sparta.spartamodel, withSpartaModelPackageandSpartaModelFactory.Models are stored as XMI in files with the extension
.sparta. The model plug-in registers its resource factory for.spartaand the older.securitydfd; the tree editor and the command-line tools also open.spartamodelfiles, but.spartais the usual extension.The model code lives in the plug-in
be.kuleuven.cs.distrinet.sparta.spartamodel, the item providers inbe.kuleuven.cs.distrinet.sparta.spartamodel.edit, and the tree editor inbe.kuleuven.cs.distrinet.sparta.spartamodel.editor.
SPARTA DFD Meta-Model
SPARTA DFD Meta-Model concepts
- ModelElement
The abstract base class of almost every concept in SPARTA, including the DFDModel itself, all DFD elements, catalogs, threat types and solutions. (Older documentation, and the documentation strings inside the meta-model, call it DFDModelElement.)
It has the following features:
name(EString): Label shown in the editors and in analysis results.description(EString): Free text.id(EString): The EMF ID attribute, so it should be unique within a file. Threat types are also referenced by theiridfrom estimates (lossMagnitudeByID) and countermeasures (mitigatedThreatTypeID). These references are plain strings, so they match threat types in every catalog that the analyzed model contains or references. Give threat types and groups ids that are unique across all those catalogs.annotations(IModelElementAnnotation[0..*], containment): Generic annotations, see below.
- Model element annotations
Every ModelElement can carry annotations through the interface IModelElementAnnotation, whose operation
getAnnotation()returns the annotation as a string. Threat type patterns can leverage annotations to identify threats based on specific situations in the system model (see Writing threat type patterns). There are two concrete kinds:ModelElementAnnotation has a single
value(EString[1..1]);getAnnotation()returns the value.KVModelElementAnnotation has a
keyand avalue(each EString[1..1]);getAnnotation()returnskey:value.
These annotations are a different mechanism from the DFDElementAnnotations described below, which is how data types are attached to DFD elements:
An IModelElementAnnotation is contained in the model element it annotates (
annotations), so it belongs to that one element.A DFDElementAnnotation, such as a DataType, is not contained in the element it annotates: it is stored elsewhere (for example in a DataModel), and a DFDElement only references it (
dfdelementannotation). The same data type can therefore annotate several DFD elements.
- DFDModel
The DFDModel is the root element of a SPARTA DFD model. It is a SpartaResource (and therefore a ModelElement).
It has the following features:
containedElements(ModelElement[0..*], containment): The DFD elements of the model, the Solution instances, and possibly embedded resources such as a catalog.resource(SpartaResource[0..*]): Resources in other files that the model uses: threat type catalogs, solution type catalogs, attacker models, data models, …
- Asset
An Asset is an abstract ModelElement that can be assigned a value, expressed as one or more Estimates. Risk calculation uses this value to determine the loss when a threat manifests itself. Its subclasses are DFDElement (abstract, with all concrete DFD element types) and DataType (with PersonalDataType and TransformedData).
It has the following features:
estimates(Estimate[0..*], containment): All estimates of the asset. The first one is the fallback value.lossMagnitude(map ThreatType to Estimate[0..*], containment): Threat-type-specific values, keyed by a (leaf) ThreatType. Each value refers to one of the asset’sestimates.lossMagnitudeByID(map EString to Estimate[0..*], containment): Threat-type-specific values, keyed by theidof a threat type or of a group such asstride.tampering. Each value refers to one of the asset’sestimates.bound(RoleBinding[0..*]): Opposite ofRoleBinding.bindsTo: the role bindings that link this asset, that is, the solution roles it fulfills (see SPARTA Solution Meta-Model).
The operation
getEstimate(AbstractThreatType tt)selects the estimate for a threat type in this order:lossMagnitudeByIDfor theidoftt;lossMagnitudeforttitself;for each ancestor of
tt, from its parent group upward:lossMagnitudeByIDfor the ancestor’sid(lossMagnitudeis also tried, but its keys are leaf threat types, so it never matches a group);the first estimate in
estimates;otherwise
null.
Note
Because the first estimate in
estimatesis the fallback for every threat type that is not mapped, the order of that list matters. What the risk calculation does when an element has no estimate at all is described in How SPARTA computes risk.- Estimate
An Estimate is a three-point estimate with a confidence value. It is not a ModelElement: it has no
idordescription.It has the following features:
minimum,probable,maximum(EDouble): The lowest, most likely and highest value.confidence(EDouble): The shape parameter of the distribution (see below).name(EString): An optional label.
The operation
getEstimateName()returns a label of the form<minimum>-*<probable>*-<maximum>-(<confidence>) - (<name>). The risk calculation turns every estimate into a modified BetaPERT distribution, in whichconfidenceis the shape parameter; see Estimates for how estimates are sampled and which values are valid.- DFDElement
A DFDElement is an abstract Asset which captures shared properties for the elements of the system model.
It has the following features:
dfdelementannotation(DFDElementAnnotation[0..*]): Information attached to the element, such as the data it handles. In SPARTA itself, the data concepts implement DFDElementAnnotation (see SPARTA Data Meta-Model); extensions can implement it to attach other information. Not a containment: the annotation is stored elsewhere (for example a DataType in a DataModel) and can annotate several elements. Opposite ofDFDElementAnnotation.dfdelement.securityannotation(SecurityAnnotation[0..*], containment): For extensions that want to attach security-specific information to a DFDElement. SecurityAnnotation is abstract and has no concrete subclasses in SPARTA itself, and SPARTA does not read this list.
- DFDContainer
A DFDContainer is an abstract DFDElement that can contain other DFDElements. This can be used to express both decompositions (e.g., decomposing a process into subprocesses to include additional detail) and other concepts such as trust boundaries.
It has a single feature:
containedElements(DFDElement[0..*], containment): The contained DFD elements.
- DataFlowEntity
A DataFlowEntity is an abstract element that can send or receive information. I.e. an element that can be attached to a DataFlow. Its concrete subclasses are the common types Process, DataStore, and ExternalEntity. Because a DataFlowEntity is itself a DFDContainer, each of these can contain sub-elements, which is how decomposition is represented.
It has the following features:
send(SenderSpecifiable[0..*]): Opposite ofsender: the data flows and sender specifications whose sender is this element.receive(RecipientSpecifiable[0..*]): Opposite ofrecipient: the data flows and recipient specifications whose recipient is this element.
- DFDBoundaryElement
A DFDBoundaryElement is an abstract DFDContainer for containers that delineate a boundary, such as its concrete subclass TrustBoundaryContainer.
It has a single feature:
crossingFlows(DataFlow[0..*]): Not used in 2026.3. Whether a flow crosses a trust boundary is derived from containment instead, i.e. a TrustBoundaryContainer that (directly or indirectly) contains one endpoint of the flow but not the other.
- FlowElement
The FlowElement is used to express DataFlows between elements. An element at either end of a data flow (its sender or recipient) can be decomposed into sub-elements. The flow can then specify which sub-element it actually comes from or goes to.
FlowElement is abstract and declares the operation
getDataFlow().SenderSpecifiable and RecipientSpecifiable are interfaces with
sender/recipient(DataFlowEntity[1..1]) andsenderSpecifiedBy/recipientSpecifiedBy(SenderSpecification / RecipientSpecification[0..1]).DataFlow implements both interfaces; its
getDataFlow()returns the flow itself.SenderSpecification and RecipientSpecification refine the sender or recipient of the element they specify, which they reference through
specifiesSenderOf/specifiesRecipientOf(SenderSpecifiable / RecipientSpecifiable[1..1]). Because they are themselves specifiable, they can be chained. TheirgetDataFlow()returns the underlying DataFlow.
Example
Starting from a simple DataFlow between Process A and B. You may want to decompose Process B into B1 and B2. In this case, it’s unclear to which subprocess of B the data goes. The SenderSpecification or RecipientSpecification enable the inclusion of this information. In this example, the dataflow contains a RecipientSpecification expressing that the final destination is the process B1. This can be applied recursively as subprocesses are further decomposed as well.
flowchart LR pa((A)) --> df df --> pb((B))flowchart LR pa((A)) --> df subgraph sp [B] pb1((B1)) --> pb2((B2)) end df --> sp df -- RecSpec --> pb1How a specification affects threat elicitation depends on the pattern that is evaluated. The built-in key-based threat types treat every sender and recipient along the chain as an endpoint of the flow, so in the example above threats are elicited for both B and B1. A catalog pattern that navigates
DataFlow.recipientonly sees B; most patterns of the published STRIDE-per-interaction and LINDDUN catalogs use a helper pattern that follows the chain to the most refined endpoint (B1). See Writing threat type patterns.
SPARTA Resources Meta-Model
SPARTA Resources Meta-Model concepts
- SpartaResource
Any type of resource relevant for a DFDModel. Can be subclassed when developing extensions. It is an abstract ModelElement.
It has a single feature:
securityannotation(SecurityAnnotation[0..*], containment): As on DFDElement, meant for extensions and not read by SPARTA itself.
- DataModel
The DataModel specifies relevant data types for the system (see SPARTA Data Meta-Model).
- SolutionTypeCatalog
The SolutionTypeCatalog is used to capture a set of reusable security and privacy solutions to apply to different DFDModels (see SPARTA Solution Meta-Model).
It has a single feature:
solutionTypes(SolutionType[0..*], containment): The solution types of the catalog.
- ThreatTypeCatalog
A ThreatTypeCatalog contains a set of threat types, for example those of STRIDE or LINDDUN, and describes how SPARTA can elicit them from a model (see SPARTA Threat Type Meta-Model).
It has the following features:
threat(AbstractThreatType[0..*], containment): Threat types and groups.threattypegroup(ThreatTypeGroup[0..*], containment): Additional groups; treated like groups inthreat.package(EString): VQL package name, prepended to every pattern. Required for catalog patterns.imports(EString[0..*]): Complete VQL import lines, prepended to every pattern.helperPatterns(EString[0..*]): VQL patterns that threat patterns can call, but that never produce threats themselves.patternDependencies(ThreatTypeCatalog[0..*]): Catalogs whose patterns SPARTA processes before those of this catalog; cyclic dependencies are rejected (see Catalog settings).conditionlist(ConditionList[0..*], containment): Not used by the analysis in 2026.3.
How SPARTA uses
package,importsandhelperPatternsto parse the patterns is described in Catalog settings.Note
A DFDModel does not have to contain or reference any resources, but to elicit threats, it needs at least one ThreatTypeCatalog. The analysis only sees resources that the analyzed model contains (in
containedElements) or references (typically throughresource).- ThreatSpecificationCatalog
The ThreatSpecificationCatalog is an optional resource. It enables making modifications to a ThreatTypeCatalog without actually changing the ThreatTypeCatalog itself, which may be used in multiple different DFDModels. For example, the ThreatSpecificationCatalog can be used to toggle off specific threat types if they are deemed to be irrelevant in the context of a specific DFDModel. It is not shown in the figure above.
It has a single feature:
threatspecifications(ThreatSpecification[0..*], containment): The threat specifications of the catalog.
Note
In SPARTA 2026.3, threat specifications only affect legacy key-based threat types. As a known limitation, they have no effect on threat types that are elicited with catalog patterns (ThreatPattern). See ThreatSpecification in SPARTA Threat Type Meta-Model and Writing threat type patterns.
- AttackerModel
The AttackerModel resource contains the attacker profiles that the risk calculation takes into account (see SPARTA Attacker Meta-Model).
It has a single feature:
attackerProfiles(AttackerProfile[0..*], containment): The attacker profiles of the model.
SPARTA Data Meta-Model
SPARTA Data Meta-Model concepts
- DataModel
A DataModel is a SPARTA resource that captures relevant data types for a system.
It has a single feature:
dataModelElements(DataModelElement[0..*], containment): The data concepts of the model: DataTypes, PersonalDataTypes, TransformedData, DataSubjectTypes and DataSets.
- DataModelElement
The common interface of all data concepts. It extends DFDElementAnnotation, so every data concept can be attached to a DFDElement through its
dfdelementannotationlist.- DataType
A DataType represents some data that is handled (i.e., processed, produced, stored, …) by the system. DataTypes are Assets, and can be given Estimates to indicate their value, which are taken into account during risk calculation. Furthermore, DataTypes are DFDElementAnnotations: to indicate that a certain DFDElement handles some DataType, that DataType should be added as a DFDElementAnnotation to that DFDElement.
It has a single feature of its own:
sensitive(Boolean[1..1], defaultfalse): Not used by the analysis in 2026.3, but threat type patterns can match on it.
- TransformedData
TransformedData represents a DataType that is derived from another DataType by some transformation, such as encryption. The analysis does not use its features in 2026.3.
It has the following features:
datatype(DataType[1..1]): The original data type.encKey,decKey(DataType[0..1]): For encryption, the encryption and decryption key.
- Privacy-specific data
Several modeling concepts are provided specifically for privacy analyses. How these values combine into a privacy loss is described in How SPARTA computes risk.
- DataSet
A DataSet represents a collection of different DataTypes. Note that a DataSet is a DataModelElement, not a ModelElement, so it has no name, description or id. When a DataSet annotates an element, its PersonalDataTypes count for the privacy risk of threats to that element, provided that a DataSubjectType refers to them.
It has a single feature:
datatype(DataType[0..*]): The data types in the set.
- DataSubjectType
A DataSubjectType represents a type of person whose data is handled by the system. This allows differentiating between different types of persons (e.g., minors and adults) when analyzing risk. A DataSubjectType is a DataModelElement, not a ModelElement, so it has no name, description or id.
It has the following features:
personaldatatype(PersonalDataType[0..*]): The personal data that pertains to this type of person.sensitivity(Estimate[1..1], containment): The sensitivity of this type of person.nbrOfSubjects(Estimate[1..1], containment): The number of data subjects of this type.
- PersonalDataType
A PersonalDataType represents personal data which may require more care from a privacy perspective. It is a DataType with three additional estimates. It does not reference a DataSubjectType itself: a DataSubjectType refers to its personal data types through
personaldatatype.It has the following features of its own:
sensitivity(Estimate[1..1], containment): The sensitivity of this personal data.nbrOfRecords(Estimate[1..1], containment): The number of records.retention(Estimate[1..1], containment): The retention period.
SPARTA Solution Meta-Model
SPARTA Solution Meta-Model concepts
- SolutionType
The SolutionType is used to represent solutions in a reusable way to enable their application in multiple DFDModels.
It has the following features:
roles(Role[0..*], containment): The roles that concrete DFD elements fulfill when the solution is applied.countermeasure(CounterMeasure[0..*], containment): The effects of the solution on threats.
- Role
Roles are used to represent parts of a solution that are fulfilled by concrete elements in a DFD.
It has the following features:
bindingTypes(list of Java classes that extend DFDElement): Which concrete DFD elements can fulfill the role. For example, a service role that has to be filled in by an ExternalEntity, or a storage role that has to be filled in by a DataStore.subjected(CounterMeasure[0..*]): Opposite ofCounterMeasure.subject: the countermeasures that protect the elements bound to this role.
- CounterMeasure
CounterMeasures are used to represent the security or privacy effects of a solution by indicating that they mitigate one or more threat types. They use Roles to express which elements are affected by the countermeasure and to limit the scope of the effect.
It has the following features:
subject(Role[0..*]): The protected roles: the elements bound to these roles are protected.mitigates(AbstractThreatType[0..*]): The mitigated threat types. A group covers all threat types below it.mitigatedThreatTypeID(EString[0..*]): The ids of mitigated threat types or groups. This works across catalog files.scope(Role[0..*]): If not empty, the countermeasure only applies to threats whose data flow is bound to one of these roles.difficulty(Estimate[0..1], containment): How hard the countermeasure is to break. Compared with the attacker’s threat capability, so use the same scale.securitysubobjective(CounterMeasure[0..*], containment): Nested countermeasures; no special meaning in the 2026.3 analysis.
During risk calculation, a countermeasure applies to a threat if a role in its
subjectis bound to the threatened element, the threat’s type matchesmitigatesormitigatedThreatTypeID(the id of the threat type or of any of its ancestors), and itsscopeis empty or the threat’s data flow is bound to a role in thescope. A countermeasure with a non-emptyscopetherefore never applies to a threat without a data flow, and role bindings withoutbindsare ignored. In 2026.3, a binding of the data flow to a scope role also counts if it belongs to another instance of the same solution type; this is a known limitation. The effect ofdifficultyis described in How SPARTA computes risk, and what happens when it is missing in Defaults when information is missing.
Example
SSL/TLS in a web context prevents spoofing of a website (the server role in the solution), but only for those SSL/TLS data flows (expressed by the corresponding roles). Other communication with the server process is not protected.
- Solution
A Solution represents a concrete instance of a SolutionType in a concrete DFDModel; it is stored in the model’s
containedElements.It has the following features:
securitypattern(SolutionType[0..1]): The solution type that this solution instantiates.rolebinding(RoleBinding[0..*], containment): The role bindings of this solution.
- RoleBinding
Every concrete Solution has a set of RoleBindings, these link the Roles from the SolutionType to concrete DFD elements, such as a process or a data flow. A single RoleBinding can link its Role to several elements, for example all data flows that use the same secure channel. Risk calculation only considers bindings on the threatened element and on the threat’s data flow. A countermeasure whose
subjectcontains the role therefore protects every element inbindsTo, and one whosescopecontains the role accepts threats whose data flow is any data flow inbindsTo.It has the following features:
binds(Role[0..1]): The role of the solution type that is bound by this RoleBinding.bindsTo(Asset[0..*]): Opposite ofAsset.bound: the concrete elements that fulfill the role. Oncebindsis set, the editors only offer elements of one of the role’sbindingTypes; the API accepts any Asset, such as a DataType.
SPARTA Threat Type Meta-Model
SPARTA Threat Type Meta-Model concepts
- ThreatTypeCatalog
A resource that contains threat types, together with the
package,importsandhelperPatternsthat all of the threat patterns share. See ThreatTypeCatalog in SPARTA Resources Meta-Model for its features.- AbstractThreatType
Threat types in SPARTA are implemented using a composite structure, thereby allowing threats to be decomposed and structured like trees. The AbstractThreatType class serves as a parent to all threat types and contains shared properties and logic.
It has the following features:
enabled(Boolean[1..1], defaulttrue): Only affects legacy key-based threat types: it is ignored for catalog patterns, which is a known limitation of 2026.3.patterns(map EString to Boolean[0..*], containment): The keys of the legacy key-based mechanism, such asProcessToProcessorDataFlow(see Legacy key-based threat types). Not the VQL patterns: those are in ThreatPattern.superThreatType(CompositeThreatType[0..1], derived): Opposite ofsubThreatTypes: the parent group.title,additionalInfo,comments(EString): Documentation only; not shown in analysis results.characteristic(ICharacteristic[0..*], containment): For extensions that want to attach their own information to the threat type. ICharacteristic has no implementations in SPARTA itself, and SPARTA does not read this list. For example, an extension could use it to encode the characteristics that LINDDUN lists for each threat type.
- ThreatType
A simple, leaf threat type which has no children. Only leaf threat types are elicited: each elicited threat refers to a ThreatType. Its operation
getThreatTypeAncestor()returns the top-most group above it (or the threat type itself), andtoString()returns its name.It has the following features of its own:
threatpattern(ThreatPattern[0..*], containment): The patterns that specify how to elicit the threat type.condition(AbstractCondition[0..1], containment): Not used by SPARTA in version 2026.3. Extensions could evaluate it to make a threat type depend on other threat types or on facts that are not in the model, such as answers to a questionnaire. To refer to another threat type, the meta-model already has ImportedThreatCondition, but SPARTA itself does not evaluate it.
- CompositeThreatType
An abstract threat type composed of other threat types.
It has a single feature of its own:
subThreatTypes(AbstractThreatType[0..*], containment): The threat types and groups in this group.
Groups can be nested to any depth. The concrete kinds are:
ThreatTypeGroup, the kind used by the published catalogs (it extends OrCompositeThreatType);
OrCompositeThreatType;
AndCompositeThreatType.
In 2026.3, the analysis treats all three kinds the same way: no And/Or semantics are implemented.
- ThreatPattern
Specifies the actual elicitation logic of a threat type. A ThreatType can contain several of them to define different ways of eliciting the same threat. Each ThreatPattern has its own description and mapping. SPARTA does not merge their results: if two ThreatPatterns of the same threat type match the same elements, the threat appears twice.
It has the following features:
patterns(EString[0..*]): VQL code, stored as text, that defines the patterns for this threat type. SPARTA joins all values with line breaks and parses the result as a single text, so one pattern can span several values, and patterns in different values can call each other.description(EString, from ModelElement): Template for the description of each elicited threat, with placeholders such as<$location$>.longDescription(EString[0..*]): Additional information concerning a threat which can be displayed when a more detailed description is needed.mapping(map EString to EString[0..*], containment): Optional: maps the keyslocationandflowto the pattern parameters that hold the threatened element and the data flow.
How to write patterns, and how SPARTA parses them, is described in Writing threat type patterns.
- ThreatSpecification
A ThreatSpecification, stored in a ThreatSpecificationCatalog, adjusts one threat type or group for the legacy key-based mechanism. It has no effect on catalog patterns, which is a known limitation of 2026.3.
It has the following features:
threat(AbstractThreatType[1..1]): The threat type or group that is adjusted.enabled(Boolean[1..1], defaulttrue): With the valuefalse, SPARTA no longer elicits threats of the threat type or, for a group, of any threat type in the group, including those in nested groups.patterns(map EString to Boolean[0..*], containment): A key with the valuefalseis no longer used to elicit threats of the threat type.types(map EString to Boolean[0..*], containment): With the keyProcess,DataStore,ExternalEntityorDataFlowand the valuefalse, SPARTA no longer elicits threats of the threat type that are located at an element of that type.
SPARTA Attacker Meta-Model
SPARTA Attacker Meta-Model concepts
- AttackerModel
An attacker model contains a set of AttackerProfiles.
- AttackerProfile
An AttackerProfile represents a specific type of attacker, with a certain capability, probability of action and contact frequency.
It has the following features:
threatCapability(Estimate[1..1], containment): Compared with thedifficultyof countermeasures during risk calculation.contactFrequency(Estimate[1..1], containment): How often the attacker comes into contact with the system.probabilityOfAction(Estimate[1..1], containment): The probability that a contact turns into an attack.insider(DFDElement[0..*]): The elements to which the attacker has insider access. If the threatened element itself is in this list, the attacker bypasses all countermeasures for that threat. Listing a container does not cover the elements inside it.enabled(EBoolean[1..1], defaulttrue): Ignored, which is a known limitation of 2026.3: every attacker profile in the analysis scope is used.
How the profiles are taken into account during risk calculation is described in How SPARTA computes risk.
Meta-model features without analysis semantics
The following parts of the 2026.3 meta-model can be created, edited and stored, but the threat elicitation and risk calculation do not use them. They are available for extensions and for your own processing.
Conditions:
ThreatType.condition,ThreatTypeCatalog.conditionlistand the AbstractCondition hierarchy (Condition, AndCompositeCondition, OrCompositeCondition, NotCompositeCondition, ImportedCondition, ImportedThreatCondition, ConditionList).AbstractThreatType.title,additionalInfo,commentsandcharacteristic.The difference between AndCompositeThreatType and OrCompositeThreatType.
SecurityAnnotation (
securityannotationon DFDElement and SpartaResource).DFDBoundaryElement.crossingFlows.DataType.sensitiveand the keys of TransformedData.CounterMeasure.securitysubobjective.AttackerProfile.enabled.ModelElement.annotations, except where your own threat type patterns match on them.