Example #1
0
        public void FakeCMDScanTest()
        {
            RiskAssessor riskAssessor     = NewRiskAssessor();
            bool         reachedThreshold = false;
            int          riskScore        = 0;

            reachedThreshold = riskAssessor.addRemoteConnectionRisk();
            riskScore        = riskAssessor.calculateRiskScore();
            Assert.IsFalse(reachedThreshold);
            Assert.AreEqual(riskScore, 50);


            reachedThreshold = riskAssessor.addAndAssessRisks(RiskAssessor.EventRisk.COMMAND_PROMPT);
            riskScore        = riskAssessor.calculateRiskScore();
            Assert.IsFalse(reachedThreshold);
            Assert.AreEqual(riskScore, 70);

            reachedThreshold = riskAssessor.addAndAssessRisks(RiskAssessor.EventRisk.CMD_SCAN);
            riskScore        = riskAssessor.calculateRiskScore();
            Assert.IsFalse(reachedThreshold);
            Assert.AreEqual(riskScore, 90);

            reachedThreshold = riskAssessor.addAndAssessRisks(RiskAssessor.EventRisk.SUSPICIOUS_KEYBOARD_INPUT);
            riskScore        = riskAssessor.calculateRiskScore();
            Assert.IsTrue(reachedThreshold);
            Assert.AreEqual(riskScore, 130);
        }
Example #2
0
        public void AddRunWindowRiskTest()
        {
            RiskAssessor riskAssessor = NewRiskAssessor();

            riskAssessor.AddRisk(RiskAssessor.EventRisk.RUN_WINDOW);
            int riskScore = riskAssessor.calculateRiskScore();

            Assert.AreEqual(riskScore, 20);
        }
Example #3
0
        public void AddEventViewerRiskTest()
        {
            RiskAssessor riskAssessor = NewRiskAssessor();

            riskAssessor.AddRisk(RiskAssessor.EventRisk.EVENT_VIEWER);
            int riskScore = riskAssessor.calculateRiskScore();

            Assert.AreEqual(riskScore, 30);
        }
Example #4
0
        public void AddSuspiciousInputRiskTest()
        {
            RiskAssessor riskAssessor = NewRiskAssessor();

            riskAssessor.AddRisk(RiskAssessor.EventRisk.SUSPICIOUS_KEYBOARD_INPUT);
            int riskScore = riskAssessor.calculateRiskScore();

            Assert.AreEqual(riskScore, 40);
        }
Example #5
0
        public void AddCommandScanRiskTest()
        {
            RiskAssessor riskAssessor = NewRiskAssessor();

            riskAssessor.AddRisk(RiskAssessor.EventRisk.CMD_SCAN);
            int riskScore = riskAssessor.calculateRiskScore();

            Assert.AreEqual(riskScore, 20);
        }
Example #6
0
        public void AddCommandPromptRiskTest()
        {
            RiskAssessor riskAssessor = NewRiskAssessor();

            riskAssessor.AddRisk(RiskAssessor.EventRisk.COMMAND_PROMPT);
            int riskScore = riskAssessor.calculateRiskScore();

            Assert.AreEqual(riskScore, 20);
        }
Example #7
0
        public void AddRemoteConnectionRiskTest()
        {
            RiskAssessor riskAssessor = NewRiskAssessor();

            riskAssessor.addRemoteConnectionRisk();
            int riskScore = riskAssessor.calculateRiskScore();

            Assert.AreEqual(riskScore, 50);
        }
Example #8
0
        public void AddIExplorerRiskTest()
        {
            Mock <GlobalInputDetection> mockGlobalInputDetection = new Mock <GlobalInputDetection>();
            RiskAssessor riskAssessor = new RiskAssessor(mockGlobalInputDetection.Object);

            riskAssessor.AddRisk(RiskAssessor.EventRisk.RUN_IEXPLORER);
            int riskScore = riskAssessor.calculateRiskScore();

            Assert.AreEqual(riskScore, 20);
        }