Community structure underpins many complex networked systems and plays a vital role when components in some modules of the network come under attack or failure. Here, we study the generalized k-core (Gk-core) percolation over a modular random network model. Unlike the archetypal giant component based quantities, Gk-core can be viewed as a resilience metric tailored to gauge the network robustness subject to spreading virus or epidemics paralyzing weak nodes, i.e., nodes of degree less than k, and their nearest neighbors. We develop two complementary frameworks, namely, the generating function formalism and the rate equation approach, to characterize the Gkcore of modular networks. Through extensive numerical calculations and simulations, it is found that G2-core percolation undergoes a continuous phase transition while Gk-core percolation for k \geq 3 displays a first-order phase transition for any fraction of interconnecting nodes. The influence of interconnecting nodes tends to be more visible nearer the percolation threshold. We find by studying modular networks with two Erd\H os--R\'enyi modules that the interconnections between modules affect the G2-core percolation phase transition in a way similar to an external field in a spin system, where Widom's identity regulating the critical exponents of the system is fulfilled. However, this analogy does not seem to exist for Gk-core with k \geq 3 in general.