Welcome!

Cloud Security Authors: Pat Romanski, Zakia Bouachraoui, Elizabeth White, Yeshim Deniz, Liz McMillan

Related Topics: @CloudExpo, Cloud Security, @DevOpsSummit

@CloudExpo: Blog Feed Post

Why Your Code Isn’t as Secure as You Think (And What You Can Do About It) | @CloudExpo #Cloud

For any given bit of code or corresponding bit of functionality, how many people really know what's going on?

Why Your Code Isn't as Secure as You Think (And What You Can Do About It)
By Erik Dietrich

How well do you know your code?

It sounds like a strange question, but please indulge me.

Maybe you're a manager or business analyst. If this is the case, you ‘know' the code through a translation layer in which the developers in your organization explain what it does. Sometimes you can see what it does by interacting with it as a user or by reading incident reports.

But to really know and understand what it would do - to have a grasp on how it will behave in an arbitrary situation - you need one or more developers to give you an explanation.

Maybe you're a developer.
In this case, you don't need a translator.  If you've written the code, then, presumably (hopefully), you can explain how it works in arbitrary situations. If someone else on your team, in your group, or from your department has written the code, you might not know it quite as well. But, with a bug report, an afternoon, and your IDE, you could figure it out. That's assuming, of course, that you have access to the code and some reason to look at it.

Depending on the size and scope of the codebase or codebases that the company has in production, any given developer may be utterly and permanently clueless about some corner of the application. For any given piece of code, someone knows something about it, assuming the author has not departed the company, but the knowledge coverage may not be especially deep.

For any given bit of code or corresponding bit of functionality, how many people really know what's going on? Could it be fewer than you think? Maybe just one person? Maybe even... no one, in the event that the original author has long since departed?

The danger of shallowness of knowledge
Cisco recently announced the launch of an internal code review. This was done in response to Juniper performing a similar sort of internal audit and discovering code that would allow secret, remote access to its firewall products. The linked article makes allusions to the NSA and some pretty cloak and dagger stuff, with it not being known at the time of writing how this code found its way into production.

I can tell you from my own experience that such a thing would be appallingly easy, in some situations. I've personally been in situations, particularly at smaller companies, where I was the gatekeeper between the codebase and production deployments. I could literally have sneaked a condition into the codebase that appended "|| password == ‘Erik'" that would have given me carte blanche access to a production system for as long as I worked there and quite possibly long after I'd left.

Of course, I've never done any such thing. And frankly, I doubt too many developers have either. If a developer were going to do something like this with any sort of ill intent, I suspect that he'd be a lot more clever about it. The resultant code would almost certainly be subtler and come along with plausible deniability. "Oh my," he would later say if confronted, "I can see now how that BUG would allow someone admin access - I had no idea!"

I have never done such a thing, nor have I ever been tempted.

But the fact that it would have been possible for me to do it easily is a huge process smell. It indicates that there is a perilous shallowness to knowledge of the code. You typically see this in small, understaffed shops where the development team is spread quite thin. But no one is really immune - it just takes that one module that no one but Alice really knows too much about.

This situation is so dangerous precisely because there are all manner of ways that Alice as the only link in the chain can break. Maybe she inadvertently opens a security hole. Maybe someone socially engineers her somehow to inadvertently open a security hole. Maybe she's paranoid about being fired and builds in an ‘insurance policy.' The list goes on. But if Alice is the only one with eyes on what Alice is doing, weird, unpredictable, and problematic things could be brewing.

In short, and to return to my earlier question, you don't really know what your code is doing if you have to take a single person's word for it.

Code review to the rescue
It should surprise no one that the solution to this problem is an all-hands-on-deck audit.

There is no faster way to increase the organizational knowledge depth of the code than to bring in an army of people to read, review, understand, and question existing it. To appropriate Eric S Raymond's famous quote, "with enough eyes, all backdoors are visible."

But this sort of Herculean effort is extremely costly and evokes the phrase, "closing the barn door after the horse has escaped."

Throwing a lot of people at a massive code audit is expensive both in opportunity cost and in wage cost because at least some of them will presumably need knowledge of the codebase. It's also probably the case that your reputation has suffered a hit and that you're scrambling to cover yourself. This is not only wholly suboptimal, but easily preventable.

All that's necessary is a culture of regular code review. On the surface, code review seems like a costly exercise that's often a luxury. After all, each hour spent reading someone else's code is an hour that the engineer could be writing new code. This argument, however, tends to fall apart quickly on deeper inspection.

Code review is one of the most effective ways to reduce defect counts, and that alone probably recoups the return on investment. But a subtler, more germane benefit is that code review promotes a culture of collective code ownership.

Collective code ownership is the idea that there isn't "Alice's module" and "Bob's module." Members of the team do not silo and do not own code. They work on one section of the code or one feature, and then move on to a different one. They collaborate heavily on all code being written, through pair programming and/or code review. This creates a culture in which the team owns the code. And when the team owns the code, the possibility that any one developer will take out an ‘insurance policy' becomes orders of magnitude smaller.

