Пример #1
0
 def test_INP26(self):
     process1 = Process("Process")
     lambda1 = Lambda("lambda")
     process1.validatesInput = False
     process1.sanitizesInput = False
     lambda1.validatesInput = False
     lambda1.sanitizesInput = False
     threat = threats["INP26"]
     self.assertTrue(threat.apply(process1))
     self.assertTrue(threat.apply(lambda1))
Пример #2
0
 def test_INP26(self):
     process1 = Process("Process")
     lambda1 = Lambda("lambda")
     process1.validatesInput = False
     process1.sanitizesInput = False
     lambda1.validatesInput = False
     lambda1.sanitizesInput = False
     ThreatObj = Threat(
         next(item for item in threats_json if item["SID"] == "INP26"))
     self.assertTrue(ThreatObj.apply(process1))
     self.assertTrue(ThreatObj.apply(lambda1))
Пример #3
0
 def test_LB01(self):
     process1 = Process("Process1")
     process1.implementsAPI = True
     process1.validatesInput = False
     process1.sanitizesInput = False
     lambda1 = Lambda("Lambda1")
     lambda1.implementsAPI = True
     lambda1.validatesInput = False
     lambda1.sanitizesInput = False
     threat = threats["LB01"]
     self.assertTrue(threat.apply(process1))
     self.assertTrue(threat.apply(lambda1))
Пример #4
0
 def test_INP01(self):
     lambda1 = Lambda("mylambda")
     process1 = Process("myprocess")
     lambda1.usesEnvironmentVariables = True
     lambda1.sanitizesInput = False
     lambda1.checksInputBounds = False
     process1.usesEnvironmentVariables = True
     process1.sanitizesInput = False
     process1.checksInputBounds = False
     threat = threats["INP01"]
     self.assertTrue(threat.apply(lambda1))
     self.assertTrue(threat.apply(process1))
Пример #5
0
 def test_LB01(self):
     process1 = Process("Process1")
     process1.implementsAPI = True
     process1.validatesInput = False
     process1.sanitizesInput = False
     lambda1 = Lambda("Lambda1")
     lambda1.implementsAPI = True
     lambda1.validatesInput = False
     lambda1.sanitizesInput = False
     ThreatObj = Threat(next(item for item in threats_json if item["SID"] == "LB01"))
     self.assertTrue(ThreatObj.apply(process1))
     self.assertTrue(ThreatObj.apply(lambda1))
Пример #6
0
 def test_INP01(self):
     lambda1 = Lambda('mylambda')
     process1 = Process('myprocess')
     lambda1.usesEnvironmentVariables = True
     lambda1.sanitizesInput = False
     lambda1.checksInputBounds = False
     process1.usesEnvironmentVariables = True 
     process1.sanitizesInput = False 
     process1.checksInputBounds = False
     ThreatObj = Threat(next(item for item in threats_json if item["SID"] == "INP01"))
     self.assertTrue(ThreatObj.apply(lambda1))
     self.assertTrue(ThreatObj.apply(process1))
Пример #7
0
 def test_INP08(self):
     process1 = Process("Process1")
     lambda1 = Lambda("Lambda1")
     web = Server("Web Server")
     process1.validatesInput = False
     process1.sanitizesInput = False
     lambda1.validatesInput = False
     lambda1.sanitizesInput = False
     web.validatesInput = False
     web.sanitizesInput = False
     threat = threats["INP08"]
     self.assertTrue(threat.apply(process1))
     self.assertTrue(threat.apply(lambda1))
     self.assertTrue(threat.apply(web))
Пример #8
0
 def test_INP08(self):
     process1 = Process("Process1")
     lambda1 = Lambda("Lambda1")
     web = Server("Web Server")
     process1.validatesInput = False
     process1.sanitizesInput = False
     lambda1.validatesInput = False
     lambda1.sanitizesInput = False
     web.validatesInput = False
     web.sanitizesInput = False
     ThreatObj = Threat(next(item for item in threats_json if item["SID"] == "INP08"))
     self.assertTrue(ThreatObj.apply(process1))
     self.assertTrue(ThreatObj.apply(lambda1))
     self.assertTrue(ThreatObj.apply(web))