fix ofexec auditor docstrings
This commit is contained in:
parent
906219fe30
commit
f5a98fba13
@ -1,5 +1,4 @@
|
|||||||
"""
|
"""Onionr - Private P2P Communication.
|
||||||
Onionr - Private P2P Communication
|
|
||||||
|
|
||||||
Prevent eval/exec/os.system and log it
|
Prevent eval/exec/os.system and log it
|
||||||
"""
|
"""
|
||||||
@ -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 = [
|
||||||
|
Loading…
Reference in New Issue
Block a user