Anyone with a stake in production software worries about their code. Does it do what it's supposed to? Does it perform well? Does it look good? How safe is it? There are few easy answers when it comes to questions like this.

But when it comes to the safety of your code, you have the good fortune of a no-brainer at your disposal: create and nurture a culture of code review.

Read the original blog entry...

More Stories By SmartBear Blog

As the leader in software quality tools for the connected world, SmartBear supports more than two million software professionals and over 25,000 organizations in 90 countries that use its products to build and deliver the world’s greatest applications. With today’s applications deploying on mobile, Web, desktop, Internet of Things (IoT) or even embedded computing platforms, the connected nature of these applications through public and private APIs presents a unique set of challenges for developers, testers and operations teams. SmartBear's software quality tools assist with code review, functional and load testing, API readiness as well as performance monitoring of these modern applications.

IoT & Smart Cities Stories
Andrew Keys is Co-Founder of ConsenSys Enterprise. He comes to ConsenSys Enterprise with capital markets, technology and entrepreneurial experience. Previously, he worked for UBS investment bank in equities analysis. Later, he was responsible for the creation and distribution of life settlement products to hedge funds and investment banks. After, he co-founded a revenue cycle management company where he learned about Bitcoin and eventually Ethereal. Andrew's role at ConsenSys Enterprise is a mul...
Whenever a new technology hits the high points of hype, everyone starts talking about it like it will solve all their business problems. Blockchain is one of those technologies. According to Gartner's latest report on the hype cycle of emerging technologies, blockchain has just passed the peak of their hype cycle curve. If you read the news articles about it, one would think it has taken over the technology world. No disruptive technology is without its challenges and potential impediments t...
Nicolas Fierro is CEO of MIMIR Blockchain Solutions. He is a programmer, technologist, and operations dev who has worked with Ethereum and blockchain since 2014. His knowledge in blockchain dates to when he performed dev ops services to the Ethereum Foundation as one the privileged few developers to work with the original core team in Switzerland.
René Bostic is the Technical VP of the IBM Cloud Unit in North America. Enjoying her career with IBM during the modern millennial technological era, she is an expert in cloud computing, DevOps and emerging cloud technologies such as Blockchain. Her strengths and core competencies include a proven record of accomplishments in consensus building at all levels to assess, plan, and implement enterprise and cloud computing solutions. René is a member of the Society of Women Engineers (SWE) and a m...
If a machine can invent, does this mean the end of the patent system as we know it? The patent system, both in the US and Europe, allows companies to protect their inventions and helps foster innovation. However, Artificial Intelligence (AI) could be set to disrupt the patent system as we know it. This talk will examine how AI may change the patent landscape in the years to come. Furthermore, ways in which companies can best protect their AI related inventions will be examined from both a US and...
In his general session at 19th Cloud Expo, Manish Dixit, VP of Product and Engineering at Dice, discussed how Dice leverages data insights and tools to help both tech professionals and recruiters better understand how skills relate to each other and which skills are in high demand using interactive visualizations and salary indicator tools to maximize earning potential. Manish Dixit is VP of Product and Engineering at Dice. As the leader of the Product, Engineering and Data Sciences team at D...
Bill Schmarzo, Tech Chair of "Big Data | Analytics" of upcoming CloudEXPO | DXWorldEXPO New York (November 12-13, 2018, New York City) today announced the outline and schedule of the track. "The track has been designed in experience/degree order," said Schmarzo. "So, that folks who attend the entire track can leave the conference with some of the skills necessary to get their work done when they get back to their offices. It actually ties back to some work that I'm doing at the University of San...
When talking IoT we often focus on the devices, the sensors, the hardware itself. The new smart appliances, the new smart or self-driving cars (which are amalgamations of many ‘things'). When we are looking at the world of IoT, we should take a step back, look at the big picture. What value are these devices providing. IoT is not about the devices, its about the data consumed and generated. The devices are tools, mechanisms, conduits. This paper discusses the considerations when dealing with the...
Bill Schmarzo, author of "Big Data: Understanding How Data Powers Big Business" and "Big Data MBA: Driving Business Strategies with Data Science," is responsible for setting the strategy and defining the Big Data service offerings and capabilities for EMC Global Services Big Data Practice. As the CTO for the Big Data Practice, he is responsible for working with organizations to help them identify where and how to start their big data journeys. He's written several white papers, is an avid blogge...
Dynatrace is an application performance management software company with products for the information technology departments and digital business owners of medium and large businesses. Building the Future of Monitoring with Artificial Intelligence. Today we can collect lots and lots of performance data. We build beautiful dashboards and even have fancy query languages to access and transform the data. Still performance data is a secret language only a couple of people understand. The more busine...