I Don't Know Crap About Security

Recently, I was involved in a project that required doing some serious locking down of an application prior to an extensive audit (with potentially millions of dollars on the line). All the buzzwords were there: "pen testing", "red teams", and "everything depends on this". This wasn't going to be a simple, one-click fix. It was going to require me to pop a few Mountain Dews, dress in all black, and play pretend as a hacker.

I Don't Know Crap About Security

Needless to say - I was terrified of being tasked with this responsibility because as the title of this post would indicate: I don't know crap about security (or at least, I didn't).

You Don't Know What You Don't Know

I would say that I'm probably in the same boat as most developers. In that, security is seldom the first thing that comes to mind when building an application (if I even think of it at all). Typically, I tell myself things like the following.

The problem is that often, all of these have a single thing in common: you aren't really doing anything to ensure that your application is protected. You might rely on your favorite framework or justify the excuse for putting things off for whatever reason - but the security of your application should be treated just like your code, in that, you should actually test it out.

Your application might be fine. You may have followed all of the best practices and treated security as a first-class citizen within your app, but you don't know what you don't know, and until you try and break things, you won't.

Breaking Things

In my particular case, the application I was trying to battle-test was an older application that's been around for several years, so it isn't using the latest and greatest technologies and frameworks. If you've been a developer for a few years, I'm sure you can imagine exactly the type of application I'm talking about. A little WCF here, a little Web API there, maybe some ASPX pages sprinkled on top of an SPA; like I said - you probably know what I'm talking about.

I work with an incredible team of folks: awesome, passionate developers that make me feel dumb every day but I know that we aren't perfect. Smart people make mistakes too, it's just a part of the game. Security-related issues are often less of actual bugs and more of something that isn't given adequate thought (or time).

It's because of this that we have to burn things down in order to build them up. We need to grab the biggest bat lying around the office and repeatedly whack our application so that we can see what's left in the remaining pile of rubble.

I Don't Know Crap About Security

Once you see what areas of your application crumbled to pieces with ease, you'll know where to start trying to make improvements. While there are plenty of ways to do this, automation is going to be our friend here. Don't try and invent your own security testing platform, you'll just make things worse. There are plenty of openly available tools (as well as a few commercial ones that offer free trials) out there that'll do all the heavy lifting, such as,

Having all these wonderful tools at your disposal is great but it can be overwhelming. You probably need to give some thought to what your own concerns are with your application and focus on those, otherwise, you can consider performing a broad scan of the application and then dig into things a bit deeper (i.e. breadth-first then depth-first).

You Need A Plan

You need to dedicate some thought into how you are going to start securing your application, determine what's important to you (and your organization), and then triage the critical items that pop up.

I Don't Know Crap About Security

Every application is different. There's no silver bullet, one-click scan that will magically find everything wrong with your application (although some of the commercial-grade tools come pretty close). I'll provide an example of a workflow I used to help turn a pretty porous application into something that could survive a high-level penetration test:

After several iterations, you should see the number of vulnerabilities in your application drop. Major issues might require some serious engineering and refactoring of code, processes, and more, but they are well worth it when some super villain elects to attack your system and put it in the headlines.

The real challenge though is staying protected.

Building Habits

Let's say that you've dedicated hundreds of hours to risk your application of security vulnerabilities. Things like XSS attacks, SQL Injection, and CSRF are all things of the past... or at least, they were the last time that you scanned your system.

Building Habits

In a world of continuous deployment/integration, maintaining security standards and code quality can be challenging. Large teams, minuscule iteration cycles, and high-pressure deadlines can easily cause security to get thrown by the wayside in order to get that next version shipped. This is why it's so important to build good habits, as a team and leverage tools that can help ensure you stay productive and protected.

Some things to consider helping with these efforts include:

Security is a hugely broad topic, akin to architecture, in that you can't try to fix all the issues at once. Focus on building good habits and tackling important problems as they arise, and you'll find that the security of your applications will become less triage and more maintenance, which is a great position to be in. You'll know more of what you know (and what you don't) after putting some of these pieces in place, which should help put your product, your company, and your engineering team's collective minds at ease.

So, I'll leave you with this - you don't need to be a security expert to start caring about security. If you've been putting security off, don't; start making baby steps to put the pieces of the puzzle together. I can honestly say as an experienced engineer that I dove into this pool head-first and lived to tell the tale (and write this post), so I have no doubts that you can too. Don't let "not knowing crap" about security be the biggest reason that you aren't caring about security. It's an area where a small amount of effort can yield huge dividends and your product, your company, and your entire engineering team will be better for it.