diff --git a/.gitattributes b/.gitattributes index d64359b..5742945 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ gradlew eol=lf +*.jar filter=lfs diff=lfs merge=lfs -text diff --git a/build.gradle b/build.gradle index d491212..7d60cec 100644 --- a/build.gradle +++ b/build.gradle @@ -27,11 +27,16 @@ repositories { dependencies { implementation group: 'jpl', name: 'jpl', version: '7.4.0' + // implementation 'jakarta.xml.bind:jakarta.xml.bind-api:2.3.3' + implementation 'com.sun.xml.bind:jaxb-impl:2.2.11' + implementation 'com.sun.xml.bind:jaxb-core:2.2.11' + implementation 'org.glassfish.jersey.media:jersey-media-jaxb:2.30.1' + compile fileTree(dir: 'libs', includes: ['*.jar']) compile('org.springframework.boot:spring-boot-starter-web') -// compile('org.eclipse.winery:org.eclipse.winery.repository.client:2.0.0-SNAPSHOT') -// compile('org.eclipse.winery:org.eclipse.winery.model.tosca:2.0.0-SNAPSHOT') +// compile('com.github.opentosca.winery:org.eclipse.winery.repository.client:ustutt-9b6bd07e7a-1') +// compile('com.github.opentosca.winery:org.eclipse.winery.model.tosca:ustutt-9b6bd07e7a-1') testCompile('org.springframework.boot:spring-boot-starter-test') compile 'com.vladsch.flexmark:flexmark-all:0.32.18' diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 1a958be..d1b596f 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 90a06ce..0f5bbe2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,3 +1,4 @@ +#Mon Dec 05 13:35:54 CET 2022 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index b30fbcc..4453cce 100755 --- a/gradlew +++ b/gradlew @@ -106,7 +106,7 @@ fi # For Darwin, add options to specify how the application appears in the dock if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:algorithm=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi # For Cygwin, switch paths to Windows format before running java diff --git a/libs/jpl.jar b/libs/jpl.jar index 96d2e34..d1152a6 100644 Binary files a/libs/jpl.jar and b/libs/jpl.jar differ diff --git a/libs/org.eclipse.winery.repository.client-2.0.0-SNAPSHOT-shaded.jar b/libs/org.eclipse.winery.repository.client-2.0.0-SNAPSHOT-shaded.jar deleted file mode 100644 index 2562092..0000000 Binary files a/libs/org.eclipse.winery.repository.client-2.0.0-SNAPSHOT-shaded.jar and /dev/null differ diff --git a/libs/org.eclipse.winery.repository.client-3.0.0-SNAPSHOT-shaded.jar b/libs/org.eclipse.winery.repository.client-3.0.0-SNAPSHOT-shaded.jar new file mode 100644 index 0000000..ef6b717 --- /dev/null +++ b/libs/org.eclipse.winery.repository.client-3.0.0-SNAPSHOT-shaded.jar @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa058b943600515c6438e0fc570caad78a09357fe5a8761d0e1cf7cfb7edb801 +size 107627044 diff --git a/pattern_prologfiles/MessageMover.md b/pattern_prologfiles/MessageMover.md deleted file mode 100644 index 55aa53a..0000000 --- a/pattern_prologfiles/MessageMover.md +++ /dev/null @@ -1,16 +0,0 @@ -# Message Mover - -## Problem -distributed messaging because of restricted environment which contains the messaging middleware - -## Problem Rule - -```prolog -distributed_messaging(Component_1, Component_2) :- - messaging_communication(Channel, Component_1, Component_2), - components_in_different_locations(Component_1, Component_2), - hybrid_environment(Component_1, Component_2). -``` - -## Solution Description -A message mover is used to integrate message queues hosted in different environments [...]. diff --git a/pattern_prologfiles/patternhelper.pl b/pattern_prologfiles/patternhelper.pl index f80d321..9101a86 100644 --- a/pattern_prologfiles/patternhelper.pl +++ b/pattern_prologfiles/patternhelper.pl @@ -7,7 +7,7 @@ member(H1, S1), member(Component_2, S2), member(H2, S2), - Location_1 \= Location_2. + Location_1 \== Location_2. component_in_restricted_environment(Component_1) :- property(P, inboundcommunication, false), diff --git a/pattern_prologfiles/patterns.pl b/pattern_prologfiles/patterns.pl index 903eb5f..2eb9780 100644 --- a/pattern_prologfiles/patterns.pl +++ b/pattern_prologfiles/patterns.pl @@ -11,11 +11,6 @@ component_in_restricted_environment(Channel)); direct_communication(Component_1, Component_2)). -distributed_messaging(Component_1, Component_2) :- - messaging_communication(Channel, Component_1, Component_2), - components_in_different_locations(Component_1, Component_2), - hybrid_environment(Component_1, Component_2). - insecure_public_communication(Component_1, Component_2) :- property(Relation_ID, sensitivedata, true), relation(Relation_ID, Component_1, Component_2), diff --git a/src/main/java/io/github/saatkamp/TopologyProblemRecognizer/PrologChecker.java b/src/main/java/io/github/saatkamp/TopologyProblemRecognizer/PrologChecker.java index f682288..cd24517 100644 --- a/src/main/java/io/github/saatkamp/TopologyProblemRecognizer/PrologChecker.java +++ b/src/main/java/io/github/saatkamp/TopologyProblemRecognizer/PrologChecker.java @@ -86,8 +86,18 @@ public List checkTopology(String topologyID) throws IOException finding.add(componentFinding); logger.info("This is the result for Variable {}: {}", entry.getKey(), prologNames.decode(entry.getValue().toString())); } - findings.addFinding(finding); + + boolean doesNotContainNewEntry = findings.getFindings().stream().noneMatch(existingFinding -> { + return existingFinding.stream().allMatch(entry -> { + return finding.contains(entry); + }); + }); + + if(doesNotContainNewEntry) { + findings.addFinding(finding); + } } + problemFindings.add(findings); } else { logger.info("problem {} is not contained in topology", problemQuery); @@ -154,6 +164,11 @@ public List findSolutions(String serviceTemplateID, String pa solutions.add(solutionInputData); } else { + //Quickfix -otherwise decoded component-ids are stored as "encoded names" in the nameHashMap + occurrence.stream().forEach(finding -> { + String encodedComponentId = prologNames.decode(finding.getComponentId()); + finding.setComponentId(encodedComponentId); + }); logger.info("problem {} is not contained in topology", solutionQuery); } } diff --git a/src/main/java/io/github/saatkamp/TopologyProblemRecognizer/PrologFactTopologyGenerator.java b/src/main/java/io/github/saatkamp/TopologyProblemRecognizer/PrologFactTopologyGenerator.java index eb50469..06ae6eb 100644 --- a/src/main/java/io/github/saatkamp/TopologyProblemRecognizer/PrologFactTopologyGenerator.java +++ b/src/main/java/io/github/saatkamp/TopologyProblemRecognizer/PrologFactTopologyGenerator.java @@ -1,25 +1,35 @@ package io.github.saatkamp.TopologyProblemRecognizer; -import org.eclipse.winery.common.ids.definitions.NodeTypeId; -import org.eclipse.winery.common.ids.definitions.RelationshipTypeId; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.Writer; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +import javax.xml.namespace.QName; + +import org.eclipse.winery.model.ids.definitions.NodeTypeId; +import org.eclipse.winery.model.ids.definitions.PolicyTypeId; +import org.eclipse.winery.model.ids.definitions.RelationshipTypeId; import org.eclipse.winery.model.tosca.TNodeTemplate; import org.eclipse.winery.model.tosca.TNodeType; +import org.eclipse.winery.model.tosca.TPolicy; +import org.eclipse.winery.model.tosca.TPolicyType; import org.eclipse.winery.model.tosca.TRelationshipTemplate; import org.eclipse.winery.model.tosca.TRelationshipType; import org.eclipse.winery.model.tosca.TTopologyTemplate; +import org.eclipse.winery.model.tosca.constants.Namespaces; import org.eclipse.winery.model.tosca.utils.ModelUtilities; import org.eclipse.winery.repository.client.IWineryRepositoryClient; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import utils.TOSCAModelUtilities; -import javax.xml.namespace.QName; -import java.io.*; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; - public class PrologFactTopologyGenerator { private IWineryRepositoryClient repositoryClient; @@ -34,8 +44,9 @@ public PrologFactTopologyGenerator(String wineryURL, PrologNames prologNames) { } /** - * Takes a topology template from the repository and generates a prolog file for this topology based on the metamodel. - * Because in Prolog Variables starts with a capital letter all ids are transformed to lower case. + * Takes a topology template from the repository and generates a prolog file for this topology based on the + * metamodel. Because in Prolog Variables starts with a capital letter all ids are transformed to lower case. + * * @param serviceTemplateQName * @throws IOException */ @@ -47,13 +58,13 @@ public void generatePrologFileForTopology(QName serviceTemplateQName) throws IOE TTopologyTemplate topologyTemplate = this.repositoryClient.getTopologyTemplate(serviceTemplateQName); //Transforms Node Templates in component([nodeTemplateID]). - for(TNodeTemplate nodeTemplate: topologyTemplate.getNodeTemplates()) { + for (TNodeTemplate nodeTemplate : topologyTemplate.getNodeTemplates()) { String id = prologNames.encode(nodeTemplate.getId()); plContent = plContent + "component(" + id + ")." + newline; } //Transforms Node Types contained in the topology in component_of_type([nodeTemplateID], [nodeTypeID]). - for(TNodeTemplate nodeTemplate: topologyTemplate.getNodeTemplates()) { + for (TNodeTemplate nodeTemplate : topologyTemplate.getNodeTemplates()) { NodeTypeId nodeTypeId = new NodeTypeId(nodeTemplate.getType()); String componentID = prologNames.encode(nodeTemplate.getId()); String typeID = prologNames.encode(nodeTypeId.getXmlId().toString()); @@ -64,14 +75,14 @@ public void generatePrologFileForTopology(QName serviceTemplateQName) throws IOE List superNodeTypesIDs = getSuperNodeTypesIDs(nodeTemplate); //Only if more than the direct type is in the list of superTypes this fact has to be added plContent = plContent + "component_types([" + componentID; - for (NodeTypeId id: superNodeTypesIDs) { + for (NodeTypeId id : superNodeTypesIDs) { plContent = plContent + ", " + prologNames.encode(id.getXmlId().toString()); } plContent = plContent + "])." + newline; } //Transforms Relationship Templates in relation([sourceNodeTemplateID], [targetNodeTemplateID], [relationshipTemplateID]). - for(TRelationshipTemplate relationshipTemplate: topologyTemplate.getRelationshipTemplates()) { + for (TRelationshipTemplate relationshipTemplate : topologyTemplate.getRelationshipTemplates()) { TNodeTemplate sourceNodeTemplate = ModelUtilities.getSourceNodeTemplateOfRelationshipTemplate(topologyTemplate, relationshipTemplate); TNodeTemplate targetNodeTemplate @@ -79,20 +90,20 @@ public void generatePrologFileForTopology(QName serviceTemplateQName) throws IOE String sourceID = prologNames.encode(sourceNodeTemplate.getId()); String targetID = prologNames.encode(targetNodeTemplate.getId()); String relationID = prologNames.encode(relationshipTemplate.getId()); - plContent = plContent + "relation(" + relationID +", " + sourceID + ", " + targetID + ")." + newline; + plContent = plContent + "relation(" + relationID + ", " + sourceID + ", " + targetID + ")." + newline; //An extension to type hierarchies to enable a check of supertypes as relation_types([relationID, typeID, superTypeID, ...]). List superRelationshipTypesIDs = getSuperRelationshipTypesIDs(relationshipTemplate); //Only if more than the direct type is in the list of superTypes this fact has to be added plContent = plContent + "relation_types([" + relationID; - for (RelationshipTypeId id: superRelationshipTypesIDs) { + for (RelationshipTypeId id : superRelationshipTypesIDs) { plContent = plContent + ", " + prologNames.encode(id.getXmlId().toString()); } plContent = plContent + "])." + newline; } //Transforms Relationship Types contained in the topology in relation_of_type([relationshipTemplateID], [relationshipTypeID]). - for(TRelationshipTemplate relationshipTemplate: topologyTemplate.getRelationshipTemplates()) { + for (TRelationshipTemplate relationshipTemplate : topologyTemplate.getRelationshipTemplates()) { RelationshipTypeId relationshipTypeId = new RelationshipTypeId(relationshipTemplate.getType()); //No Type checking of the Relationship Type - must be one of the normative types //TODO: An extenstion to type hierarchies is required to enable a check of supertypes @@ -102,12 +113,13 @@ public void generatePrologFileForTopology(QName serviceTemplateQName) throws IOE } //Transforms KVProperties of Relationships in property([relationshipTemplateID], [KVPropertyKey], [KVPropertyValue]). - for (TRelationshipTemplate relationshipTemplate: topologyTemplate.getRelationshipTemplates()) { - if(relationshipTemplate.getProperties() != null) { - Map kVProperties = relationshipTemplate.getProperties().getKVProperties(); - if(kVProperties != null) { - for (Map.Entry entry: kVProperties.entrySet()) { - if(entry.getValue() != "") { + for (TRelationshipTemplate relationshipTemplate : topologyTemplate.getRelationshipTemplates()) { + if (relationshipTemplate.getProperties() != null) { + Map kVProperties = ModelUtilities.getPropertiesKV(relationshipTemplate); + ; + if (kVProperties != null) { + for (Map.Entry entry : kVProperties.entrySet()) { + if (entry.getValue() != "") { String relationID = prologNames.encode(relationshipTemplate.getId()); String keyID = prologNames.encode(entry.getKey()); String valueID = prologNames.encode(entry.getValue()); @@ -117,15 +129,25 @@ public void generatePrologFileForTopology(QName serviceTemplateQName) throws IOE } } } + //Add policies at relationships as properties (If a Policy is there, the value is true) + List policies = relationshipTemplate.getPolicies(); + if (policies != null && !policies.isEmpty()) { + for (TPolicy policy : policies) { + String relationID = prologNames.encode(relationshipTemplate.getId()); + TPolicyType policyType = repositoryClient.getElement(new PolicyTypeId(policy.getPolicyType())); + plContent = plContent + "property(" + relationID + ", " + prologNames.encode(policyType.getName()) + ", " + "true)." + newline; + } + } } //Transforms KVProperties of Nodes in property([nodeTemplateID], [KVPropertyKey], [KVPropertyValue]). - for (TNodeTemplate nodeTemplate: topologyTemplate.getNodeTemplates()) { - if(nodeTemplate.getProperties() != null) { - Map kVProperties = nodeTemplate.getProperties().getKVProperties(); - if(kVProperties != null) { - for (Map.Entry entry: kVProperties.entrySet()) { - if(entry.getValue() != "") { + for (TNodeTemplate nodeTemplate : topologyTemplate.getNodeTemplates()) { + if (nodeTemplate.getProperties() != null) { + Map kVProperties = ModelUtilities.getPropertiesKV(nodeTemplate); + ; + if (kVProperties != null) { + for (Map.Entry entry : kVProperties.entrySet()) { + if (!entry.getValue().isEmpty()) { String nodeID = prologNames.encode(nodeTemplate.getId()); String keyID = prologNames.encode(entry.getKey()); String valueID = prologNames.encode(entry.getValue()); @@ -137,6 +159,26 @@ public void generatePrologFileForTopology(QName serviceTemplateQName) throws IOE } } + //Add special location property to the facts + for (TNodeTemplate nodeTemplate : topologyTemplate.getNodeTemplates()) { + Optional location = getNodeTemplateLocation(nodeTemplate); + String nodeID = prologNames.encode(nodeTemplate.getId()); + if (location.isPresent()) { + String propertykey = prologNames.encode("location"); + String value = prologNames.encode(location.get()); + plContent = plContent + + "property(" + nodeID + ", " + propertykey + ", " + value + ")." + newline; + } + //Without specific information about the Hosting Environment we assume restricted environments to enable the user to + //Select if these problems will occur + if (unspecifiedInfrastructure(topologyTemplate, nodeTemplate)) { + String propertykey = prologNames.encode("inboundcommunication"); + String value = prologNames.encode("false"); + plContent = plContent + + "property(" + nodeID + ", " + propertykey + ", " + value + ")." + newline; + } + } + List nodesWithoutIncomingHostedOnRelationships = TOSCAModelUtilities.getNodeTemplatesWithoutIncomingHostedOnRelationships(topologyTemplate); for (TNodeTemplate nodeTemplate : nodesWithoutIncomingHostedOnRelationships) { @@ -152,11 +194,11 @@ public void generatePrologFileForTopology(QName serviceTemplateQName) throws IOE persistPrologFile(plContent, serviceTemplateQName.getLocalPart().toString()); } - private List getHostStack (TTopologyTemplate topologyTemplate, TNodeTemplate nodeTemplate) { + private List getHostStack(TTopologyTemplate topologyTemplate, TNodeTemplate nodeTemplate) { List hostStack = new ArrayList<>(); hostStack.add(nodeTemplate); List hostedOnPredecessors = TOSCAModelUtilities.getHostedOnSuccessorsOfNodeTemplate(topologyTemplate, nodeTemplate); - while(!hostedOnPredecessors.isEmpty()) { + while (!hostedOnPredecessors.isEmpty()) { List transitiveHosts = new ArrayList<>(); hostedOnPredecessors.stream().forEach(host -> { hostStack.add(host); @@ -166,15 +208,15 @@ private List getHostStack (TTopologyTemplate topologyTemplate, TN hostedOnPredecessors.addAll(transitiveHosts); } - - return hostStack; + return hostStack; } - private List getSuperNodeTypesIDs (TNodeTemplate nodeTemplate) { + private List getSuperNodeTypesIDs(TNodeTemplate nodeTemplate) { List superNodeTypesIDs = new ArrayList<>(); //Add NodeTemplate Type to the List NodeTypeId typeId = new NodeTypeId(nodeTemplate.getType()); superNodeTypesIDs.add(typeId); + TNodeType nodeType = this.repositoryClient.getType(nodeTemplate); TNodeType type = this.repositoryClient.getElement(typeId); //Add all further superTypes to the list while (type.getDerivedFrom() != null) { @@ -185,7 +227,7 @@ private List getSuperNodeTypesIDs (TNodeTemplate nodeTemplate) { return superNodeTypesIDs; } - private List getSuperRelationshipTypesIDs (TRelationshipTemplate relationshipTemplate) { + private List getSuperRelationshipTypesIDs(TRelationshipTemplate relationshipTemplate) { List superRelationshipTypesIDs = new ArrayList<>(); //Add NodeTemplate Type to the List RelationshipTypeId typeId = new RelationshipTypeId(relationshipTemplate.getType()); @@ -200,7 +242,51 @@ private List getSuperRelationshipTypesIDs (TRelationshipTemp return superRelationshipTypesIDs; } - private void persistPrologFile (String topology, String fileName) throws IOException { + /** + * Returns either the value of the location property or if location is undefined the value of the participant + * property + * + * @param nodeTemplate + * @return location or participant value + */ + private Optional getNodeTemplateLocation(TNodeTemplate nodeTemplate) { + QName location = new QName(Namespaces.TOSCA_WINERY_EXTENSIONS_NAMESPACE, "location"); + QName participant = new QName(Namespaces.TOSCA_WINERY_EXTENSIONS_NAMESPACE, "participant"); + + if (nodeTemplate == null) { + return Optional.empty(); + } + Map otherAttributes = nodeTemplate.getOtherAttributes(); + String targetLabel = new String(); + targetLabel = otherAttributes.entrySet().stream().filter(e -> e.getKey().toString().equals(location.toString())).map(Map.Entry::getValue).findFirst().orElse(null); + + if (targetLabel == null || targetLabel != null && (targetLabel.equals("undefined") || targetLabel.equals(""))) { + String partner = new String(); + partner = otherAttributes.entrySet().stream().filter(e -> e.getKey().toString().equals(participant.toString())).map(Map.Entry::getValue).findFirst().orElse(null); + if (partner == null || partner != null && (partner.equals("undefined") || partner.equals(""))) { + return Optional.empty(); + } else { + return Optional.ofNullable(partner).map(String::toLowerCase); + } + } + return Optional.ofNullable(targetLabel).map(String::toLowerCase); + } + + private boolean unspecifiedInfrastructure(TTopologyTemplate topologyTemplate, TNodeTemplate nodeTemplate) { + if (nodeTemplate.getId().contains("placeholder")) { + return true; + } + + List hostedOnSuccessorsOfNodeTemplate = TOSCAModelUtilities.getHostedOnSuccessorsOfNodeTemplate(topologyTemplate, nodeTemplate); + List hostedOnPredecessorsOfNodeTemplate = TOSCAModelUtilities.getHostedOnPredecessorsOfNodeTemplate(topologyTemplate, nodeTemplate); + + if (hostedOnPredecessorsOfNodeTemplate.isEmpty() && hostedOnSuccessorsOfNodeTemplate.isEmpty() && nodeTemplate.getRequirements() != null) { + return true; + } + return false; + } + + private void persistPrologFile(String topology, String fileName) throws IOException { File file = new File("topologies/" + fileName + ".pl"); try { FileWriter fileWriter = new FileWriter(file); @@ -210,7 +296,5 @@ private void persistPrologFile (String topology, String fileName) throws IOExcep } catch (IOException e) { throw new IOException("Could not write topology facts", e); } - } - } diff --git a/src/main/java/io/github/saatkamp/TopologyProblemRecognizer/model/ComponentFinding.java b/src/main/java/io/github/saatkamp/TopologyProblemRecognizer/model/ComponentFinding.java index 0b6547e..fbe0f83 100644 --- a/src/main/java/io/github/saatkamp/TopologyProblemRecognizer/model/ComponentFinding.java +++ b/src/main/java/io/github/saatkamp/TopologyProblemRecognizer/model/ComponentFinding.java @@ -1,5 +1,7 @@ package io.github.saatkamp.TopologyProblemRecognizer.model; +import java.util.Objects; + public class ComponentFinding { private String placeholder; @@ -29,4 +31,17 @@ public String getComponentId() { public void setComponentId(String componentId) { this.componentId = componentId; } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ComponentFinding that = (ComponentFinding) o; + return placeholder.equals(that.placeholder) && componentId.equals(that.componentId); + } + + @Override + public int hashCode() { + return Objects.hash(placeholder, componentId); + } } diff --git a/src/main/java/utils/TOSCAModelUtilities.java b/src/main/java/utils/TOSCAModelUtilities.java index 027ebcb..0be4136 100644 --- a/src/main/java/utils/TOSCAModelUtilities.java +++ b/src/main/java/utils/TOSCAModelUtilities.java @@ -1,6 +1,6 @@ package utils; -import org.eclipse.winery.common.ids.definitions.RelationshipTypeId; +import org.eclipse.winery.model.ids.definitions.RelationshipTypeId; import org.eclipse.winery.model.tosca.TNodeTemplate; import org.eclipse.winery.model.tosca.TRelationshipTemplate; import org.eclipse.winery.model.tosca.TRelationshipType; diff --git a/topologies/Problem_Recognition_Example_Unencrypted_Communication_w1-wip5.pl b/topologies/Problem_Recognition_Example_Unencrypted_Communication_w1-wip5.pl index 32c7b3b..1ff2d9a 100644 --- a/topologies/Problem_Recognition_Example_Unencrypted_Communication_w1-wip5.pl +++ b/topologies/Problem_Recognition_Example_Unencrypted_Communication_w1-wip5.pl @@ -9,26 +9,41 @@ component(ubuntud4e5f614a1b2c304d4e5f6vmg7h8i90). component(ubuntud4e5f614a1b2c304d4e5f6vmg7h8i91). component_of_type(java7, java7). +component_types([java7, java7]). component_of_type(phpd4e5f65d4e5f6module, phpd4e5f65d4e5f6module). +component_types([phpd4e5f65d4e5f6module, phpd4e5f65d4e5f6module]). component_of_type(phpd4e5f65d4e5f6webapplication, phpd4e5f65d4e5f6webapplication). +component_types([phpd4e5f65d4e5f6webapplication, phpd4e5f65d4e5f6webapplication]). component_of_type(tomcatg7h8i97, tomcatg7h8i97). +component_types([tomcatg7h8i97, tomcatg7h8i97]). component_of_type(apached4e5f62g7h8i94, apached4e5f62a1b2c34). +component_types([apached4e5f62g7h8i94, apached4e5f62a1b2c34]). component_of_type(openstackd4e5f6libertyd4e5f612, openstackd4e5f6libertyd4e5f612). +component_types([openstackd4e5f6libertyd4e5f612, openstackd4e5f6libertyd4e5f612]). component_of_type(vsphereg7h8i95a1b2c35, vsphereg7h8i95a1b2c35). +component_types([vsphereg7h8i95a1b2c35, vsphereg7h8i95a1b2c35]). component_of_type(ubuntud4e5f614a1b2c304d4e5f6vmg7h8i90, ubuntud4e5f614a1b2c304d4e5f6vm). component_types([ubuntud4e5f614a1b2c304d4e5f6vmg7h8i90, ubuntud4e5f614a1b2c304d4e5f6vm, vm]). component_of_type(ubuntud4e5f614a1b2c304d4e5f6vmg7h8i91, ubuntud4e5f614a1b2c304d4e5f6vm). component_types([ubuntud4e5f614a1b2c304d4e5f6vmg7h8i91, ubuntud4e5f614a1b2c304d4e5f6vm, vm]). relation(cong7h8i957, phpd4e5f65d4e5f6module, apached4e5f62g7h8i94). +relation_types([cong7h8i957, hostedon]). relation(cong7h8i993, java7, tomcatg7h8i97). +relation_types([cong7h8i993, hostedon]). relation(cong7h8i9dependsong7h8i90, phpd4e5f65d4e5f6webapplication, phpd4e5f65d4e5f6module). +relation_types([cong7h8i9dependsong7h8i90, dependson]). relation(cong7h8i9hostedong7h8i92, phpd4e5f65d4e5f6webapplication, apached4e5f62g7h8i94). +relation_types([cong7h8i9hostedong7h8i92, hostedon]). relation(cong7h8i9httpconnectstog7h8i90, phpd4e5f65d4e5f6webapplication, java7). relation_types([cong7h8i9httpconnectstog7h8i90, httpconnectsto, connectsto]). -relation(cong7h8i9hostedong7h8i90, tomcatg7h8i97, ubuntud4e5f614a1b2c304d4e5f6vmg7h8i91). -relation(cong7h8i9hostedong7h8i91, ubuntud4e5f614a1b2c304d4e5f6vmg7h8i91, vsphereg7h8i95a1b2c35). -relation(cong7h8i9hostedong7h8i93, apached4e5f62g7h8i94, ubuntud4e5f614a1b2c304d4e5f6vmg7h8i90). -relation(cong7h8i9hostedong7h8i94, ubuntud4e5f614a1b2c304d4e5f6vmg7h8i90, openstackd4e5f6libertyd4e5f612). +relation(cong7h8i9hostedong7h8i90, apached4e5f62g7h8i94, ubuntud4e5f614a1b2c304d4e5f6vmg7h8i90). +relation_types([cong7h8i9hostedong7h8i90, hostedon]). +relation(cong7h8i9hostedong7h8i91, ubuntud4e5f614a1b2c304d4e5f6vmg7h8i90, openstackd4e5f6libertyd4e5f612). +relation_types([cong7h8i9hostedong7h8i91, hostedon]). +relation(cong7h8i9hostedong7h8i93, tomcatg7h8i97, ubuntud4e5f614a1b2c304d4e5f6vmg7h8i91). +relation_types([cong7h8i9hostedong7h8i93, hostedon]). +relation(cong7h8i9hostedong7h8i94, ubuntud4e5f614a1b2c304d4e5f6vmg7h8i91, vsphereg7h8i95a1b2c35). +relation_types([cong7h8i9hostedong7h8i94, hostedon]). relation_of_type(cong7h8i957, hostedon). relation_of_type(cong7h8i993, hostedon). relation_of_type(cong7h8i9dependsong7h8i90, dependson). @@ -38,8 +53,8 @@ relation_of_type(cong7h8i9hostedong7h8i91, hostedon). relation_of_type(cong7h8i9hostedong7h8i93, hostedon). relation_of_type(cong7h8i9hostedong7h8i94, hostedon). -property(cong7h8i9httpconnectstog7h8i90, sensitivedata, true - ). +property(cong7h8i9httpconnectstog7h8i90, sensitivedata, true). +property(cong7h8i9httpconnectstog7h8i90, encrypted, false). property(openstackd4e5f6libertyd4e5f612, location, external). property(vsphereg7h8i95a1b2c35, location, internal). hosting_stack([java7, tomcatg7h8i97, ubuntud4e5f614a1b2c304d4e5f6vmg7h8i91, vsphereg7h8i95a1b2c35]).