The traditional unix way to limit a process that somehow needs more privileges and still contain it so that it cannot use more than it needs to “chroot” it.
chroot changes the apparent root of the process. If everything is done correctly, he can only access these resources inside this newly created chroot environment (for example, chroot jail) for example he can only access these files, but also those devices, etc.
To create a process that makes it readily relatively easy, rather than something unusual.
To create an environment in which an existing piece of software (such as a web server, mail server, ...) feels at home and still functions properly, is something that requires experience. The main thing is to find the minimum set of necessary resources (shared libraries, configuration files, devices, dependent services (for example, syslog), ...).
swa66 source share