#[repr(transparent)]pub struct AuditToken(pub audit_token_t);
Expand description
A wrapper around an audit_token_t
.
Tuple Fields§
§0: audit_token_t
Implementations§
Source§impl AuditToken
Endpoint Security wrappers and test helpers
impl AuditToken
Endpoint Security wrappers and test helpers
Sourcepub fn from_pid(pid: pid_t) -> Option<Self>
Available on crate feature audit_token_from_pid
only.
pub fn from_pid(pid: pid_t) -> Option<Self>
audit_token_from_pid
only.Get the AuditToken
for the given pid, if it exists.
Endpoint Security does not currently provide a way to get the audit tokens for already processes when first connecting a client, but it is relatively easy to list the PIDs of the current processes.
§Implementation details
Currently this method is implemented following the method described here, with
calls to task_name_for_pid
and task_info(_, TASK_AUDIT_TOKEN, _, _)
but the first
function is marked as obsolete in the header containing it in macOS’s SDK.
Other possibilities could be task_for_pid()
or task_inspect_for_pid()
. For now the
current implementation is the most backward compatible. If you find a bug/need us to use a
more recent method, please signal it.
Sourcepub fn raw_token(&self) -> &audit_token_t
pub fn raw_token(&self) -> &audit_token_t
Raw underlying audit token.
Sourcepub fn auid(&self) -> uid_t
pub fn auid(&self) -> uid_t
The audit user ID.
NOTE: Used to identify Mach tasks and senders of Mach messages as subjects of the audit system.
Sourcepub fn euid(&self) -> uid_t
pub fn euid(&self) -> uid_t
The effective user ID.
NOTE: Used to identify Mach tasks and senders of Mach messages as subjects of the audit system.
Sourcepub fn egid(&self) -> gid_t
pub fn egid(&self) -> gid_t
The effective group ID.
NOTE: Used to identify Mach tasks and senders of Mach messages as subjects of the audit system.
Sourcepub fn ruid(&self) -> uid_t
pub fn ruid(&self) -> uid_t
The real user ID.
NOTE: Used to identify Mach tasks and senders of Mach messages as subjects of the audit system.
Sourcepub fn rgid(&self) -> gid_t
pub fn rgid(&self) -> gid_t
The real group ID.
NOTE: Used to identify Mach tasks and senders of Mach messages as subjects of the audit system.
Sourcepub fn pid(&self) -> pid_t
pub fn pid(&self) -> pid_t
The process ID.
NOTE: Used to identify Mach tasks and senders of Mach messages as subjects of the audit system.
Sourcepub fn asid(&self) -> au_asid_t
pub fn asid(&self) -> au_asid_t
The audit session ID.
NOTE: Used to identify Mach tasks and senders of Mach messages as subjects of the audit system.
Sourcepub fn pidversion(&self) -> i32
pub fn pidversion(&self) -> i32
The process ID version.
NOTE: Used to identify Mach tasks and senders of Mach messages as subjects of the audit system.
Trait Implementations§
Source§impl Clone for AuditToken
impl Clone for AuditToken
Source§fn clone(&self) -> AuditToken
fn clone(&self) -> AuditToken
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more