SOCHI, Russia Pass the metal scanner on arrival at Sochi station or watch Cossacks patrol the streets of the 2014 Winter Olympics venue and you know it did not take the Boston Marathon bombs to alert Russian organizers to two facts:
One, that a major sporting event makes a prime target for terrorism; and, two, that Chechens and other Muslim peoples of Moscow's restive Caucasus mountain provinces around Sochi nurse deep historic grievances that pose a constant risk of violence.
In the six years since it won the right to host the Games next February, Russia has shown as much determination to protect athletes, spectators - and its own international image - from any form of attack, as it has in building the grand ski and ice venues now being completed in the hills above President Vladimir Putin's favored vacation spot on the palm-fringed Black Sea.
But bringing the Games to the Caucasus, whose ancient ethnic and religious resentments helped mould the Chechen Tsarnaev brothers accused of wreaking havoc on their adopted city last week, has given the enterprise an added dimension of danger.
As Yegor Engelhard, an independent Moscow security analyst, put it: "It's almost like having the Olympics in Beirut."
In an area where much blood has been shed over identity and history since Soviet communism collapsed, it has not escaped local notice that a key venue is Krasnaya Polyana. That is where the tsar's armies claimed final victory after a half-century of war to conquer the Muslim Caucasus, 150 years ago next year.
Since Palestinians took Israeli athletes hostage at the 1972 Munich Olympics, hosts have devoted vast resources to security; in general, the remote venues of the winter editions pose fewer headaches than for the likes of last summer's games in London, an open metropolis which was subjected to intense surveillance and saw anti-aircraft missiles deployed on apartment blocks.
But Moscow is taking no half measures around Sochi and officials believe they had done enough to keep the Games safe, well before Boston provided a timely reminder of the risks.
"We aren't taking any special measures because of what happened in Boston, but we are looking at a whole set of potential threats," said Andrei Pilipchuk, a spokesman for the Russian Interior Ministry. "We've been carrying out tests all year to improve the way we counter them."
Murad Batal al-Shishani, a London-based independent expert on the insurgency in the North Caucasus, said Russian agencies, which have not always coordinated well in recent times, should by now be well prepared for the threats they may face: "Russian authorities (had) enough time to take security measures, therefore it will be a challenge ... to attack," he said.
SCANNERS AND COSSACKS
Heavy security is nothing new in Sochi: a resort city straggling along the coast with health spas built for Soviet workers, Putin's motorcades, holding up traffic, are a familiar sight. More novel are the metal scanners checking all passengers at the main rail station, and, especially, the Cossack patrols.
Heirs to tsarist-era frontiersmen, self-styled Cossacks in trademark lambskin hats and military epaulettes have been roaming Sochi for weeks at the behest of local officials, though it is unclear whether the role of such groups, viewed by some as racist vigilantes, extends beyond assuaging public anxiety.
From June 1, more than eight months before the Games begin, the entire area will be subjected to even tighter - though publicly unspecified - controls to protect venues from militants who have made world headlines for two decades with spectacular, and usually bloody, mass hostage-takings and bombings in Russia.
While the Kremlin may not emulate its Soviet predecessors who simply rounded up and expelled "undesirables" from Moscow when they held the 1980 summer Olympics there, its forces are used to a free, and fairly heavy, hand in monitoring movement.
There is resentment among locals with a massive construction project they believe benefits only a well-connected few; but, especially after Boston, many in Sochi, whose 340,000 people are overwhelmingly non-Muslim ethnic Russians, do welcome whatever security the government provides.
"I've seen more police patrols since the attacks in the USA. We have to learn from what happened to them," said Alexander Feoktistov, 59, as he worked at his souvenir stand in Sochi, already selling stuffed animals bearing the Games logos.
"The militants could pose a direct threat to the Olympics if they wanted to. They would only have to cross those mountains."
In fact, crossing the virtually trackless Caucasus range, whose peaks rise above 5,000 meters (16,000 feet), in winter, is no mean feat; more vulnerable may be approaches to the coastal strip from the lawless, breakaway Georgian region of Abkhazia, just a few miles from the main access road to the ski venues.
Since Putin crushed Chechen separatists' hold on Grozny over a decade ago, conflicts continue to simmer across the Caucasus, from Dagestan in the east, where Tamerlan Tsarnaev spent time last year, to western areas near Sochi that are home to several ethnic and linguistic groups historically known as Circassians.
Nationalist claims to independence that dominated the 1990s as other Soviet republics broke away have given way to calls for a pan-Caucasus Islamic state, some from those who have fought with Arabs or Afghans under the banner of al Qaeda, others from Muslims who simply view Russian rule as corrupt and oppressive.
So far this year, at least 124 people have died in violence in the region, the authoritative Caucasian Knot website says.
While some militants have this month distanced themselves from any anti-American or anti-Western motive the Tsarnaevs may have had, the risk remains real of an attack on foreign visitors to the Olympics, if only to humiliate the arch-enemy, Moscow.
Russia's most wanted man, the Chechen Doku Umarov who also features on a U.N. list of al Qaeda associates, has declared the Games a target for his Caucasus Emirate. Among previous attacks, he has claimed the derailing of a Moscow-St. Petersburg express train in 2009 and suicide bombings of the Russian capital's metro in 2010 and busiest airport in 2011 that killed dozens.
Chechens took large groups hostage in the 1990s, at a Moscow theatre in 2002 and a Caucasus school in 2004; North Africans used the tactic just this year, at an Algerian gas plant, and security analyst Engelhard said the Olympics could be a target:
"I wouldn't be surprised," he said.
"The Caucasus Emirate has the motivation to use the grievances of the region to draw attention to their cause and exploit the opportunities the Olympics provide."
Putin, who spoke last week to U.S. President Barack Obama on counterterrorism issues in the wake of the Boston bombing, has long cited the violence of the likes of Umarov to counter the sympathy Westerners have shown at times toward Caucasus rebels.
For that reason, some militants may remain wary of attacking foreigners, just as they disowned the Boston bombings. Their repeated failure to sway the Kremlin even with the deaths of hundreds of Russian civilians may also discourage some of them.
"People are afraid of that kind of violence in Europe or America," said one local man as he whisked his bag off the new scanner at Sochi station. Voicing a Russian machismo toward bomb threats, Roman Komaryov added: "Here, we're not afraid."
Whether at the Olympics or elsewhere, however, Russians are well aware that the risk can never be entirely eliminated.
Also at the station, heading home to Moscow after a spa vacation at a sanatorium on the Black Sea, railwayman Vladimir Shviginov, 46, recalled that four years ago he had worked on repairing the track after the bombing that derailed the St. Petersburg-bound Nevsky Express, killing 26 people.
"You can try to be as careful as you can," he said. "But you can never be protected against everyone all the time."
(Editing by Alastair Macdonald)