Class Threat
java.lang.Object
be.kuleuven.cs.distrinet.sparta.core.model.Threat
- All Implemented Interfaces:
IInteractionThreat,IThreat
- Direct Known Subclasses:
ObservableThreat,PatternThreat
Class representing a security or privacy threat instance. This class requires a
IPatternMatch from which the required information is retrieved to
populate the threat's properties.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DataFlowprotected Stringprotected Stringprotected final NumberFormatprotected final org.eclipse.viatra.query.runtime.api.IPatternMatchprotected final IRiskModelprotected DFDElementprotected ThreatType -
Constructor Summary
ConstructorsModifierConstructorDescriptionThreat(org.eclipse.viatra.query.runtime.api.IPatternMatch x) Create a new Threat instance.protectedThreat(org.eclipse.viatra.query.runtime.api.IPatternMatch match, IRiskModel model) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringBuild the match-type label describing the shape of the matched interaction, e.g.protected DataFlowgetLef()protected ModelElementgetModelElement(String propertyName) org.eclipse.viatra.query.runtime.api.IPatternMatchgetRisk()getSle()getTef()protected ThreatTypebooleanvoidperformRiskCalculation(RiskAssessmentLoopConfiguration loopConfiguration) Perform Risk calculation Overall formula: LEF x LM When the threat has no threatened element the calculation is skipped; any subsequent read of a risk figure then throws anIllegalStateException(seeSpartaRiskModel) rather than an opaque NullPointerException.static StringsimpleTypeName(Object element) Human-readable model type name of an element: the simple class name with the EMF-generated"Impl"suffix stripped, e.g.toString()protected static StringtypeAbbreviation(Object element) Abbreviated element type for match-type labels, e.g.
-
Field Details
-
riskModel
-
patternMatch
protected final org.eclipse.viatra.query.runtime.api.IPatternMatch patternMatch -
threatenedElement
-
threatType
-
matchType
-
dataFlow
-
message
-
nf
-
-
Constructor Details
-
Threat
-
Threat
public Threat(org.eclipse.viatra.query.runtime.api.IPatternMatch x) Create a new Threat instance.- Parameters:
x- theIPatternMatchfrom which the required information is retrieved to populate the threat's properties.
-
-
Method Details
-
getPatternMatch
public org.eclipse.viatra.query.runtime.api.IPatternMatch getPatternMatch() -
getThreatenedElement
-
getThreatType
-
getMatchType
-
getDataFlow
-
getDataFlowFrom
-
getDataFlowTo
-
getMessage
-
isRiskCalculated
public boolean isRiskCalculated()- Returns:
- whether this threat's risk has been calculated, i.e. whether the risk getters
(
getRisk(),getVulnerability(), ...) return values instead of throwing. False when the calculation was skipped, seeperformRiskCalculation(be.kuleuven.cs.distrinet.sparta.core.analysis.RiskAssessmentLoopConfiguration).
-
getVulnerability
- Specified by:
getVulnerabilityin interfaceIThreat
-
getVulnerability_lower
-
getVulnerability_upper
-
getRisk
-
getRisk_lower
-
getRisk_upper
-
getPotentialRisk
- Specified by:
getPotentialRiskin interfaceIThreat
-
getSle
-
getTef
-
getLef
-
getMitigations
- Returns:
- the countermeasures the risk calculation applied to this threat, with the role bindings (and hence solutions) they apply through
-
getModelElement
-
getDataFlowElement
-
getThreatTypeElement
-
simpleTypeName
Human-readable model type name of an element: the simple class name with the EMF-generated"Impl"suffix stripped, e.g.ProcessImpl -> "Process". Names that do not end in"Impl"are returned unchanged.- Parameters:
element- the model element (must not be null)- Returns:
- the simple class name without a trailing
"Impl"
-
typeAbbreviation
Abbreviated element type for match-type labels, e.g.ProcessImpl -> "P",DataStoreImpl -> "DS",ExternalEntityImpl -> "EE". Null-safe ("?"for an unresolved reference). -
buildMatchTypeLabel
Build the match-type label describing the shape of the matched interaction, e.g."P-DF*->EE": the sender and recipient type abbreviations around the data flow, with*marking the threatened element. RequiresdataFlowandthreatenedElementto be set.- Returns:
- the match-type label
-
performRiskCalculation
Perform Risk calculation Overall formula: LEF x LM When the threat has no threatened element the calculation is skipped; any subsequent read of a risk figure then throws anIllegalStateException(seeSpartaRiskModel) rather than an opaque NullPointerException. -
toString
-
getDataFlowName
- Specified by:
getDataFlowNamein interfaceIInteractionThreat
-
getDataFlowFromName
- Specified by:
getDataFlowFromNamein interfaceIInteractionThreat
-
getDataFlowToName
- Specified by:
getDataFlowToNamein interfaceIInteractionThreat
-
getThreatTypeName
- Specified by:
getThreatTypeNamein interfaceIThreat
-
getThreatenedElementName
- Specified by:
getThreatenedElementNamein interfaceIThreat
-
getThreatenedElementTypeName
- Specified by:
getThreatenedElementTypeNamein interfaceIThreat
-
getThreatenedElementId
- Specified by:
getThreatenedElementIdin interfaceIThreat
-
getThreatName
- Specified by:
getThreatNamein interfaceIThreat
-
getDescription
- Specified by:
getDescriptionin interfaceIThreat
-