Authorities have warned in recent months of possible assaults in the U.S. by lone attackers and affiliates of Islamic State.