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
Many command execution functions are not raising auditing events #83365
Comments
Similar to
By the way, since |
Agreed, we should add events for all of these. They can go into the next 3.8 release. Ideally, the lowest level operations (typically os module) should raise events. Where it's convenient to also audit operations at a higher level (shutil, subprocess, etc.) then we can do that too, as it provides helpful context for *why* the lower-level operation ran. Contributions welcome :) I'll likely get to them eventually, but no reason it has to be me adding everything. |
I have made PR 17824 to add auditing events for the command execution functions mentioned above. After a review on other related Python modules, I think maybe the following functions can also be audited, but a discussion may be required to determine whether they are necessary (whether these actions are sensitive enough to record, and performance trade off).
|
Thanks for the spawn patch, I've merged it. On the second list, I'd say go for it. The only one I'd skip are the stat() calls (and those that just do a stat call, such as exists/isfile, etc.), and getcwd() (which has many other ways to implicitly use the information). Maybe skip getenv as well, but modifying the environment is worth collecting. |
Thanks for your review! PR 18407 is for the second list. For now I haven't added audit hooks for the http, socketserver and xmlrpc modules because they look a bit complex. There seems to be so many classes and methods to hook, we may need to find good places to hook (similar to what has been done on ftplib, imaplib, nntplib, poplib, smtplib, telnetlib and urllib). |
Since the original problem (command execution functions missing audit events) is already solved, we can close this issue now. Further discussions on additional audit hooks (e.g. for the networking modules) could go to bpo-37363. |
gousaiyang mannequin commentedJan 1, 2020
fcntl
,msvcrt
,os
,resource
,shutil
,signal
,syslog
#18407fcntl
,msvcrt
,os
,resource
,shutil
,signal
,syslog
(GH-18407) #18500msvcrt_get_osfhandle_impl
#21322Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: