private void SetSalLevel(String salLevel) { UNIVERSAL_SAL_LEVEL salLevelObject = DictionarySALs[salLevel]; selectedSalLevel = salLevel; Selected_Sal_Level_Order = salLevelObject.Sal_Level_Order; }
public UNIVERSAL_SAL_LEVEL GetUniversalSalLevelByShortName(String shortLevelString) { UNIVERSAL_SAL_LEVEL salLevel = null; dictionaryShortUniversalSalLevel.TryGetValue(shortLevelString, out salLevel); return(salLevel); }
public string GetHighestLevel(String level1, String level2) { UNIVERSAL_SAL_LEVEL level1SAL = null; UNIVERSAL_SAL_LEVEL level2SAL = null; DictionarySALs.TryGetValue(level1, out level1SAL); DictionarySALs.TryGetValue(level2, out level2SAL); if (level1SAL == null && level2SAL == null) { return(null); } else if (level1SAL == null) { return(level2); } else if (level2SAL == null) { return(level1); } else { return(level1SAL.Sal_Level_Order > level2SAL.Sal_Level_Order ? level1 : level2); } }
/// <summary> /// rewriting the rules to make more sense NOTE the data flows in the direction of the arrow /// so for this one we need to determine orientation of the device /// we want to recurse up into the network from the connections and /// see if we can find some control system devices if we can /// then data should only flow out of the control system side of the data diode /// if we find control systems components on both sides we should warn and have the user resolve it. /// maybe we should popup a dialog to determine how to analyse the network /// /// ie if this is classified then data should flow in /// if this is control systems network it should flow out /// </summary> /// <param name="component"></param> private void CheckRule7(NetworkComponent component) { if (component.IsUnidirectional) { //determine the zone type of the zone the unidirectional device //is in if the zone is anything but classified information //should flow from high to low bool isHighToLow = true; //if it is a classified zone it should flow from low to high if (component.Zone != null) { if (component.Zone.ZoneType == "Classified") { //must flow from low to high isHighToLow = false; } } //else must flow from high to low //look to see if the items connected are in the same zone //if they are not then start moving out //if items are not in my same zone foreach (NetworkComponent link in component.Connections) { if (component.IsInSameZone(link)) { continue; } bool isComponentConnectionValid = true; UNIVERSAL_SAL_LEVEL componentSal = sals[component.Zone.SAL.ToLower()]; UNIVERSAL_SAL_LEVEL targetSal = sals[link.Zone.SAL.ToLower()]; if (isHighToLow) { isComponentConnectionValid = componentSal.Sal_Level_Order > targetSal.Sal_Level_Order; } else { isComponentConnectionValid = componentSal.Sal_Level_Order < targetSal.Sal_Level_Order; } String componentName = "unnamed"; if (!String.IsNullOrWhiteSpace(component.ComponentName)) { componentName = component.ComponentName; } if (!isComponentConnectionValid) { String text = String.Format(rule7, componentName).Replace("\n", " "); SetLineMessage(component, link, text); } } } }
private void InitAndBuildRequirementQuestionPocos(UNIVERSAL_SAL_LEVEL sal, List <SETS> sets) { Requirements = new Dictionary <int, Requirement_And_Set>(); dictionaryCNSSICategory.Clear(); }
public void BuildRequirementQuestionPocos(UNIVERSAL_SAL_LEVEL selectedSalLevel, List <SETS> listActiveStandards) { createQuestionPoco = true; InitAndBuildRequirementQuestionPocos(selectedSalLevel, listActiveStandards); }
public UNIVERSAL_SAL_LEVEL GetSelectedUniversalSal() { UNIVERSAL_SAL_LEVEL salLevel = GetUniversalSalLevel(selectedSalLevel); return(salLevel); }