A non-transitory machine readable medium storing instructions, for reducing one or more security vulnerabilities to which an application associated with a container image is exposed, which when executed by one or more processing resources of a system, cause the system to:
- receive the container image in which the application and its dependencies, including one or more libraries, are packaged;
- prior to execution of the application, identify a first set of kernel system calls by performing a static analysis of an executable representing the application, wherein the static analysis discovers one or more dynamically loaded symbols corresponding to one or more functions of a shared library of the one or more libraries in which the one or more functions of the shared library depend on respective kernel system calls of the first set of kernel system calls;
- create or update a security policy based on the first set of kernel system calls;
- cause a kernel security module to block those kernel system calls that are not in the first set of kernel system calls during execution of the application by configuring the kernel security module based on the security policy;
- during execution of the application, determine a second set of kernel system calls that are actually used by the application, wherein determination of the second set of kernel system calls involves observing actual use of one or more dynamically loaded symbols corresponding to the one or more functions of the shared library that ultimately lead to respective kernel system calls of the second set of kernel system calls, and wherein a decision regarding which of the one or more functions ultimately lead to respective kernel system calls of the second set of kernel system calls is arrived at by for each function of the one or more functions by determining a kernel system call of the second set of kernel system calls upon which the function is reliant based on usage by the function of a second set of one or more functions contained within a standard library of the one or more libraries and a known mapping between the second set of one or more functions and the respective kernel system calls;
- refine the security policy based on the second set of kernel system calls;
- and
- cause the kernel security module to block those kernel system calls that are not in the second set of kernel system calls during execution of the application by configuring the kernel security module based on the refined security policy.