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