A privacy-aware approach to threat detection