Pakistan is preparing a sweeping overhaul of its internal security framework amid rising terrorism, insurgency and law-and-order challenges.