you mean like the SB shooter guy who murdered 14 Americans ?
Until he committed an act that gave probable cause for detaining him or otherwise restricting his activities and movements, what basis would you use for doing so? His religious affiliation? Where were the dots to connect to prevent this act? Nothing short of an unconstitutional ban, round-up, detention, etc. of all openly professed muslims (not just immigrants and refugees but existing American citizens) would have stopped this guy; is that what you are advocating?
If so, you have crossed Ben Franklin's line of those who would trade essential liberty for a little bit of security, and as Sam Adams would say, may posterity forget that you were our countrymen.
I believe that the SB shooters could have tracked-monitored electronically ... especially after their destination countries of choice ...
See Japanese internment. We won that war. Time to start fighting modern wars in the same way again if we ever want to win another. The Constitution is not a suicide pact.