Beispiel #1
0
        /// <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);
                    }
                }
            }
        }