Cyber-Physical Systems (CPSs) have vital importance because of their applications in many different areas. Attacks on these CPSs can cause considerable impact on public safety in addition to economic losses. Although studies on increasing the protection and reliability of CPSs against random malfunction are available, protection of CPSs against malignant attacks is needed. In particular, wireless sensor and actuator networks increase the attack risk. Even when a CPS functions properly, there can be undetectable attacks increasing costs or waiting for the right time to attack and destroy the CPS.