Just imagine the Queen’s Birthday Parade, June 13, 2015: the monarch, her family and escorting officers are arrayed on Horse Guards’ in Whitehall, watching the serried red companies wheel and march past in slow time.

Suddenly, men burst from the crowd and begin spraying bullets among the soldiers and spectators.

It is a scenario from hell, yet no more fanciful than that of Wednesday’s massacre in a Paris magazine office, or last month’s slaughter of 132 schoolchildren in Peshawar, or the carnage of the London bus and Tube bombs of July 2005.

It is the sort of image with which security chiefs live every day of their working lives, because for them that would be the cost of a failure.

Barbaric: Gunmen attack the office of Charlie Hebdo in Paris this week

Yesterday’s dramatic events in France ended with three terrorists and four hostages dead after a formidable French security and intelligence operation.

The intelligence services have never doubted that new terrorist attacks will come to the West, including Britain. An event such as the Charlie Hebdo killings merely gives the ongoing threat a shocking new sense of immediacy.

On Thursday, the director general of MI5, Andrew Parker, made a rare speech, warning it was almost inevitable that an attack in this country would get through sooner or later. ‘Although we and our partners try our utmost, we know that we cannot hope to stop everything,’ he said.

The price of living in an open society, with the precious freedoms we take for granted, is that all of us, great and small, are vulnerable to attackers consumed by hatred for our culture, its values, and manifest superiority to those from which they come.

Globalisation places a disturbing number of such people in our midst, rather than far away in Somalia or Iran.

The good news is that although Islamic fanatics can cause us pain and grief, they pose no existential threat as did Hitler’s Germany or Stalin’s Soviet Union.

They cannot be compromised or parleyed with, because they have no rational political demands: they claim affiliation to a feudal order in which women are denied rights, technology is banished and mullahs arbitrate over daily life.

Director General of MI5 Andrew Parker warned that Islamist radicals were plotting terror attacks on the UK

What can we do to protect ourselves against them? It is pointless to focus on tightening border controls, desirable though this is for other reasons. Most terrorists who launch attacks in the West prove to be citizens of the nations they seek to injure, some of them born here.

There is a vital job to be done, addressing Islamic extremism in schools. In Britain alone, the cases exposed last year in Birmingham and East London represent only the tip of a frighteningly large iceberg. Many schools and a number of misnamed Muslim ‘charities’ are promoting values totally at odds with those of our society, and unacceptable to it.

It is not easy for the authorities and the Charities Commission to move against them, because the claims of human rights, multiculturalism and community harmony are invoked in defence of a right to espouse extremist doctrine.

B ut it seems essential to recognise the scandal for what it is, and to act urgently and decisively against extremist Muslims who peddle alien, anti-social — and in some cases, violent — values.

Those who argue in favour of according ‘traditional British tolerance’ towards ‘young Muslim hotheads’ ignore the seriousness of what is going on around us. At least 300 British-born Muslims are currently thought to be fighting as jihadis in Iraq and Syria, alongside thousands more from other European nations.

These people cannot be compared — as liberal columnists sometimes foolishly suggest — with the young romantics who left Britain in the Thirties to fight General Franco’s fascism in the Spanish Civil War.

The jihadis embrace a nihilistic faith of which the consummation is no political victory, but instead death — for themselves and hapless innocents.

My old friend the military historian Professor Sir Michael Howard makes an important point: we in the West like to delude ourselves that most of the world wants to share the cultural freedom we cherish.

Assange and Edward Snowden, pictured, have damaged the security of each and every one of us, by alerting the jihadis and Al Qaeda to the scale and reach of electronic eavesdropping

In reality, he says, freedom is a relatively modern idea, and huge numbers of people, many of them hardline Muslims, bitterly resist it.

It was demented hostility to freedom that caused the Paris killers to murder 12 people on Wednesday for mocking the Prophet, just as Monty Python and countless other Western comedians have for decades mocked Jesus Christ.

Michael Howard notes that fundamentalist Muslims feel a much stronger attachment to their tribe or sect than to any nation state. Jihadism, he says, represents a response to ‘the challenge of a secular, urban civilisation that threatens to destroy their traditional values and beliefs’.

It took us, in the West, about three centuries after the Enlightenment — when reason and individualism began to assert themselves in the 17th and 18th centuries — to become comfortable with what we now call cultural freedom.

In truth, Assange and Snowden have damaged the security of each and every one of us, by alerting the jihadis and Al Qaeda, our mortal enemies, to the scale and reach of electronic eavesdropping

We cannot expect doctrinaire Muslim societies from the East, which have fomented radicalism throughout the world, to do so in a few years.

‘It is not surprising that a fanatical minority, inspired by a romantic longing to return to the doctrines and practices of a pure Islam, aim at destroying the Western civilisation that they see as debauching the purity of their own culture and beliefs,’ says Howard.

Many who take up violence are losers, incapable of achieving social or professional success in their adopted societies. We should never underrate the role of boredom, a search for purpose, in persuading unstable young men to embrace terrorism.

But understanding the fanatics’ motivation does not in the least diminish the need vigorously to defend ourselves against them. In some ways, it is harder to counter people who acknowledge allegiance to no national flag than to confront Nazi Germany, the Soviet Union or even Iran.

O ur principal weapons against terrorists are not tanks, Typhoon fighter jets or warships, but instead intelligence officers using electronic surveillance.

Much cant has been peddled recently about the supposed threat to liberty posed by government eavesdropping on our lives.

WikiLeaks founder Julian Assange giving a thumbs up prior to delivering a statement inside the Ecuador Embassy, where he has sought political asylum in London

