Struct endpoint_sec::AuditToken
source · #[repr(transparent)]pub struct AuditToken(pub audit_token_t);Expand description
A wrapper around an audit_token_t.
Tuple Fields§
§0: audit_token_tImplementations§
source§impl AuditToken
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§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for AuditToken
impl Debug for AuditToken
source§impl Hash for AuditToken
impl Hash for AuditToken
source§impl LowerHex for AuditToken
impl LowerHex for AuditToken
source§impl PartialEq for AuditToken
impl PartialEq for AuditToken
source§impl UpperHex for AuditToken
impl UpperHex for AuditToken
impl Copy for AuditToken
impl Eq for AuditToken
Auto Trait Implementations§
impl Freeze for AuditToken
impl RefUnwindSafe for AuditToken
impl Send for AuditToken
impl Sync for AuditToken
impl Unpin for AuditToken
impl UnwindSafe for AuditToken
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)