Any person subject to this code who, except as provided by law or regulation, apprehends, arrests, or confines any person shall be punished as a court-martial may direct.