We asked 2 political scientists the above question. As best they could discern, every single ISIL terrorist attack in the USA had been committed by lawful residents. Here were some of the attacks they studied:

https://en.wikipedia.org/wiki/Curtis_Culwell_Center_attack
https://en.wikipedia.org/wiki/2014_Queens_hatchet_attack
https://en.wikipedia.org/wiki/2017_New_York_City_attempted_bombing
https://en.wikipedia.org/wiki/2017_New_York_City_truck_attack
https://en.wikipedia.org/wiki/Ohio_State_University_attack

If this is the case, the entire logic that “we can’t trust a wave of recent immigrants” might seem to be flawed, if history has anything to say about it. (Thanks Chris and Caleb.)