With less than a month to go before the Winter Games, Russian officials are putting the finishing touches on what they say will be the tightest Olympic security in history.

After a spate of deadly terrorist attacks in the region, the authorities are deploying high-tech surveillance equipment and tens of thousands of troops in Sochi, the host city on the Black Sea.

Sochi is unique among the cities hosting the Winter Games because it has the mild climate of a seaside resort, but it's less than an hour away from the snow-capped mountains of the North Caucasus.

But the mountain region is also home to mostly Muslim ethnic groups that have a long history of conflict with Moscow that dates from the colonial battles of the Russian empire to the Chechen wars of the past two decades.

As a result, observers such as Ekaterina Sokirianskaia, the North Caucasus project director for the International Crisis Group, found the choice of host city striking.

"I, from the very beginning, found it very ambitious to decide to [hold the] Olympics in such a close proximity to the most active insurgency crisis in Europe," she says.

In fact, over the past few years, Islamist militants have staged almost daily attacks in various parts of the region, where the death toll among security forces, insurgents and civilians numbers in the thousands.

The potential danger of holding the Olympics near a conflict zone was brought home last month, when a pair of suicide bombings in the city of Volgograd left 34 people dead and dozens wounded.

Volgograd is on the edge of the North Caucasus, a little more than 400 miles from Sochi.

President Vladimir Putin used his annual New Year's message to the nation to honor the dead and vow to pursue the terrorists to the death.

The president has a lot of personal prestige riding on Russia's ability to bring off a spectacular event in the region and do it safely.

Andrei Soldatov is a security expert and writer for Russia's secret services watchdog Agentura.ru.

He is one of a pair of reporters who revealed the extent of the Russian government's electronic surveillance plans for Sochi, including technology that will be able to monitor every email, every social media message and every phone call made during the Olympics.

On a recent trip to Sochi, he also encountered the most low-technology security measure: patrols of uniformed Cossacks who have the authority to stop visitors and check their identities.

"It seems to be the initiative of the local governor, to impress the population, because these people seem to be completely untrained to detect or identify a terrorist," he says.

And that, says Soldatov, is where the system falls down.

No matter how many troops you deploy, he says, if they don't have training in counterterrorism, experience in the community and, most importantly, good intelligence about the insurgents, attackers may be able to slip through.

Mark Galeotti, a professor of global affairs at New York University and an expert on crime and security issues in Russia, points out that the anti-terrorism resources being concentrated in Sochi have to come from somewhere — from other cities that will be left more vulnerable.

"Combine that with the fact that if the rebels can't get to Sochi, then they will try for wherever they can get," Galeotti says. "I think they realize that a bomb in Russia proper is much more newsworthy than a bomb in the North Caucasus."

The recent attacks in Volgograd and other cities close to the North Caucasus show that terrorists are ready and able to take their fight elsewhere in Russia.

A big enough tragedy in one of Russia's heartland cities could drain the joy out of Putin's Olympics.

As the International Crisis Group's Sokirianskaia points out, it doesn't take much to carry out an effective attack.

"Modern terrorism doesn't require much resources — you need a man or a woman who are ready to sacrifice their lives, and explosives that you can actually make at home," she says.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.