Adaptive Defense for IoT Ecosystems: Securing the Smart Edge