コード例 #1
0
ファイル: test_pytmfunc.py プロジェクト: chadeckles/pytm
 def test_AC14(self):
     process1 = Process("Process")
     process1.implementsPOLP = False
     process1.usesEnvironmentVariables = False
     process1.validatesInput = False
     threat = threats["AC14"]
     self.assertTrue(threat.apply(process1))
コード例 #2
0
ファイル: test_pytmfunc.py プロジェクト: Blue-infosec/pytm
 def test_AC14(self):
     process1 = Process("Process")
     process1.implementsPOLP = False
     process1.usesEnvironmentVariables = False
     process1.validatesInput = False
     ThreatObj = Threat(
         next(item for item in threats_json if item["SID"] == "AC14"))
     self.assertTrue(ThreatObj.apply(process1))
コード例 #3
0
ファイル: test_pytmfunc.py プロジェクト: chadeckles/pytm
 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))
コード例 #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
     ThreatObj = Threat(next(item for item in threats_json if item["SID"] == "INP01"))
     self.assertTrue(ThreatObj.apply(lambda1))
     self.assertTrue(ThreatObj.apply(process1))
コード例 #5
0
ファイル: test_pytmfunc.py プロジェクト: chadeckles/pytm
 def test_AC03(self):
     process1 = Process("Process1")
     lambda1 = Lambda("Lambda1")
     process1.usesEnvironmentVariables = True
     process1.implementsAuthenticationScheme = False
     process1.validatesInput = False
     process1.authorizesSource = False
     lambda1.usesEnvironmentVariables = True
     lambda1.implementsAuthenticationScheme = False
     lambda1.validatesInput = False
     lambda1.authorizesSource = False
     threat = threats["AC03"]
     self.assertTrue(threat.apply(process1))
     self.assertTrue(threat.apply(lambda1))
コード例 #6
0
 def test_AC03(self):
     process1 = Process("Process1")
     lambda1 = Lambda("Lambda1")
     process1.usesEnvironmentVariables = True
     process1.implementsAuthenticationScheme = False
     process1.validatesInput = False
     process1.authorizesSource = False
     lambda1.usesEnvironmentVariables = True
     lambda1.implementsAuthenticationScheme = False
     lambda1.validatesInput = False
     lambda1.authorizesSource = False
     ThreatObj = Threat(next(item for item in threats_json if item["SID"] == "AC03"))
     self.assertTrue(ThreatObj.apply(process1))
     self.assertTrue(ThreatObj.apply(lambda1))