The U.S. government has earmarked $1 billion for state, local and territorial governments to defend themselves against cyberattacks.