This year is already a reminder of two important security lessons of the post-9/11 era: that heightened defences against very real terrorist threats in the US remain necessary; and that the twin strategy of containment and deterrence remains the most effective way of dealing with rogue states.

Start with the Boston terror attack on 14 April, which claimed three lives and more than 170 injuries. At the time of writing, US officials do not know what motivated the Tsarnaev brothers who are believed to have planted bombs along the finish line of the world famous marathon. What is clear is that this was an act of terrorism, and the price of enjoying everyday life in tourist venues, sports stadiums, shopping centres, and even a fun run is constant vigilance.

True, as the distinguished journalist Doyle McManus has observed, both the number of terrorist attacks and the number of deaths from terrorism in the US have declined since the attacks on the Pentagon and the twin towers. Moreover, the kind of mass terrorism that September 11 appeared to herald — a wave of bombings in public places — simply has not happened. McManus approvingly points to the thesis of Ohio State political scientist John Mueller: Americans are more likely to die by drowning in a bathtub than from a terrorist attack, even after Boston.

Nonetheless, there has been good reason for the US to toughen up plans to combat terrorism — from hardening airports and ports at home to tackling extremists abroad, specifically in Afghanistan, Pakistan, Yemen, and North Africa. Although al Qaeda has been on the run across the globe, home-grown terrorists — such as Faisal Shahzad, the Pakistani-American who tried to explode a car bomb in downtown Manhattan three years ago — are lurking in the American midst. According to the New York Police Department, at least 16 terrorist plots against the city have been foiled.

The lesson is that constant vigilance and pre-emptive surveillance remain justified. There are, of course, risks and dangers involved: Washington has spent billions of dollars on homeland security, some of which has surely been wasted; some detentions and arrests have been unwarranted; and the government’s practice of torture has yielded mixed results at best and genuine human rights abuses at worst. Still, the message of Boston is that heightened defences against terrorist threats are in order a decade since September 11.

Which brings me to the other post-9/11 security lesson that has coincided with the 10th anniversary of the invasion of Iraq: how to deal with rogue states.

In recent months, North Korea has tested a third nuclear bomb, fired a missile into orbit, threatened a pre-emptive attack on the US mainland and South Korea, renounced the Korean war armistice of 60 years ago and signalled that it will restart its Yongbyon nuclear reactor to produce more plutonium for bombs.

What accounts for the North’s actions? Opinion among North Korea watchers varies. Many scholars think Kim Jong-un is trying to establish his bona fides in Pyongyang; some think he may be a reckless gambler intent on upsetting the natural balance of power in the region; others say it’s just bluff and bluster. The most plausible explanation is that the supreme leader of the Hermit Kingdom is trying to get the West’s attention and extract economic concessions from the North’s adversaries, just as his grandfather and father did in 1994 and 2005, respectively.

Whatever the explanation, President Barack Obama has been right to distinguish himself from his two immediate predecessors, George W. Bush and Bill Clinton, and shun direct negotiations with Pyongyang. Instead, he is beefing up the US defence measures against North Korea. Specifically, his decision in late March to send two B-2 stealth bombers and an Aegis destroyer over South Korea was prudent.

Meanwhile, there has been hardly any serious call for a preventive war or even pre-emptive strikes against the North’s nuclear reactors. Even the Wall Street Journal editorial page, a leading voice of neo-conservatism and cheerleader of the Iraq liberation a decade ago, recently argued: “Young Kim needs to understand that starting a war will mean nothing short of his and his regime’s extinction”. This is in striking contrast to the atmosphere of 2002–03 when prevention was the accepted wisdom in Washington.

After September 11, it was confidently predicted that the twin pillars of national security policy during the Cold War — containment and deterrence — no longer worked against those rogue states that comprised the so-called “axis of evil” (Saddam Hussein’s Iraq, the mullahs’ Iran, and Kim Jong-il’s North Korea). As President Bush insisted in 2002: “After September 11, the doctrine of containment just doesn’t hold any water as far as I’m concerned.”

Today, as the US and its allies respond to the threat posed by North Korea, it is clear that containment still has merit. If Kim lobbed some short-range missiles at South Korea, he would invite massive retaliation.

Of course, China remains the key to resolving the crisis. Although it supplies most of the North’s energy and about two-thirds of its food and humanitarian aid, it is running out of patience with what some Chinese officials call “the little upstart”. From Beijing’s perspective, however, a collapsed North Korean state or even a peaceful Korean reunification raises two serious threats to Chinese security: a flood of refugees into north-east China as well as an expanded US strategic orbit in what Beijing perceives as its sphere of influence.

In these circumstances, several American opinion leaders and former policymakers are calling on Washington to assuage Beijing’s concerns. That means indicating to China that the US would try to prevent or mitigate a refugee crisis and refrain from positioning forces along the Yalu River. At this stage, Beijing will probably hedge its bets and continue to prop up the regime rather than accept Korean reunification.

Meanwhile, the twin strategy of containment and deterrence is keeping in check the impoverished and isolated state. And although there is always a danger that Kim won’t act rationally and may miscalculate, it is worth remembering that there has never been a full-scale war between two countries with nuclear weapons. After all, as distinguished foreign policy realist intellectuals such as Barry Posen, John Mearsheimer, and Kenneth Waltz have argued, to threaten, much less carry out a nuclear attack on a nuclear power is to become a nuclear target. Anyone who attacks the US or its interests in the region with nuclear weapons will be attacked with many more nuclear weapons.

All of this is why, in the case of Iraq a decade ago, there was every reason to believe that any threat posed by Saddam — a cynical calculator whose overriding concern was consolidating power, not exporting martyrdom — could have been contained as it had been since the 1991 Gulf War. Saddam knew if he smuggled weapons of mass destruction to al Qaeda or used banned weapons against US interests, his regime would have met, as Condi Rice put it a year before Bush became president, “national obliteration” from the US nuclear arsenal. Yet for preventive war advocates, containment allowed Saddam to defy United Nations resolutions and snub his nose at the international community.

Never mind that containment (sanctions, a naval blockade, the no-fly zone) kept Saddam in his box for more than a decade. And never mind that although containment lacked the ideological red meat the American people craved after the shock and outrage over September 11, it recognised the dangers of the unintended consequences a “liberated” Iraq has delivered since the 2003 invasion: huge costs in blood and treasure as well as diminished US credibility, prestige, and global standing.

The point here, as Richard Betts points out in a recent edition of Foreign Affairs, is that although containment does not work against terrorists, who can run and hide and, in any case, do not fear death, it can work against rogue states. After all, they have a return mailing address and they want to survive. As President Obama faces the challenge of dealing with nuclear-bound Pyongyang and Tehran, he should remember that if Stalin’s Soviet Russia and Mao’s Red China could be contained and deterred, so can North Korea’s communists and Iran’s mullahs.