As the hunt continues for militants who killed 16 Egyptian soldiers in an unprecedented incident of brutality, Mohamed Morsi faces his first big security test as Egypt's new president. The raid in Sinai by 35 gunmen on an Egyptian military border post, who then commandeered an armored vehicle which they used to storm across the border into Israel before being stopped by an Israeli airstrike, rattled Egypt to the core for it was the worst assault on troops from within Egypt in living memory. Morsi has sacked the intelligence chief and the northern Sinai governor and continues to send reinforcements to Sinai, all this to contend with Al-Qaeda-inspired militant groups waging a campaign of violence in the peninsula against Egyptian security forces. There is also the rise of disgruntled Bedouins who feel left out of the socio-economic plans of the country and who have a massive amount of arms smuggled from Libya. It was imperative that in response to the raid, Cairo quickly closed the Rafah border, Gaza's only gateway to the outside world. It will be argued that the blockage will prevent the flow of needed goods. The sealing, though, is temporary and cannot be compared to the years of siege imposed on Gaza and Hamas by former president Hosni Mubarak who along with Israel viewed Hamas as a common enemy. What must be really checked are the hundreds of cross-border smuggling tunnels. The guns and rocket-propelled grenades that the gunmen used on the border post more than likely came from this illicit conduit. The Muslim Brotherhood has good relations with the Hamas rulers of Gaza. With their shared enmity for Israel, Morsi and Gaza's rulers could have an enduring alliance. Morsi had just last week met Hamas' de facto Prime Minister Ismail Haniyeh and as part of the courting process, promised to open Rafah round the clock. As fate would have it, just a week later the opposite happened – Rafah was closed till further notice. Clearly, Morsi faces numerous challenges in the wake of the attack, perhaps the foremost being whether he can strike a balance between two opposites – the relationship with Israel and the relationship with the Palestinians. Morsi's ties with Hamas will alarm many in Israel already concerned by the rise of Islamists in Egypt. His politics would seem to make it difficult for him to take a strong stance against groups sworn to Israel's destruction. However, if Morsi maintains close ties with Hamas now, he could come under criticism for putting the Brotherhood's agenda over the nation's interests. At the same time Israel also wants Cairo to walk the tightrope: tighten security in the Sinai but, under terms agreed with Israel under the 1979 peace treaty, do so without increasing the number of Egyptian troops near Israel's border. The Sinai attack was unparalleled in its ferocity and highlighted the government's tenuous grip on the Sinai Peninsula. It demonstrated that lawlessness in northern Sinai has reached a new level which Egypt can no longer afford to ignore.