It is a hard choice that has thousands of people starving and suffering at your border fence because of the probability that some small fraction of them would turn on you if allowed in and creating more people who will turn on you in the future. It is difficult to determine if this is objectively the correct choice. The US is making this choice. Germany did not. In my opinion Germany made the right choice.
The other choice is to allow in the refugees, build communities with them, develop trust with them. The community will help with security fears. If they can't be allowed in, help them where they are, real actual help that works, to help them adapt and move on.
I think things are going to get a lot worse with climate change, learning this now will make the future less bleak.