TEL AVIV—One year after the brutal Hamas attack that ended Israel’s two-decade golden age of relative peace, expanding wealth and growing diplomatic ties, the country is now firmly on the counterattack and preparing to be at war for years. Weathering a ferocious Iranian missile assault in recent days and shaking off calls from allies for a cease-fire in Gaza, Israel is instead opening new theaters of fighting.

It launched a stunning series of attacks against the Lebanese-militia Hezbollah in Lebanon in recent weeks, while simultaneously targeting Houthi rebels in Yemen, rooting out militancy in the occupied West Bank and mapping out its next steps against Iran, the architect of a so-called axis of resistance that includes U.S.-designated terrorist groups bent on destroying Israel.

The campaign marks an aggressive shift in Israel’s security posture. For years, the military aimed to provide long stretches of peace that were only momentarily punctured by short conflicts with Palestinian militants. There were occasional military maneuvers aimed at degrading the axis, but they were never severe enough to welcome retaliation. A country founded on austerity, Israel saw its gross domestic product soar. Its bustling commercial capital, Tel Aviv, became indistinguishable from any other affluent Mediterranean city.

Much of Israel’s security establishment now believes these decades lay the groundwork for the deadly Oct. 7 attack from Hamas’s Gaza stronghold that killed 1,200 people and took another 250 hostage. Israel can no longer allow its enemies the time and space to build up arsenals that can pose an existential threat, many have come to believe.

“Pre-emptive wars will be in the future part of the Israeli tool kit,” said Yaakov Amidror, a former Israeli national security adviser.

The impact of this new strategy is expected to touch nearly every part of Israeli society, reshape Middle East geopolitics and shake up relations with the U.S., which as Israel’s main diplomatic ally and supplier of weapons has watched its influence diminish.

It could come at the expense of Israel’s diplomatic goals, including building a regional alliance that can counter Iran. Saudi Arabia has said it won’t normalize relations with Israel unless there’s a credible pathway to a Palestinian state, an idea that remains unpopular in Israel and is a no-go for Israeli Prime Minister Benjamin Netanyahu ’s current right-wing government.

Without seeking political and diplomatic solutions, “it’s a matter of endless war,” said Tamir Hayman, a former head of Israeli military intelligence and executive director of the Tel Aviv-based think tank Institute for National Security Studies. “After Gaza, we will go to Lebanon. After Lebanon, go to the West Bank. After the West Bank, we go to Iran.”

For many Israelis, this has opened up a terrifying new reality. Will Israel become a Sparta of the Middle East, with national security and war its most defining characteristic? Israelis had become accustomed to the growing business opportunities that periods of calm made possible, with Tel Aviv becoming a global technology hub with high salaries, an internationally recognized restaurant scene and luxury high-rise apartments.

Israel has mandatory military service for most citizens, with an army that relies on both conscripts and hundreds of thousands of reservists who, in peacetime, live normal lives. Israelis are now contemplating a future where they could spend even more time at war.

Rivka Sally Bayna, 28 years old, had spent over 200 days in the reserves since Oct. 7 when she was called back for another 20 days shortly after Israel began its assault on southern Lebanon. A company commander for a search-and-rescue brigade, she would normally spend 30 days a year in reserves before the war. She can’t imagine having another year like this one.

“I’m really worn out, like a shoe that was worn too much,” she said. “I just miss my life.”

Israel’s security rethink is a testament to the success of Iran’s anti-Israel militias in Lebanon, Syria, Iraq, Yemen and the Palestinian territories. The Hamas-led Oct. 7 attack wasn’t limited to Israel’s southern border. It unleashed Iranian-backed militias like Hezbollah, which began firing rockets on northern Israel on Oct. 8, and the Houthi rebels in Yemen, who have fired long-range ballistic missiles in Tel Aviv. At the same time, Tehran-backed Iraqi and Syrian militias have harassed Israel with rocket fire and drones.

What this year has shown is that Iran’s strategy has opened up more ways for Israel to be attacked and from more places—from sophisticated rockets to off-the-shelf drones and suicide bombings in Tel Aviv.

The threat posed by what Israelis now call “the ring of fire” created by Iran wasn’t well understood before Oct. 7. It has not only stretched the military’s capabilities but also underscored how Israel’s every move could spark a regional war, which the U.S. is pressuring it to avoid.

Iran this week launched a barrage of 200 ballistic missiles at Israel that were mostly shot down or missed their targets, but Israel has promised a punishing response. This came after Iran’s first ever attack on Israeli soil in April, firing over 300 projectiles, including cruise and ballistic missiles.

The exchanges have opened the door to a confrontation that would risk pulling major world powers into a war.

“This is not a war against Hamas or Hezbollah,” said Ofer Shelah, director of national security policy research at the Institute for National Security Studies. “This is a war against the Iranian Axis of Resistance.”

