Skip to content

[3.10] gh-87604: Clarify in docs that sys.addaudithook is not for sandboxes (GH-99372) #99375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-87604: Clarify in docs that sys.addaudithook is not for sandboxes (G…
…H-99372)

(cherry picked from commit c3c3871)

Co-authored-by: Steve Dower <steve.dower@python.org>
  • Loading branch information
zooba authored and miss-islington committed Nov 11, 2022
commit da6b9f06a74fa803f2c271bd29cf112941fdd809
9 changes: 9 additions & 0 deletions Doc/library/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ always available.
can then log the event, raise an exception to abort the operation,
or terminate the process entirely.

Note that audit hooks are primarily for collecting information about internal
or otherwise unobservable actions, whether by Python or libraries written in
Python. They are not suitable for implementing a "sandbox". In particular,
malicious code can trivially disable or bypass hooks added using this
function. At a minimum, any security-sensitive hooks must be added using the
C API :c:func:`PySys_AddAuditHook` before initialising the runtime, and any
modules allowing arbitrary memory modification (such as :mod:`ctypes`) should
be completely removed or closely monitored.

.. audit-event:: sys.addaudithook "" sys.addaudithook

Calling :func:`sys.addaudithook` will itself raise an auditing event
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy