RITA: Automatic Framework for Designing of Resilient IoT Applications