That is why we have Sheriff's Offices, police departments and National Guard.
I agree about the National Guard.
However, if you read the Posse Comitatus act, it does not preclude the military from being used for military operations.
It prevents them from being involved in police operations.
So, I did not need to worry about it being carefully written to cover military necessity. It already does that.
In other words, if the Iranian Special Forces drops a killer team into the US, then our SpecOps is more than authorized to hunt them down. In fact, they are probably the only one with the weaponry to do so.