Top-Down Approach To Securing Intermittent Embedded Systems