White House Homeland Security Advisor Tom Bossert said US President Donald Trump had rallied allies and responsible tech companies around the world to increase the security and resilience of the Internet.
"Cooperation between industry and good governments will bring improved security, and we can no longer afford to wait," he said.
"We applaud our corporate partners, Microsoft and Facebook especially, for acting on their own initiative last week without any direction by the US government or coordination to disrupt the activities of North Korean hackers. Microsoft acted before the attack in ways that spared many US targets," he said.
"They shut down accounts the North Korean regime hackers used to launch attacks and patched systems," he said.
More From This Section
North Korea has done everything wrong as an actor on the global stage that a country can do, he added.
Bossert said US Trump had used "just about every lever you can use, short of starving the people of North Korea to death, to change their behaviour".
"At this point, some of the benefit that come from this attribution is letting them know that we're going to move to stop their behaviour," he said.
It also allows the US to galvanise the private sector, he said, adding that in this case, the private sector also acted.
Facebook took down accounts that stopped the operational execution of ongoing cyberattacks. And Microsoft acted to patch existing attacks, not just the WannaCry attack initially, he said.
He said it's also an opportunity to call on the other countries in the region that were affected to mobilise them to stop that same behaviour.
"Often, North Koreans can travel outside of North Korea to hack, or they can rely on people outside of the country with better access to the Internet to carry out this malicious activity. And we need other countries, not just other companies, to work with us," he added.