As he prepares to leave Jerusalem after four years as a correspondent, Rory McCarthy reflects on a new, harsher climate of thought that is apparent in the wake of the Dubai assassination. But this attitude is not universal: dissent thrives in the most unlikely places

A striking advertisement appeared in several Israeli newspapers recently. It depicted Professor Naomi Chazan, former deputy speaker of the Knesset and respected political scientist, wearing a horn strapped to her forehead. It was the latest offensive in a campaign against the New Israel Fund, of which she is president. Its apparent crime: financing Israeli human rights groups who challenge violations by their country's government and security forces and whose tenacious questioning, you might think, would be hailed a pillar of the vibrant democracy Israel insists it is. Instead, the fund is derided as "anti-Israel".

Living here for the past four years, it is hard for me to escape the sense that there is a new climate in Israel, one in which dissent is marginalised and any criticism from abroad robustly shouted down. In part, it is the result of the election of a staunchly right-wing coalition government. It also plays on a sense long shared by many Israelis that they are embattled, misunderstood and find themselves in an increasingly unsympathetic world.

Look at the response in the past week to the extraordinary unravelling of the assassination in Dubai of a Hamas militant. Most voices in Israel have been defiant, with a proud wink and a nod to the much-vaunted secret service, the Mossad, and strikingly little sympathy for those seven, fearful Israeli citizens who had their identities stolen for use by a brazen hit squad.

Israeli officials seem unruffled by the anger in the British, Irish, French and German governments, whose passports have been forged to enable a high-profile extra-judicial killing in which the Mossad is the prime suspect.

Take the new hardline approach of the Israeli foreign ministry. Last month Danny Ayalon, the deputy foreign minister, called in the Turkish ambassador for a diplomatic dressing-down over a Turkish television show. It turned into a public humiliation when he sat the ambassador before him on a low sofa and egged on the camera crews to highlight his guest's discomfort. That required two apologies to avert a full-blown diplomatic crisis. Then in a speech last week Ayalon compared the Palestinian president, Mahmoud Abbas, one of the most moderate of all Palestinian leaders, to the Taliban.

The next day Ayalon refused to meet a delegation of US congressmen simply because they had travelled with J Street, a new American lobby group which is "pro-Israel, pro-peace". It was, said Congressman William Delahunt, "an inappropriate way to treat elected representatives of Israel's closest ally".

When the Obama administration demanded Israel halt all settlement construction as a prelude to peace talks with the Palestinians last year, the Israeli government simply refused. In the end, it offered only a partial, limited curb, but construction continues. As a result, Abbas is now profoundly, perhaps fatally, weakened. The prospect of a just, conflict-ending, two-state peace agreement has almost gone.

In my time here, Israel has fought two major wars – in Lebanon and Gaza – which killed more than 2,500 Lebanese and Palestinians and about 170 Israelis. Most Israelis thought the wars were justified acts of self-defence. However, particularly after Gaza, the international community began to disagree. And of this, Israelis are acutely aware.

Last month, the prime minister, Binyamin Netanyahu, listed the "Goldstone effect" as one of Israel's top three security challenges. It was a reference to the highly critical UN report authored by the South African judge Richard Goldstone which called on Israel and Hamas to investigate what he found to be credible evidence of war crimes during the Gaza war.

Israel's approach has been to refuse all participation in the Goldstone inquiry – not even allowing the judge himself into Israel – and to see all the criticism and legal challenges that have followed as a new existential threat, something Netanyahu last week described as "lawfare". In other words, legal challenges are now to be regarded as just as unconscionable as militant violence. It is what one Israeli thinktank, the Reut Institute, called the "de-legitimisation network", which "operates in the international arena in order to negate Israel's right to exist and includes individuals and organisations in the west, which are catalysed by the radical left".

But now I have interviewed hundreds of Israelis, from professors to anarchists, generals to refuseniks, settlers to peace activists, Jews and Arabs, and the Israel I have seen is not formed of the one overarching narrative its government would impose. Scratch beneath the surface and there are people asking awkward questions. Sometimes it is just a hint of disagreement. When I asked one professor last week about the Dubai assassination, he said Israel would be better off making peace with Syria and the Palestinians than killing terrorists. This month, Ehud Barak, Israel's defence minister and no dove, warned that failing to reach a peace deal risked creating an "apartheid" regime that ruled over millions of stateless, voteless Palestinians.

True, it is a far cry from the past when the Israeli left was a significant force. Who now remembers the extraordinary moment in September 1982 when 300,000 Israelis stood in a Tel Aviv square to protest at their government's complicity in the massacre at the Sabra and Shatila refugee camps? Or the Four Mothers' movement which in the late 1990s did so much to precipitate Israel's withdrawal from that bitter 18-year occupation in Lebanon?

But even as recently as 2006, after another Lebanon war, I was among a Tel Aviv crowd that heard the novelist David Grossman deliver an impassioned denouncement of Israel's "hollow" leadership and call for Israel to talk to the Palestinians and "acknowledge their ongoing suffering". And there is Meron Benvenisti, the former deputy mayor of Jerusalem, who argues that Israel and the occupied territories are already a "de facto bi-national regime".

Sometimes the questioning comes from the most unexpected places. Breaking the Silence, one of the groups supported by the New Israel Fund, is an organisation of former Israeli combat soldiers who want a public debate about the "moral price" paid by Israeli society for the occupation. They gather testimony from Israeli soldiers about their experiences, and it is hard to think of a group of people less anti-Israel than Israeli soldiers. But read their most recent report, containing the stories of dozens of female soldiers.

A lieutenant, posted in the Gaza Strip with the education corps, says: "The truth is that I only confronted it in retrospect, after leaving: suddenly I realised to what extent I had not been a human being out there ... It's like a movie with a lot of death around you, an unreasonable reality, with soldiers doing inhuman things to others and to themselves."

A sergeant from the Nahal unit: "I knew I was not real, I knew that something here was not right. If I pass a seated person and spit at him, and call him a terrorist because I've decided he's a terrorist, then something here is just not right. And that's what I tell everyone: come take a look at the blood of someone who's dead, it's not right."

Then there is the minority prepared to come out and protest. Friday marked the fifth anniversary of the demonstrations in the village of Bil'in against the West Bank barrier. More than two years ago, even Israel's supreme court ordered the state to re-route the fence and return much of the land lost by the village. It has still not happened. In recent weeks another regular protest has begun in Sheikh Jarrah, the scene of Palestinian evictions and Israeli settler expansion in east Jerusalem. At first it was met with a heavy-handed police crackdown, in which several peaceful protesters were arrested until the courts came to their defence.

The crowd on Friday was small, a few hundred perhaps, but a mixture of old leftists, many academics among them, and a younger generation. Standing in the fading winter sun was Avraham Burg, former head of the Jewish Agency, who described angrily the segregation and discrimination he saw in today's Jerusalem. He said he was concerned about the new stifling of free speech, for which the best challenge, he thought, was continued popular dissent. "Technical democracy is functioning," he said, "but substantial liberties are not here."

One of those arrested in the early protests was Hagai El-Ad, head of the Association for Civil Rights in Israel, another group supported by the New Israel Fund. "It is very easy to portray those who don't support the party line as enemies of the state, but I think that horribly weakens the state," he told me. "If this society is finally to start changing course for the better, maybe it will be inspired by what is happening here."