The simple answer is 'yes', but anyone reading your question might reasonably assume you to be a founder member of the 'Flat Earth Society'.
The primary role of troops is to fight and the greatest proportion service personnel (who number about 200k in total) are trained to do just that. But the enemy from within (your expression) isn't just sitting there identified and willing to put up a fight. Identification of them primarily relies on intelligence-led activities, are some specialist groups within the military are engaged in those activities, in conjunction with MI5 and the police, to gather intelligence on identified and potential groups.
So, yes we have enough personnel doing those things.