Safeguarding IoT Ecosystems