Recently I had the fortune of inheriting a few Fortify licenses. For those of you who do not know, Fortify is HP's static code analyzer that assesses your source code for security vulnerabilities. I say fortune because it assess application security on a code level and led to a great leadership experience for me: how to deal with pissed off developers when an application says their code is insecure.
First, what the heck is a static source code analyzer?
Source code analysis tools examine un-compiled or raw code for patterns. In more lengthy words, source code analysis tools examine the source code of an application and provide recommendations on how to improve it based on patterns the tool finds in the code.
Code analysis occurs in two ways "Static" or "Dynamic". Static analysis is examining the code without it executing while Dynamic analysis is examining the code while it is running.
So then what is Fortify?
Fortify is a static code analysis tool focused on security. This means that it analyzes your source code and digs up any security vulnerability it thinks (keyword) exists. In the world of Software Security Code Analysis/Review is the most critical component to building secure software (according to Gary McGraw in his book Secure Software [Software Security: Building Security In
] which I've referenced numerous times on this blog). While you can get a lot of great ideas, feedback and improvements to code with peer reviews a tool like Fortify or FxCop is really needed to catch attack patterns that the team might not be familiar with.
Code analysis is good! People's reaction to the results, not so much.
While using Fortify is simple, people's reaction to what the tool showed was not as easy to deal with. Unlike code reviews where people could be nice about how bad something is, tools like Fortify are blunt, to the point and rate just how terrible of a developer you are (or at least, that is how people can feel about it). When code is art, people don't like hearing that it has problems. With this in mind, you have a recipe for disaster. You want to make sure that you're applications are secure using a tool like Fortify or FxCop but you want to keep your development team's frustration levels low and spirits high. How can you get your cake and eat it too?
#1. Focus on the code not the developer
Accept one cold hard fact, you are where you are and it really does not matter how you got there. Fortify is going to tell you all your problems and recommend ways to fix them. As the development manager you need to keep the team focused on the code, don't place blame but make sure everyone is aware of security goals moving forward. If you have the opportunity to do so, assign remediation of the code to the original developer. This becomes a learning experience for them and also allows them to save face so their code is not perceived poorly by others.
#2. Make it about learning not about fixing
Yes, Fortify will find security issues but these are not problems, they are learning opportunities (yes, I do feed my team that kind of fun positive thinking talk :) ). Fortify will give you tons of data in the security report of your application(s). Take that data and assess what are the top 3 security issues you have throughout your application(s). Schedule a developer training meeting that focuses on one of these items. Follow up with another training on the second item, etc... Stick to the topics and follow up often to make sure the team has a firm grasp on the security issue and how to ensure it does not creep in to future builds. Stay away from terms like:
- We need to fix this issue
- People are going to use this to hack our app
- The world is going to end because your app is insecure
Focus on how the results from the scans will lead to more secure code not how insecure your common state is. This is not saying ignore the present. No, re-mediate as quickly as possible and deploy a more secure application but do not beat up your team over where you are because they will not be able to (nor want to) see where you want them to go.
#3. Reward success, support those who need it.
Let's face it, in the software world business sponsors want product fast, cheap and do not care about security until it bites them. Developers feed off this behavior by focusing on features, schedule and sometimes chose the quick solution over the best solution. This is a learned behavior that will take time to unlearn. The best way to bring security in focus is through positive reinforcement. Celebrate successful remediation of the application(s) with some fun activity on production release. Provide incentives to team members who regularly produce vulnerability free code and training to support team members who are not quite there yet.
If you have team members who consistently have problems, ask them to lead the next training. People who have trouble grasping a concept can often find their Rosetta Stone of understanding by trying to explain it to others. Another support mechanism could be paired programming with developers who consistently produce low vulnerability free (or mostly free) code.
In the end, it is your show
When you use a static source code analyzer to assess your team's code, as the leader you are responsible for making sure the team is on board with the results and acting on those results. These are basic ideas on how to make a source code analysis tool good for your application(s) and team morale. There are many more ways to make this process more painless. Let me hear some techniques that you have used to make this process go smoothly.