IoT threat detection and prevention