Like a city, the ship has a fire and emergency response capability and its own security organization, including security forces, legal services, brig and a process by which the captain enforces good order and discipline.
FORBES: What Is It Like To Be The Commanding Officer Of An Aircraft Carrier?