Search in sources :

Example 1 with CyberRel

use of com.ge.verdict.attackdefensecollector.model.CyberRel in project VERDICT by ge-high-assurance.

the class AttackDefenseCollector method performInference.

/**
 * Perform inference on the loaded model. Factored out because it is used in both the CSV and
 * VDM approaches. Must be called after systems and cyber relations are loaded.
 */
private void performInference() {
    int inferenceCounter = 0;
    for (SystemModel system : sysNameToSystemModelMap.values()) {
        // because we don't want to infer cyber relations for a system with subcomponents
        if (system.getCyberRels().isEmpty() && system.getInternalIncomingConnections().isEmpty() && system.getInternalOutgoingConnections().isEmpty()) {
            Logger.println("Inferring cyber relations for system " + system.getName());
            // anyway because it can't be traced.
            for (ConnectionModel outgoing : system.getOutgoingConnections()) {
                if (!system.getIncomingConnections().isEmpty()) {
                    // For each of C, I, A, we have X -> X
                    for (CIA cia : CIA.values()) {
                        CyberExpr condition = new CyberOr(system.getIncomingConnections().stream().map(incoming -> new PortConcern(incoming.getDestinationPortName(), cia)).collect(Collectors.toList()));
                        system.addCyberRel(new CyberRel("_inference" + (inferenceCounter++), condition, new PortConcern(outgoing.getSourcePortName(), cia)));
                    }
                    // We also have I -> A
                    system.addCyberRel(new CyberRel("_inference" + (inferenceCounter++), new CyberOr(system.getIncomingConnections().stream().map(incoming -> new PortConcern(incoming.getDestinationPortName(), CIA.I)).collect(Collectors.toList())), new PortConcern(outgoing.getSourcePortName(), CIA.A)));
                }
            }
        }
    }
}
Also used : CyberRel(com.ge.verdict.attackdefensecollector.model.CyberRel) SystemModel(com.ge.verdict.attackdefensecollector.model.SystemModel) CyberExpr(com.ge.verdict.attackdefensecollector.model.CyberExpr) PortConcern(com.ge.verdict.attackdefensecollector.model.PortConcern) ConnectionModel(com.ge.verdict.attackdefensecollector.model.ConnectionModel) CIA(com.ge.verdict.attackdefensecollector.model.CIA) CyberOr(com.ge.verdict.attackdefensecollector.model.CyberOr)

Aggregations

CIA (com.ge.verdict.attackdefensecollector.model.CIA)1 ConnectionModel (com.ge.verdict.attackdefensecollector.model.ConnectionModel)1 CyberExpr (com.ge.verdict.attackdefensecollector.model.CyberExpr)1 CyberOr (com.ge.verdict.attackdefensecollector.model.CyberOr)1 CyberRel (com.ge.verdict.attackdefensecollector.model.CyberRel)1 PortConcern (com.ge.verdict.attackdefensecollector.model.PortConcern)1 SystemModel (com.ge.verdict.attackdefensecollector.model.SystemModel)1