1. A computer-implemented method, comprising: in response to a request for launching a program: identifying a library that the program utilizes when executed; determining a list of resources of the library to be accessed by the program during execution of the program; calling a predetermined function of the library that provides access to the resources, the call including a parameter specifying one or more resource entitlements of the program, the predetermined function returning a set of rules for accessing resources associated with the library based on the one or more resource entitlements specified in the parameter; and dynamically generating a security profile for the program based on the set of rules returned from the library, wherein the security profile is used to permit the program to access a resource of the library for which a rule in the set of rules permits access, and the security profile restricts the program from accessing a library resource for which a rule in the set of rules restricts access or no rule in the set of rules permits access during execution of the program.