Discovering the Capabilities Required by a Program

Suppose we have a program that is unaware of capabilities and that is provided only in binary form, or we have a program whose source code is too large for us to easily read to determine which capabilities might be required to run it. If the program requires privileges, but shouldn’t be a set-user-ID-root program, then how can we determine the permitted capabilities to assign to the executable file with setcap(8)? There are two ways to answer this question: