A Formula for Protecting Infrastructure