The trouble is that we have been co-opted into an unwinnable "war on terror" that can never be won because terrorism is a tactic, not a nation state. We might just as well have a "war on thunderstorms".
Willingness to commit terrorism is a state of mind that is not easily detectable. The means to commit an act of terrorism can be a contact lens cleaner bottle of liquid, or a hammer, or a wrench, or a match.
The only sensible statement I've seen on the subject was from a retired British policeman who stated "communities are the only vehicles that can fight terror", and I think he is absolutely right.
If you look at the muslim community that was home to some of those currently alleged to be terrorists, its a pretty sorry dead end mess.