In the view of much of the Arab world, Israeli security policies were already aggressive before Oct. 7. Israel, along with Egypt, imposed an embargo on Gaza that had largely isolated the strip. Israel began ramping up raids into the West Bank in 2021, with the Palestinian death toll reaching the highest levels last year since the Second Intifada, an uprising from 2000 to 2005 that saw widespread Palestinian terrorist attacks on Israel and a fierce Israeli military response.

Critics of Israel’s strategic shift say it will bog the region down in endless conflict, and risks radicalizing the populations of stable Arab neighbors and pushing potential allies like Saudi Arabia away. Media across the Arab world continues to focus on the death toll in Gaza, where more than 40,000 Palestinians have been killed, according to local health authorities, who don’t distinguish between combatant deaths and civilians.

A newly confrontational Israel must also contend with a cautious ally in the U.S., where the November election could have profound consequences. President Biden has threaded the needle between almost unconditional support for Israel’s defense while also consistently calling for an end to hostilities.

Security officials estimate that the military will need to fight for at least another year in Gaza, and forces will need to be stationed there for years to come. Israel has said its ground incursion into Lebanon will be targeted at Hezbollah infrastructure along the border and limited in duration, but with no viable alternative to provide security in that area, there will be pressure on Israel to stay until it’s safe for tens of thousands of Israelis to return to homes near the border.

An Israeli government committee is working on recommendations for how Israel’s military posture needs to change and how much money it will need to spend on defense. Some analysts estimate that military spending could go as high as 10% of Israel’s GDP and require the country to take on more debt, raise taxes and stop funding projects that it deems noncritical.

The Bank of Israel estimated that the war will cost Israel about $65 billion from 2023 to 2025, before the recent escalation in Lebanon began. Bank of Israel governor Amir Yaron warned against increasing spending to the point of causing severe damage to the economy.

Israel’s economy is strong enough to absorb some shock now, say economists. The 2000s ushered in a wave of fiscal discipline. For 24 years straight, Israel has had a current accounts surplus, meaning Israel exports more than it imports. It has relatively low national debt, and a strong economic core in the technology industry.

“It means we’ve got plenty of room to maneuver,” said Nadine Baudot-Trajtenberg, a former deputy governor of the Bank of Israel.

But for average Israelis, the war has already hurt them financially. Avishai Ben Harroch, who owned a trendy Tel Aviv restaurant that served the Moroccan-Parisian cuisine that his mother cooked for him, has now spent 220 days of the last 365 in the reserves. He realized shortly after the war started there was no way for him to keep it open. The burden of war is taking a toll. He lost six friends in battle, including one who was blown up just meters away from him. He knows another five who have killed themselves this year. Others he knows have turned to drugs.

“I am very, very, very exhausted,” said Ben Harroch, who days later was called back to Israel’s north to fight in Lebanon as the ground invasion began. Once again, he had to leave his partner and 6-month-old baby, this time just before Rosh Hashana, the Jewish New Year.

A more hawkish Israeli strategy will run into a divided Israeli public. A mass protest movement against Netanyahu’s plans for a judicial overhaul before Oct. 7 transformed itself into a movement seeking the end of the war in exchange for the release of Israeli hostages. They fill the streets of Tel Aviv every Saturday night, just as the Sabbath is ending, carrying Israeli flags and pictures of those still in captivity. That more than 100 people are still held hostage is an open wound in Israel that won’t heal quickly.

More wars would also require more troops. It has made the need to draft ultra-Orthodox Jews who have long been exempt from military service a more urgent matter, and increased anger at a segment of society that is viewed as not equally sharing in the burden of defending the country. Despite a recent Supreme Court ruling that the military must start drafting ultra-Orthodox men, most are refusing to sign up and many are taking to the streets in protest.

Danny Orbach, a military historian at the Hebrew University of Jerusalem, thinks the social upheaval underscores how much pain people are experiencing over the loss of the Israel that was destroyed on Oct. 7.

“When you see the world is changing around you, the first thing you want to do is to go back as quickly as possible to your old world,” he said. “When you see you cannot do this, it generates waves of fury and despair and I think we see it in Israel now.”

Polls have consistently shown Israelis feel their sense of security was shattered on Oct. 7 and it still hasn’t recovered. People are grieving, depressed and “feel like the sky has fallen on their heads,” said Tamar Hermann, a pollster and senior fellow at the Israel Democracy Institute think tank in Jerusalem.

Ayala Metzger, 50, has become one of the leaders of the protest movement to free the hostages. Her father-in-law, Yoram Metzger, was 80 years old when he was kidnapped on Oct. 7 from his home in Kibbutz Nir Oz. His body was found by the Israeli military in August. Ayala said Israel is no longer a country she recognizes, and she and her husband talk about leaving.

“This is the only home I know, but it’s crazy now,” she said. “Where I live, I don’t feel like home.”

Write to Shayndi Raice at Shayndi.Raice@wsj.com