(CNN) Former US Ambassador to NATO and Bush administration State Department official Nicholas Burns accused President Donald Trump of a "dereliction of the basic duty to defend the country" for his apparent disinterest in Russia's meddling in the 2016 US election.

Testifying before the Senate intelligence committee Wednesday, Burns criticized both the Obama and Trump administrations for their response to Russia's election-related hacking.

He said the Obama administration "should have acted earlier and more vigorously" to respond to Russia's hacking, but he saved his most stinging criticism for Trump.

"I find it dismaying and objectionable that President Trump continues to deny the undeniable fact Russia launched a major cyberattack against the US," Burns said. "President Trump has taken no action whatsoever, and that's irresponsible.

"It's his duty to investigate and defend our country against a cyberoffensive because Russia is our most dangerous adversary in the world today," the former ambassador added. "And if he continues to refuse to act, it's a dereliction of the basic duty to defend the country."

Burns was testifying at a hearing on Russia's hacking in European elections, where he and the other witnesses warned that Moscow's actions in France, Montenegro and more show that Russian President Vladimir Putin will try to hack future US elections, too.

"Russia is going to do this again," Burns said. "You heard (former FBI) Director (James) Comey at this committee say that he felt that Russia would be back, maybe, against a Republican or Democratic party."

White House press secretary Sean Spicer said Monday that Trump has issued an executive order on cybersecurity and set up an election commission.

"He signed an executive order on cybersecurity to strengthen our ability to combat anybody from interfering not just in our election but a lot to our key infrastructure," Spicer said. "And secondly, he has got a commission that will continue to have activities this month, looking holistically at the election process to make sure we are taking all the steps to protect the integrity of our voting system."

Constanze Stelzenmueller, a Brookings Institution senior fellow and German foreign policy expert, said at Wednesday's hearing that there's clear consensus Russia will try to hack Germany's upcoming elections, and warned that the US-Europe NATO alliance needed to be united in the response to Moscow.

"An American that feels ambiguous about the value of this alliance could be perceived by the Kremlin as the ultimate encouragement," she said.

Virginia Sen. Mark Warner, the top Democrat on the intelligence committee, said he was concerned that the US has not yet learned lessons from the 2016 election hacking, but that he was more encouraged by the measures taken in Europe.

"Frankly, we could learn a thing or two from our allies in Europe about proactively protecting ourselves against the threat posed by Russia," Warner said. "Months ago, I would have assumed a hearing like this would have been a good opportunity for the United States to impart some lessons learned to our European friends. Unfortunately, to date, we have yet to learn many lessons."

Warner also noted that social media companies like Facebook also appear to have gotten smarter to stop the efforts from bots and fake accounts.

"I was recently out with Facebook and they pointed out the fact that in the French elections they took down about 30,000 fake accounts right before the election and I commend them because right after the American election, Facebook acted like they had no responsibility for policing fake news," Warner said. "I think they have moved to a more responsible position."

Ahead of Wednesday's hearing on election hacking, Trump's nominee to head the Homeland Security Office of Intelligence and Analysis told the same Senate intelligence panel at his confirmation hearing that he was "absolutely" committed to working with them as they proceed with their probe into Russian meddling in the US election.

David Glawe, a former FBI special agent and the chief intelligence officer at US Customs and Border Protection, said he shared the committee's concern over "the Russian intrusion into the state electorals" and that "solutions aren't going to be easy and the problem is increasing."

"I understand the need to understand who's been hacked," he said, in response to to charges from Warner that the committee has yet to receive the names of the 21 states that DHS officials said last week were attacked by Russian hackers

Warner added that he has spoken with Department of Homeland Security Secretary John Kelly about the inquiry. Warner and Senate intelligence committee chairman Richard Burr this week sent a letter to relevant state election officials asking that the information be made public, Warner said.

Glawe currently serves as the acting undersecretary for the I&A office, which is a member of the US Intelligence Community and the only of the 17 federal agencies mandated to share information with state and local groups.