fix ofexec auditor docstrings

This commit is contained in:
Kevin Froman 2019-12-19 23:22:51 -06:00
parent 906219fe30
commit f5a98fba13

View File

@ -1,5 +1,4 @@
"""
Onionr - Private P2P Communication
"""Onionr - Private P2P Communication.
Prevent eval/exec/os.system and log it
"""
@ -26,6 +25,7 @@ from onionrexceptions import ArbitraryCodeExec
def block_system(cmd):
"""Prevent os.system except for whitelisted commands+contexts."""
allowed = 'taskkill /PID '
is_ok = False
if platform.platform == 'Windows':
@ -42,8 +42,7 @@ def block_system(cmd):
def block_exec(event, info):
"""Prevent arbitrary code execution in eval/exec and log it
"""
"""Prevent arbitrary code execution in eval/exec and log it."""
# because libraries have stupid amounts of compile/exec/eval,
# We have to use a whitelist where it can be tolerated
whitelisted_code = [