Managing the IoT device security lifecycle