fix big brother docstrings and disable_hooks default arg
parent
0484655e2e
commit
eb294dd9ae
|
@ -1,5 +1,4 @@
|
||||||
"""
|
"""Onionr - Private P2P Communication.
|
||||||
Onionr - Private P2P Communication
|
|
||||||
|
|
||||||
Processes interpreter hook events to detect security leaks
|
Processes interpreter hook events to detect security leaks
|
||||||
"""
|
"""
|
||||||
|
@ -33,6 +32,7 @@ def _auditing_supported():
|
||||||
|
|
||||||
|
|
||||||
def sys_hook_entrypoint(event, info):
|
def sys_hook_entrypoint(event, info):
|
||||||
|
"""Entrypoint for big brother sys auditors."""
|
||||||
if event == 'socket.connect':
|
if event == 'socket.connect':
|
||||||
ministry.ofcommunication.detect_socket_leaks(info)
|
ministry.ofcommunication.detect_socket_leaks(info)
|
||||||
elif event == 'exec':
|
elif event == 'exec':
|
||||||
|
@ -42,7 +42,8 @@ def sys_hook_entrypoint(event, info):
|
||||||
ministry.ofexec.block_system(info)
|
ministry.ofexec.block_system(info)
|
||||||
|
|
||||||
|
|
||||||
def enable_ministries(disable_hooks: Iterable = []):
|
def enable_ministries(disable_hooks: Iterable = None):
|
||||||
"""Enable auditors"""
|
"""Enable auditors."""
|
||||||
|
disable_hooks = disable_hooks or []
|
||||||
_auditing_supported() # raises PythonVersion exception if <3.8
|
_auditing_supported() # raises PythonVersion exception if <3.8
|
||||||
sys.addaudithook(sys_hook_entrypoint)
|
sys.addaudithook(sys_hook_entrypoint)
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
"""
|
"""Onionr - Private P2P Communication.
|
||||||
Onionr - Private P2P Communication
|
|
||||||
|
|
||||||
Ensure sockets don't get made to non localhost
|
Ensure sockets don't get made to non localhost
|
||||||
"""
|
"""
|
||||||
|
@ -24,7 +23,8 @@ from onionrexceptions import NetworkLeak
|
||||||
|
|
||||||
|
|
||||||
def detect_socket_leaks(socket_event):
|
def detect_socket_leaks(socket_event):
|
||||||
"""is called by the big brother broker whenever
|
"""Is called by the big brother broker whenever.
|
||||||
|
|
||||||
a socket connection happens.
|
a socket connection happens.
|
||||||
raises exception & logs if not to loopback
|
raises exception & logs if not to loopback
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue