As governments create smarter cities, they need cybersecurity measures built from the ground up — or they risk costly data breaches which could compromise the privacy of their citizens.

In 2016 alone, cyber-crime cost the global economy more than $450 billion and over two billion personal records were stolen, according to the chief executive of specialist insurer Hiscox.

Cities around the world are using various technologies — smart devices, apps, sensors, big data analytics and Internet of Things applications — to improve the lives of their citizens. This results in massive amounts of valuable data that interest cyber-criminals.

Etay Maor, an executive security advisor at IBM Security told CNBC if there is a way for hackers to monetize any type of stolen data, they will attack it. Traditionally, the kinds of information that drew attention were bank credentials, personal identity information and credit card details, but Maor said anything from airline miles to medical records are now targeted.

"Now we have nations that are connecting (various services to the internet)," Maor said. "It's critical that when these things are designed, when you're talking about smart nations, security should be a top priority."

The digitization of critical infrastructure, such as power plants, water supply and electricity distribution also creates vulnerabilities to cyber-attacks.

Many governments appear to realize that slapping on a layer of security at a later stage of smart city projects is no longer an option. Singapore already has a cybersecurity agency and last year, Prime Minister Lee Hsien Loong outlined the city-state's comprehensive strategy to tackle online threats.

Jordi Puigneró, secretary for telecommunications, cybersecurity and digital society for the government of Catalonia said cybersecurity needs the same kind of emphasis as security in the physical world. If governments fail to adequately secure their smart cities, people will not trust the services, he said.

"If they don't trust it, they won't use it. If they don't use it, we will not be competitive in this digital world," Puigneró, who leads the Catalan government's SmartCATalonia efforts, told CNBC last month at the sidelines of the IoT Asia 2017 conference in Singapore.