There is currently no easy way to do this if you are linking to the features man page:
During an execve(2), the kernel calculates the new capabilities of the process using the following algorithm: P'(permitted) = (P(inheritable) & F(inheritable)) | (F(permitted) & cap_bset) P'(effective) = F(effective) ? P'(permitted) : 0 P'(inheritable) = P(inheritable) [ie, unchanged] where: P denotes the value of a thread capability set before the execve(2) P' denotes the value of a capability set after the execve(2) F denotes a file capability set cap_bset is the value of the capability bounding set
If the file you want to execute does not have the fP bit set, or if its fI bits are not set, your process will not have allowed and therefore effective capabilities.
Configuring the entire permitted file system and inheritance bits will be technically possible, but this does not make much sense, since it will greatly reduce security in the system (change: and, as you mentioned, this will not work for new executable files).
You can really provide some features to the user using pam_cap, but you cannot allow them to execute any file that they just compiled using this. Opportunities are created to provide authority to programs, not users, you can read Hallyn paper :
A key understanding is the observation that programs, not people, exercise privilege. That is, everything that is done on the computer is carried out through agent-programs - and only if these programs know what to do with the privilege, they can be trusted to use it.
See also the POSIX 1003.1e project , which defines the capabilities of POSIX, page 310:
It is also impractical to establish a chain of processes (a sequence of programs within a single process) a set of capabilities that remains fixed and active throughout the life of this chain. [...] This is the application of the principle of least privilege, and this applies equally to users and processes.
Someone has asked for what you want to do recently as the Linux kernel mailing list (dec. 2012), and there are some very interesting answers. Some people claim that the ability to delete files in the inheritance rules in exec will lead to some security issues and that the capabilities are not intended for such a function, although it doesn't explain what kind of security problem it introduces: /
The only way to do this at the moment is to change the inheritance method inherited in the Linux kernel (2 files to modify, I successfully tested it on the 3.7 kernel), but it is unclear whether this is protected or not. above.
In older kernels (before 2.6.33), it was possible to compile without the possibility of a file ( CONFIG_SECURITY_FILE_CAPABILITIES ), but I doubt that working with such an old kernel is an option for you.