From 1ddfe593200fec992d283a9b4d6ad2f1b535c018 Mon Sep 17 00:00:00 2001 From: Nadeshiko Manju Date: Fri, 20 Jun 2025 04:23:38 +0800 Subject: gh-135543: Emit sys.remote_exec audit event when sys.remote_exec is called (GH-135544) --- Python/sysmodule.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Python/sysmodule.c') diff --git a/Python/sysmodule.c b/Python/sysmodule.c index e5ae841d195..b3a2512a99d 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -2488,6 +2488,11 @@ sys_remote_exec_impl(PyObject *module, int pid, PyObject *script) if (PyUnicode_FSConverter(script, &path) == 0) { return NULL; } + + if (PySys_Audit("sys.remote_exec", "iO", pid, script) < 0) { + return NULL; + } + debugger_script_path = PyBytes_AS_STRING(path); #ifdef MS_WINDOWS PyObject *unicode_path; -- cgit v1.2.3