audit_events — 감사 이벤트 표
audit_events — 감사 이벤트 표 (Audit events table)
CPython 런타임과 표준 라이브러리 전체에서 sys.audit() 또는 PySys_Audit() 호출로 발생하는 모든 감사(audit) 이벤트 목록이에요. 이 호출들은 3.8 이상에서 추가됐어요(PEP 578 참고).
출처: Python 표준 라이브러리
본문
이 표에는 CPython 런타임과 표준 라이브러리 전체에서 sys.audit() 또는 PySys_Audit() 호출로 발생하는 모든 이벤트가 담겨 있어요. 이 호출들은 3.8 이상에서 추가됐어요(PEP 578 참고).
이 이벤트를 다루는 방법에 대한 정보는 sys.addaudithook()과 PySys_AddAuditHook()을 참고하세요.
CPython 구현 세부사항: 이 표는 CPython 문서에서 생성된 것으로, 다른 구현에서 발생하는 이벤트를 나타내지 않을 수 있어요. 실제 발생하는 이벤트에 대해서는 실행 환경의 문서를 확인해야 해요.
이벤트 표
| 감사 이벤트 (Audit event) | 인자 (Arguments) |
|---|---|
_thread.start_new_thread |
function, args, kwargs |
array.__new__ |
typecode, initializer |
builtins.breakpoint |
breakpointhook |
builtins.id |
id |
builtins.input |
prompt |
builtins.input/result |
result |
code.__new__ |
code, filename, name, argcount, posonlyargcount, kwonlyargcount, nlocals, stacksize, flags |
compile |
source, filename |
cpython.PyConfig_Set |
name, value |
cpython.PyInterpreterState_Clear |
|
cpython.PyInterpreterState_New |
|
cpython._PySys_ClearAuditHooks |
|
cpython.remote_debugger_script |
script_path |
cpython.run_command |
command |
cpython.run_file |
filename |
cpython.run_interactivehook |
hook |
cpython.run_module |
module-name |
cpython.run_startup |
filename |
cpython.run_stdin |
|
ctypes.addressof |
obj |
ctypes.call_function |
func_pointer, arguments |
ctypes.cdata |
address |
ctypes.cdata/buffer |
pointer, size, offset |
ctypes.create_string_buffer |
init, size |
ctypes.create_unicode_buffer |
init, size |
ctypes.dlopen |
name |
ctypes.dlsym |
library, name |
ctypes.dlsym/handle |
handle, name |
ctypes.get_errno |
|
ctypes.get_last_error |
|
ctypes.memoryview_at |
address, size, readonly |
ctypes.set_errno |
errno |
ctypes.set_exception |
code |
ctypes.set_last_error |
error |
ctypes.string_at |
ptr, size |
ctypes.wstring_at |
ptr, size |
ensurepip.bootstrap |
root |
exec |
code_object |
fcntl.fcntl |
fd, cmd, arg |
fcntl.flock |
fd, operation |
fcntl.ioctl |
fd, request, arg |
fcntl.lockf |
fd, cmd, len, start, whence |
ftplib.connect |
self, host, port |
ftplib.sendcmd |
self, cmd |
function.__new__ |
code |
gc.get_objects |
generation |
gc.get_referents |
objs |
gc.get_referrers |
objs |
glob.glob |
pathname, recursive |
glob.glob/2 |
pathname, recursive, root_dir, dir_fd |
http.client.connect |
self, host, port |
http.client.send |
self, data |
imaplib.open |
self, host, port |
imaplib.send |
self, data |
import |
module, filename, sys.path, sys.meta_path, sys.path_hooks |
marshal.dumps |
value, version |
marshal.load |
|
marshal.loads |
bytes |
mmap.__new__ |
fileno, length, access, offset |
msvcrt.get_osfhandle |
fd |
msvcrt.locking |
fd, mode, nbytes |
msvcrt.open_osfhandle |
handle, flags |
object.__delattr__ |
obj, name |
object.__getattr__ |
obj, name |
object.__setattr__ |
obj, name, value |
open |
path, mode, flags |
os.add_dll_directory |
path |
os.chdir |
path |
os.chflags |
path, flags |
os.chmod |
path, mode, dir_fd |
os.chown |
path, uid, gid, dir_fd |
os.exec |
path, args, env |
os.fork |
|
os.forkpty |
|
os.fwalk |
top, topdown, onerror, follow_symlinks, dir_fd |
os.getxattr |
path, attribute |
os.kill |
pid, sig |
os.killpg |
pgid, sig |
os.link |
src, dst, src_dir_fd, dst_dir_fd |
os.listdir |
path |
os.listdrives |
|
os.listmounts |
volume |
os.listvolumes |
|
os.listxattr |
path |
os.lockf |
fd, cmd, len |
os.mkdir |
path, mode, dir_fd |
os.posix_spawn |
path, argv, env |
os.putenv |
key, value |
os.remove |
path, dir_fd |
os.removexattr |
path, attribute |
os.rename |
src, dst, src_dir_fd, dst_dir_fd |
os.rmdir |
path, dir_fd |
os.scandir |
path |
os.setxattr |
path, attribute, value, flags |
os.spawn |
mode, path, args, env |
os.startfile |
path, operation |
os.startfile/2 |
path, operation, arguments, cwd, show_cmd |
os.symlink |
src, dst, dir_fd |
os.system |
command |
os.truncate |
fd, length |
os.unsetenv |
key |
os.utime |
path, times, ns, dir_fd |
os.walk |
top, topdown, onerror, followlinks |
pathlib.Path.glob |
self, pattern |
pathlib.Path.rglob |
self, pattern |
pdb.Pdb |
|
pickle.find_class |
module, name |
poplib.connect |
self, host, port |
poplib.putline |
self, line |
pty.spawn |
argv |
resource.prlimit |
pid, resource, limits |
resource.setrlimit |
resource, limits |
setopencodehook |
|
shutil.chown |
path, user, group |
shutil.copyfile |
src, dst |
shutil.copymode |
src, dst |
shutil.copystat |
src, dst |
shutil.copytree |
src, dst |
shutil.make_archive |
base_name, format, root_dir, base_dir |
shutil.move |
src, dst |
shutil.rmtree |
path, dir_fd |
shutil.unpack_archive |
filename, extract_dir, format |
signal.pthread_kill |
thread_id, signalnum |
smtplib.connect |
self, host, port |
smtplib.send |
self, data |
socket.__new__ |
self, family, type, protocol |
socket.bind |
self, address |
socket.connect |
self, address |
socket.getaddrinfo |
host, port, family, type, protocol |
socket.gethostbyaddr |
ip_address |
socket.gethostbyname |
hostname |
socket.gethostname |
|
socket.getnameinfo |
sockaddr |
socket.getservbyname |
servicename, protocolname |
socket.getservbyport |
port, protocolname |
socket.sendmsg |
self, address |
socket.sendto |
self, address |
socket.sethostname |
name |
sqlite3.connect |
database |
sqlite3.connect/handle |
connection_handle |
sqlite3.enable_load_extension |
connection, enabled |
sqlite3.load_extension |
connection, path |
subprocess.Popen |
executable, args, cwd, env |
sys._current_exceptions |
|
sys._current_frames |
|
sys._getframe |
frame |
sys._getframemodulename |
depth |
sys.addaudithook |
|
sys.excepthook |
hook, type, value, traceback |
sys.monitoring.register_callback |
func |
sys.remote_exec |
pid |
sys.set_asyncgen_hooks_finalizer |
|
sys.set_asyncgen_hooks_firstiter |
|
sys.setprofile |
|
sys.settrace |
|
sys.unraisablehook |
hook, unraisable |
syslog.closelog |
|
syslog.openlog |
ident, logoption, facility |
syslog.setlogmask |
maskpri |
syslog.syslog |
priority, message |
tempfile.mkdtemp |
fullpath |
tempfile.mkstemp |
fullpath |
time.sleep |
seconds |
urllib.Request |
fullurl, data, headers, method |
webbrowser.open |
url |
winreg.ConnectRegistry |
computer_name, key |
winreg.CreateKey |
key, sub_key, access |
winreg.DeleteKey |
key, sub_key, access |
winreg.DeleteValue |
key, value |
winreg.DisableReflectionKey |
key |
winreg.EnableReflectionKey |
key |
winreg.EnumKey |
key, index |
winreg.EnumValue |
key, index |
winreg.ExpandEnvironmentStrings |
str |
winreg.LoadKey |
key, sub_key, file_name |
winreg.OpenKey |
key, sub_key, access |
winreg.OpenKey/result |
key |
winreg.PyHKEY.Detach |
key |
winreg.QueryInfoKey |
key |
winreg.QueryReflectionKey |
key |
winreg.QueryValue |
key, sub_key, value_name |
winreg.SaveKey |
key, file_name |
winreg.SetValue |
key, sub_key, type, value |
내부적으로 발생하는 이벤트
다음 이벤트들은 내부적으로 발생하며 CPython의 공개 API 중 어느 것과도 대응하지 않아요:
| 감사 이벤트 (Audit event) | 인자 (Arguments) |
|---|---|
_winapi.CreateFile |
file_name, desired_access, share_mode, creation_disposition, flags_and_attributes |
_winapi.CreateJunction |
src_path, dst_path |
_winapi.CreateNamedPipe |
name, open_mode, pipe_mode |
_winapi.CreatePipe |
|
_winapi.CreateProcess |
application_name, command_line, current_directory |
_winapi.OpenProcess |
process_id, desired_access |
_winapi.TerminateProcess |
handle, exit_code |
_posixsubprocess.fork_exec |
exec_list, args, env |
ctypes.PyObj_FromPtr |
obj |
3.14 버전에서 추가:
_posixsubprocess.fork_exec내부 감사 이벤트.