Formal Approaches to Control System Security From Static Analysis to Runtime Enforcement