File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,15 @@ always available.
35
35
can then log the event, raise an exception to abort the operation,
36
36
or terminate the process entirely.
37
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
+
38
47
.. audit-event :: sys.addaudithook "" sys.addaudithook
39
48
40
49
Calling :func: `sys.addaudithook ` will itself raise an auditing event
You can’t perform that action at this time.
0 commit comments