sandboxFeatures

fnstring[] sandboxFeatures(int pid) @trusted

Gets the list of sandboxing features applied to a process.

This function returns a list of active sandboxing mechanisms:

  • Linux: seccomp, namespaces, cgroups, containers
  • Windows: AppContainer, low integrity, mandatory integrity control
  • macOS: Seatbelt, sandboxd

Parameters

pidThe process ID to query.

Returns

Array of strings describing active sandbox features.

Example:

version (linux) {
  import core.sys.linux.unistd : getpid;
  auto features = sandboxFeatures(getpid());
  foreach (f; features) {
     writeln("Feature: ", f);
  }
}