Kenya’s border with Somalia is porous, essentially a line in the desert, and though Western officials have been urging the Kenyan security services to watch it more closely, militants seem able to come and go at will, often with disastrous consequences.

In September, four gunmen from the group targeted an upscale mall in Nairobi, the Kenyan capital, killing at least 67 people. In May, twin explosions hit a market area in central Nairobi, killing 10 people and injuring 76 others.

In response, the Kenyan authorities have sought to beef up security, interrogating thousands of immigrants, refugees and members of Kenya’s large Somali community. But the violence has continued, and the government’s tactics have been criticized by rights groups.

Earlier this month, the United States Embassy in Nairobi warned American citizens to exercise caution when attending public events that may attract large crowds during the World Cup. It warned that places that could be targeted by terrorists include hotels, restaurants, shopping malls and public transportation. Britain, Canada and Australia have also recently issued warnings and called for added vigilance in the face of potential terrorist attacks.

Western embassies in Kenya are now considering withdrawing personnel, and many Western diplomats and Kenyans alike fear Kenya’s security services are too corrupt and disorganized to stop the Shabab. On top of that, the recent assassinations of several Islamist clerics, who many Kenyans believe were killed by secret government hit squads, and government roundups of ethnic Somalis have heightened mistrust and anger among Kenya’s sizable Muslim population. Many Kenyans fear the battle against the Shabab will be a long and unpleasant one, and already it has dented the economy, with tourism down significantly this year.