Esempio n. 1
0
 def test_API01(self):
     process1 = Process("Process1")
     lambda1 = Lambda("Lambda1")
     process1.implementsAPI = True
     lambda1.implementsAPI = True
     threat = threats["API01"]
     self.assertTrue(threat.apply(process1))
     self.assertTrue(threat.apply(lambda1))
Esempio n. 2
0
 def test_API01(self):
     process1 = Process("Process1")
     lambda1 = Lambda("Lambda1")
     process1.implementsAPI = True
     lambda1.implementsAPI = True
     ThreatObj = Threat(next(item for item in threats_json if item["SID"] == "API01"))
     self.assertTrue(ThreatObj.apply(process1))
     self.assertTrue(ThreatObj.apply(lambda1))
Esempio n. 3
0
 def test_API02(self):
     process1 = Process("Process1")
     lambda1 = Lambda("Lambda1")
     process1.implementsAPI = True
     process1.validatesInput = False
     lambda1.implementsAPI = True
     lambda1.validatesInput = False
     threat = threats["API02"]
     self.assertTrue(threat.apply(process1))
     self.assertTrue(threat.apply(lambda1))
Esempio n. 4
0
 def test_LB01(self):
     process1 = Process("Process1")
     process1.implementsAPI = True
     process1.controls.validatesInput = False
     process1.controls.sanitizesInput = False
     lambda1 = Lambda("Lambda1")
     lambda1.implementsAPI = True
     lambda1.controls.validatesInput = False
     lambda1.controls.sanitizesInput = False
     threat = threats["LB01"]
     self.assertTrue(threat.apply(process1))
     self.assertTrue(threat.apply(lambda1))
Esempio n. 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))