Skip to content

Commit f026c53

Browse files
committed
Output Integrity Check: Reflect structural variations.
Models created by recent Papyrus Version have a Package element as Package, while models created with older versions have a Model element as Package. Furthermore: report messages rephrased.
1 parent 018006b commit f026c53

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

plugins/carisma.check.mltop10checks/src/carisma/check/mltop10checks/outputintegrity/OutputIntegrityCheck.java

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import org.eclipse.uml2.uml.CommunicationPath;
88
import org.eclipse.uml2.uml.Dependency;
99
import org.eclipse.uml2.uml.Deployment;
10-
import org.eclipse.uml2.uml.Model;
1110
import org.eclipse.uml2.uml.NamedElement;
1211
import org.eclipse.uml2.uml.Node;
1312

@@ -16,7 +15,8 @@
1615
import carisma.profile.umlsec.mltop10.MLTop10Util;
1716

1817
/**
19-
* analyzes an deployment diagram with respect to output integrity rules.
18+
* This check analyzes a deployment diagram with respect to output integrity
19+
* rules.
2020
*
2121
* @author Alexander Peikert
2222
* @author Julian Flake
@@ -33,7 +33,8 @@ public boolean runCheck() {
3333

3434
// ---------------------------------------------------------
3535
// populate collections
36-
Set<Model> aiscenarios = MLTop10Util.getStereotypedElements(modelEl, Model.class, MLTop10.SecureAIScenario);
36+
Set<NamedElement> aiscenarios = MLTop10Util.getStereotypedElements(modelEl, NamedElement.class,
37+
MLTop10.SecureAIScenario);
3738
Set<Artifact> mlmodels = MLTop10Util.getStereotypedElements(modelEl, Artifact.class, MLTop10.MLModel);
3839
Set<Artifact> aiapplications = MLTop10Util.getStereotypedElements(modelEl, Artifact.class,
3940
MLTop10.AIApplication);
@@ -70,7 +71,7 @@ public boolean runCheck() {
7071
// 1. Using Cryptographic Methods
7172
for (Artifact el : aiapplications) {
7273
if (!MLTop10Util.isTaggedValueTrue(el, MLTop10.AIApplication, "CheckModelResultAuthenticity")) {
73-
this.addError("1. AI Application '" + el.getName() + "' does not check for model result authenticity.");
74+
this.addError("1: AI Application '" + el.getName() + "' does not check for model result authenticity.");
7475
}
7576
}
7677

@@ -93,13 +94,15 @@ public boolean runCheck() {
9394
if (MLTop10Util.getMemberNodes(path).containsAll(Arrays.asList(fromNode, toNode))) {
9495
// integrity on relevant paths?
9596
if (!MLTop10Util.hasStereotype(path, MLTop10.Integrity)) {
96-
this.addError("2: There is a dependency between " + from.getName() + " and " + to.getName()
97-
+ ", but the communication path between the nodes these artifacts are deployed to, does not fulfill 'integrity'.");
97+
this.addError("2: There is a dependency between '" + from.getName() + "' and '"
98+
+ to.getName()
99+
+ "', but the communication path between the nodes these artifacts are deployed to, does not fulfill 'integrity'.");
98100
}
99101
// secrecy on relevant paths?
100102
if (!MLTop10Util.hasStereotype(path, MLTop10.Secrecy)) {
101-
this.addError("2. There is a dependency between " + from.getName() + " and " + to.getName()
102-
+ ", but the communication path between the nodes these artifacts are deployed to, does not fulfill 'secrecy'.");
103+
this.addError("2: There is a dependency between '" + from.getName() + "' and '"
104+
+ to.getName()
105+
+ "', but the communication path between the nodes these artifacts are deployed to, does not fulfill 'secrecy'.");
103106
}
104107
}
105108
}
@@ -126,25 +129,25 @@ public boolean runCheck() {
126129
// 5. Regular Software Updates
127130
for (NamedElement el : aiscenarios) {
128131
if (!MLTop10Util.isTaggedValueTrue(el, MLTop10.SecureAIScenario, "KeepPackagesVersionsUpToDate")) {
129-
this.addError("5: " + el.getName() + " packages are not kept up to date.");
132+
this.addError("5: Packages in Secure AI Scenario '" + el.getName() + "' are not kept up to date.");
130133
}
131134
}
132135

133136
// ---------------------------------------------------------
134137
// 6. Monitoring and Auditing
135138
for (Artifact el : mlmodels) {
136139
if (!MLTop10Util.isTaggedValueTrue(el, MLTop10.MLModel, "RegularAuditAndMonitoring")) {
137-
this.addError("6: ML Model '" + el.getName() + "' does not perform regular audit and monitoring.");
140+
this.addError("6: ML Model '" + el.getName() + "' is not regularly audited and monitored.");
138141
}
139142
}
140143

141144
// ---------------------------------------------------------
142145
// Overall result
143146
if (this.errorDetected) {
144-
this.addError("=> An Output Integrity Attack is potentially possible!");
147+
this.addError("Result: An Output Integrity Attack is potentially possible!");
145148
return false;
146149
}
147-
this.addInfo("=> No vulnerabilities for Output Integrity Attacks detected.");
150+
this.addInfo("Result: No vulnerabilities for Output Integrity Attacks detected.");
148151
return true;
149152
}
150153

0 commit comments

Comments
 (0)