We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent5612471 commitad5159bCopy full SHA for ad5159b
Doc/library/sys.rst
@@ -35,6 +35,15 @@ always available.
35
can then log the event, raise an exception to abort the operation,
36
or terminate the process entirely.
37
38
+ Note that audit hooks are primarily for collecting information about internal
39
+ or otherwise unobservable actions, whether by Python or libraries written in
40
+ Python. They are not suitable for implementing a "sandbox". In particular,
41
+ malicious code can trivially disable or bypass hooks added using this
42
+ function. At a minimum, any security-sensitive hooks must be added using the
43
+ C API:c:func:`PySys_AddAuditHook` before initialising the runtime, and any
44
+ modules allowing arbitrary memory modification (such as:mod:`ctypes`) should
45
+ be completely removed or closely monitored.
46
+
47
..audit-event::sys.addaudithook "" sys.addaudithook
48
49
Calling:func:`sys.addaudithook` will itself raise an auditing event