The military has extensive classes on Posse Comitatus.   

The closest we ever got to violating it was when Eisenhower took the 101st Airborne to Little Rock and Federalized the Arkansas National Guard to enforce integration.