The U.S. is second only to Singapore in the UN's ranking, which examines countries' abilities to defend against cyber attacks.