processSecurityContext
Gets security context information for a Linux process.
This function retrieves SELinux context, AppArmor profile, capabilities, seccomp filters, and namespace information for the specified process.
Parameters
pid | The process ID to query. |
Returns
SecurityContext struct containing security information.
Throws
NoSuchProcess if the process doesn't exist.
AccessDenied if insufficient permissions to read security information.
Example:
version (linux) {
import core.sys.linux.unistd : getpid;
auto ctx = processSecurityContext(getpid());
writeln("SELinux: ", ctx.selinuxContext);
}