Ejemplo n.º 1
0
 def test_AC01(self):
     web = Server("Web Server")
     process1 = Process("Process1")
     db = Datastore("DB")
     web.hasAccessControl = False
     web.authorizesSource = True
     process1.hasAccessControl = False
     process1.authorizesSource = False
     db.hasAccessControl = False
     db.authorizesSource = False
     threat = threats["AC01"]
     self.assertTrue(threat.apply(process1))
     self.assertTrue(threat.apply(web))
     self.assertTrue(threat.apply(db))
Ejemplo n.º 2
0
 def test_AC01(self):
     web = Server("Web Server")
     process1 = Process("Process1")
     db = Datastore("DB")
     web.hasAccessControl = False
     web.authorizesSource = True
     process1.hasAccessControl = False
     process1.authorizesSource = False
     db.hasAccessControl = False
     db.authorizesSource = False
     ThreatObj = Threat(next(item for item in threats_json if item["SID"] == "AC01"))
     self.assertTrue(ThreatObj.apply(process1))
     self.assertTrue(ThreatObj.apply(web))
     self.assertTrue(ThreatObj.apply(db))