Such people as WikiLeaks founder Julian Assange and Edward Snowden (the former U.S. National Security Agency contractor turned treacherous fugitive), who have broadcast American and British secrets wholesale, are celebrated as heroes by some people who should know better, many of them writing for the Guardian or broadcasting for the BBC.

In truth, Assange and Snowden have damaged the security of each and every one of us, by alerting the jihadis and Al Qaeda, our mortal enemies, to the scale and reach of electronic eavesdropping.

A senior intelligence officer told me recently how dismayed he and his colleagues were by the risk that their listening operations would be curtailed by civil liberties campaigners. ‘GCHQ gives us the only edge we have got over these people’, he said.

I am convinced he is right, that GCHQ, MI5 and MI6 must maintain their licence — within a legal framework — to trawl the ether, in the strongest public interest.

There may be a few mavericks within intelligence services who abuse such power, but unless we view the very existence of government as inherently wicked and threatening, I cannot for the life of me imagine what harm can result from MI5 accessing the phone calls, bank accounts, emails of you, me or any other law-abiding citizen. How much Amazon and Google know about our private lives seems much more alarming than what MI5 discovers.

Public safety demands a perpetual balancing act between collective security and the rights of the individual.

Security officers escorted hostages after they stormed a kosher market to end a hostage situation in Paris

Explosions and gunshots were heard as police forces stormed a kosher grocery in Paris where a gunman was holding people hostage

In World War II, the national interest required the wholesale removal of tens of thousands of people from their homes on the South Coast of England, to make way for defences against German invasion, and later for Army training.

More than a few of the houses evacuated were wrecked or demolished, each one a personal tragedy for the families involved. But everybody understood that the evictions had to happen, to protect 50 million British people against Hitler.

Times have changed. Today, we need not erect barbed wire entanglements or mount anti-aircraft guns on public buildings. Instead, and much less onerously, we all must endure airport searches, even though we know full well that we are threatened not by elderly Englishwomen, or for that matter men, but by jihadis. And we must acquiesce in electronic surveillance.

I feel a real anger towards the civil libertarians who resist this, towards the imbeciles who recently sought to raise money for a statue in London celebrating Assange and Snowden as champions of freedom — yes, they really did.

No modern intelligence officer would dare to use Churchill’s wartime words, when he appealed to the Americans for arms: ‘Give us the tools and we will finish the job’. But I am convinced that the security services must indeed be given the modern tools and increased manpower they need if Britain is to have any chance of restricting — not eliminating, because that is impossible — the havoc wreaked by terrorists.

It is hard for people, in these times, to resist the instinct to view Muslims around us as real or potential enemies

What can the Armed Forces do abroad to help protect us?

Not much. Successive Prime Ministers have talked nonsense about ‘our sacrifices in Helmand province helping to keep safe the streets of Brixton’. It is true that the original Anglo-American mission in Afghanistan, after the 9/11 attacks on the U.S., was justified and successful in the limited objective of denying the country to Al Qaeda as a sanctuary.

But everything that has happened since in Afghanistan, Iraq and Libya has made things worse, by feeding the rage of young Muslims against the West. We have learned at painful cost that the only people capable of deciding the fate of the Middle East, and of Muslim societies outside it, are those inhabiting these regions.

We can provide a little help, including weapons, to the moderate forces, such as they are. But we can achieve nothing by putting boots on the ground. We need a lot of spies and special forces, together with higher-quality diplomats — what Michael Howard categorises as ‘spooks, geeks and thugs’.

Y et tanks, giant aircraft-carriers and the Trident deterrent have no useful part whatever to play in Britain’s future security, except to induce Prime Ministers and admirals to sustain fantasies about our national importance.

Instead of spending £30 billion on replacing Trident, as the Government plans, we would do better to use a fraction of that money to start defending ourselves against cyber-attack, a much more real threat, and one against which we are currently almost naked.

It is hard for people, in these times, to resist the instinct to view Muslims around us as real or potential enemies.

This is especially so, when opinion polls show a significant minority of Muslims in Britain and elsewhere in Europe expressing sympathy with acts of terror. But everyone must keep their nerve, which also means keeping a sense of proportion.

The world has come out to support France, but the war against terror groups like these will test resolve

Four hostages were killed as well as three terrorists in the bloody ending of Friday's standoff

The vast majority of Muslims in this country are decent and loyal citizens who utterly reject association with such horrors as those which have taken place in Paris.

We must be unshakeable in our determination to root out extremism, especially in schools, but also in our commitment to tolerance wherever Muslims extend their tolerance to us and the way we do things.

History teaches that few societies are completely safe for long. All that changes is the nature of the threats.

Our forefathers lived with Jacobite rebels, machine-wrecking Luddites, mobs that smashed every window in the Duke of Wellington’s Apsley House in London, German bombers, trades union militants, Trotskyite revolutionaries, and Irish terrorists.

We would have more cause to be fearful of the Islamic fanatics if they were peddling a coherent doctrine such as communism or fascism, with a spurious plausibility.

Instead, the jihadists’ murderous outrages represent merely howls of fury against the 21st century, in which they are so ill-fitted to compete.

As MI5 warned on Thursday, there will be more acts of terrorism, some in Britain, and they will cause us distress.

Our intelligence services — and now the French security service — have been criticised because on several occasions terrorist attacks have been carried out by men whose names are discovered to have been on terrorist watch lists.

But logistically it is an impossible task for any intelligence agency to monitor the thousands, and even tens of thousands, of young Muslims known to have expressed an interest in violence.

What we must remember is that our society is much stronger than they are. Our values are those of civilisation, whereas they fly the black flag of barbarism.

The French people, in recent times so divided and troubled, have responded to this week’s murders in Paris with an impressive courage and solidarity.