Complex, interconnected Cyber-physical Systems (CPS) are increasingly common
in applications including smart grids and transportation. Ensuring safety of
interconnected systems whose dynamics are coupled is challenging because the
effects of faults and attacks in one sub-system can propagate to other
sub-systems and lead to safety violations. In this paper, we study the problem
of safety-critical control for CPS with coupled dynamics when some sub-systems
are subject to failure or attack. We first propose resilient-safety indices
(RSIs) for the faulty or compromised sub-systems that bound the worst-case
impacts of faulty or compromised sub-systems on a set of specified safety
constraints. By incorporating the RSIs, we provide a sufficient condition for
the synthesis of control policies in each failure- and attack- free
sub-systems. The synthesized control policies compensate for the impacts of the
faulty or compromised sub-systems to guarantee safety. We formulate
sum-of-square optimization programs to compute the RSIs and the safety-ensuring
control policies. We present a case study that applies our proposed approach on
the temperature regulation of three coupled rooms. The case study demonstrates
that control policies obtained using our algorithm guarantee system's safety
constraints