This article studies secure leader-following consensus for cyber-physical systems (CPSs) under energy-limited denial-of-service (DoS) attacks. First, an event-based data update strategy is designed to reduce the communication occupancy rate of limited bandwidth. In particular, both Zeno behavior and singular triggering are excluded. Second, the irregular topological combinations caused by DoS attacks are transformed into switching topologies subject to a Markov chain. On this basis, a novel distributed resilient control strategy is proposed to ensure that agent group can achieve secure leader-following consensus. Besides, an explicit analysis of DoS frequency and duration is provided to describe attack characteristics. Finally, simulation results are given to illustrate the effectiveness of the proposed control strategy.