This article considers the security control problem of a safety-critical system, described by a general nonlinear uncertain system with constraints for collision avoidance and internal dynamic limitations. We design an integrated security and safety-critical control law to prevent the system from operating in the unsafe mode under denial-of-service (DoS) attacks in the signal transmission channels. By combining the internal model principle and the time-and event-triggered sampling mechanism for DoS detection, an improved dynamic compensator is first proposed and converts the safety tracking problem into the attractivity problem of the constrained error system. Then a security control is constructed for the error system by integrating the safety-critical controller in the barrier function-based framework. Finally, we prove that the integrated control design can guarantee the security, safety, and stability of the closed-loop system.