Securing applications from threats