Skip to content
BSD syscall#429

svc · unix #429

audit_session_join

Joins the calling process to the audit session identified by the given port.

Prototype

int audit_session_join(mach_port_name_t port);

Returns: int

Arguments

NameTypeDirDescription
portmach_port_name_t-

Version history

XNU tagmacOS#
xnu-1456.1.26macOS 10.6 Snow Leopard429
xnu-1699.24.8macOS 10.7 Lion429
xnu-2050.18.24macOS 10.8 Mountain Lion429
xnu-2422.115.4macOS 10.9 Mavericks429
xnu-2782.40.9macOS 10.10 Yosemite429
xnu-3247.1.106macOS 10.11 El Capitan429
xnu-3789.1.32macOS 10.12 Sierra429
xnu-4570.1.46macOS 10.13 High Sierra429
xnu-4903.221.2macOS 10.14 Mojave429
xnu-6153.11.26macOS 10.15 Catalina429
xnu-7195.50.7.100.1macOS 11.0 Big Sur429
xnu-8019.41.5macOS 12.0 Monterey429
xnu-8792.41.9macOS 13.0 Ventura429
xnu-10002.1.13macOS 14.0 Sonoma429
xnu-11215.1.10macOS 15.0 Sequoia429
xnu-11417.101.15macOS 15.4 Sequoia429
xnu-12377.1.9macOS 26.0 Tahoe429
xnu-10002.41.9—429
xnu-10002.61.3—429
xnu-10002.81.5—429
xnu-10063.101.15—429
xnu-10063.121.3—429
xnu-10063.141.1—429
xnu-11215.41.3—429
xnu-11215.61.5—429
xnu-11215.81.4—429
xnu-11417.121.6—429
xnu-11417.140.69—429
xnu-12377.101.15—429
xnu-12377.41.6—429
xnu-12377.61.12—429
xnu-12377.81.4—429
xnu-1486.2.11—429
xnu-1504.15.3—429
xnu-1504.3.12—429
xnu-1504.7.4—429
xnu-1504.9.17—429
xnu-1504.9.26—429
xnu-1504.9.37—429
xnu-1699.22.73—429
xnu-1699.22.81—429
xnu-1699.24.23—429
xnu-1699.26.8—429
xnu-1699.32.7—429
xnu-2050.22.13—429
xnu-2050.24.15—429
xnu-2050.48.11—429
xnu-2050.7.9—429
xnu-2050.9.2—429
xnu-2422.1.72—429
xnu-2422.100.13—429
xnu-2422.110.17—429
xnu-2422.90.20—429
xnu-2782.1.97—429
xnu-2782.10.72—429
xnu-2782.20.48—429
xnu-2782.30.5—429
xnu-3247.10.11—429
xnu-3248.20.55—429
xnu-3248.30.4—429
xnu-3248.40.184—429
xnu-3248.50.21—429
xnu-3248.60.10—429
xnu-3789.21.4—429
xnu-3789.31.2—429
xnu-3789.41.3—429
xnu-3789.51.2—429
xnu-3789.60.24—429
xnu-3789.70.16—429
xnu-4570.20.62—429
xnu-4570.31.3—429
xnu-4570.41.2—429
xnu-4570.51.1—429
xnu-4570.61.1—429
xnu-4570.71.2—429
xnu-4903.231.4—429
xnu-4903.241.1—429
xnu-4903.270.47—429
xnu-6153.101.6—429
xnu-6153.121.1—429
xnu-6153.141.1—429
xnu-6153.41.3—429
xnu-6153.61.1—429
xnu-6153.81.5—429
xnu-7195.101.1—429
xnu-7195.121.3—429
xnu-7195.141.2—429
xnu-7195.60.75—429
xnu-7195.81.3—429
xnu-8019.61.5—429
xnu-8019.80.24—429
xnu-8020.101.4—429
xnu-8020.121.3—429
xnu-8020.140.41—429
xnu-8792.61.2—429
xnu-8792.81.2—429
xnu-8796.101.5—429
xnu-8796.121.2—429
xnu-8796.141.3—429

Notes

Used by helpers spawned out of a user context (XPC services, SMJobBless tools, sudo) to inherit the audit session of their caller so that subsequent audit records are correctly attributed. The port must be a valid session send right obtained from audit_session_self() or audit_session_port(). On success the process's audit session id and audit user id are replaced wholesale.

Detection

Visible as an asid change between consecutive ES events for the same PID; ES_EVENT_TYPE_NOTIFY_EXEC clients can correlate audit_token_t.au_asid before and after. Joining a session from a different UID without an exec is a strong lateral-movement indicator.

Related APIs

audit_session_selfaudit_session_portsetaudit_addrxpc_connection_get_audit_token