CEOs are reinventing their companies with technology and seeking growth opportunities in new sectors, even as they see elevated threats ahead.