Surveillance, emergencies and the rule of law