pub struct Process<'a> { /* private fields */ }
Expand description
Information related to a process.
Implementations§
Source§impl<'a> Process<'a>
impl<'a> Process<'a>
Sourcepub const fn new(raw: &'a es_process_t, version: u32) -> Self
pub const fn new(raw: &'a es_process_t, version: u32) -> Self
Create a new Process
instance.
Sourcepub fn audit_token(&self) -> AuditToken
pub fn audit_token(&self) -> AuditToken
Audit token of the process.
Sourcepub fn ppid(&self) -> pid_t
pub fn ppid(&self) -> pid_t
Parent pid of the process.
Warning: It is recommended to instead use Self::parent_audit_token()
when available.
Sourcepub fn original_ppid(&self) -> pid_t
pub fn original_ppid(&self) -> pid_t
Original ppid of the process.
Sourcepub fn session_id(&self) -> pid_t
pub fn session_id(&self) -> pid_t
Process session id the process belongs to.
Sourcepub fn codesigning_flags(&self) -> u32
pub fn codesigning_flags(&self) -> u32
Code signing flags of the process.
Sourcepub fn is_platform_binary(&self) -> bool
pub fn is_platform_binary(&self) -> bool
Indicates whether the process is a platform binary.
Note: A “platform binary” is a binary signed with Apple certificates.
§Usage of is_platform_binary
with Message
s and EventExec
s
If your application is looking to allow/deny AuthExec
events, be sure to check EventExec::target()
, not
Message::process()
, else you will get the wrong result, especially since pretty much
all processes are lauched through xpcproxy
, a platform binary.
Sourcepub fn is_es_client(&self) -> bool
pub fn is_es_client(&self) -> bool
Indicates this process has the Endpoint Security entitlement.
Sourcepub fn cdhash(&self) -> [u8; 20]
pub fn cdhash(&self) -> [u8; 20]
Code directory hash of the code signature associated with this process.
Sourcepub fn signing_id(&self) -> &'a OsStr
pub fn signing_id(&self) -> &'a OsStr
Signing id of the code signature associated with this process.
Sourcepub fn executable(&self) -> File<'a>
pub fn executable(&self) -> File<'a>
Executable file that is executing in this process.
Sourcepub fn tty(&self) -> Option<File<'a>>
Available on crate feature macos_10_15_1
only.
pub fn tty(&self) -> Option<File<'a>>
macos_10_15_1
only.TTY associated to this process (if present) on version 2 and later, otherwise None.
Sourcepub fn start_time(&self) -> Option<SystemTime>
Available on crate feature macos_10_15_4
only.
pub fn start_time(&self) -> Option<SystemTime>
macos_10_15_4
only.Process start time on version 3 and later, otherwise None.
Sourcepub fn responsible_audit_token(&self) -> Option<AuditToken>
Available on crate feature macos_11_0_0
only.
pub fn responsible_audit_token(&self) -> Option<AuditToken>
macos_11_0_0
only.Audit token of the process responsible for this process on version 4 and later, if any.
Warning: It may be the process itself in case there is no responsible process or the responsible process has already exited.
Sourcepub fn parent_audit_token(&self) -> Option<AuditToken>
Available on crate feature macos_11_0_0
only.
pub fn parent_audit_token(&self) -> Option<AuditToken>
macos_11_0_0
only.Audit token of the parent process on version 4 and later, otherwise None.