One of the best analyses of the fallout from the Sinai attack I've read, from The Economist, worth a long quote:
For years Hamas has suppressed jihadists groups in Gaza, especially those espousing puritanical Salafist ideals that hark back to the time of the Prophet Muhammad. Hamas sought to prevent them from attacking hairdressers, internet cafés, Christians and other supposedly decadent influences. But it has been less eager to curb their missile attacks on Israel or to stop them infiltrating Egypt.
More recently, however, Hamas has closed the tunnel complex to slow infiltration and gun-running. If Hamas really wants to please the Egyptian government, it would arrest the 200-odd jihadists still at large in Gaza. Hisham Saidini, a jihadist preacher whom Hamas had freed soon after Ramadan started last month, defended the killing of Egypt’s soldiers on the grounds that they were protecting Jews.
Israel, too, will have to let both Egypt’s security forces and those of Hamas in Gaza control their borders more effectively. Israel may have to allow Hamas to operate in a buffer zone along Gaza’s eastern border. Egypt’s air attack on the jihadists on August 8th was the first time that air power had been deployed in anger by Egypt in Sinai since the war with Israel in 1973, and was co-ordinated with Israel in advance. The Israelis say they have had several discreet high-level talks with the Egyptians since Mr Morsi was sworn in a month ago.
The three governments also need to agree on new economic arrangements. For the past five years, the joint Israeli-Egyptian blockade of Gaza that fostered smuggling through the tunnels has hugely benefited people in Sinai who are beyond the law—of any country. Opening the borders to legal traffic and trade should lessen the power of jihadists and smugglers in Sinai and Gaza, and thus strengthen the arm of the governments in Cairo and Jerusalem.
Mr Morsi seems well aware of the dilemma. Egypt’s main military academy and senior civil posts have been opened up to the Bedouin, and plans are afoot to improve the peninsula’s several hundred villages, many of which have no piped water. He had already made a point, early in his presidency, of visiting Sinai. He has also hosted Hamas leaders. Before the Sinai attack, he received Mr Haniyeh and discussed definitively lifting Gaza’s siege.
Israel may also have to consider co-operating with Hamas, its avowed enemy. After the attack on August 5th, Israel’s leaders were careful to blame global jihadists rather than Gazans or Hamas. Although Egypt has yet fully to open the crossing at Rafah, Israel has already reopened its one nearby at Kerem Shalom, for trade if not yet for people. With the influence of Islamists in Syria likely to grow in the event of Bashar Assad’s fall, Israel may have to decide whether to accommodate itself to the likes of Hamas lest a still fiercer version of Islamism comes to the fore.