Train Every Software Engineer to Be a Penetration Tester


Because security matters

The Idea

External Pen Testers are useful, but only have a limited amount of time to get to know our systems and are not intimately familiar with the Ravelin codebase. On the other hand, engineers and data scientists within Ravelin know the codebase inside out (they wrote it after all), they understand the API and the expected functionality. Why not train all technical staff on Pen Testing? Not only will they gain experience with security awareness, leading to a more secure code but also have a bit of fun during War Games.

war-games

For those not familiar with War Games, the general idea is to have an attacking team and a defending team. The purpose is to test the infrastructure & application in order to discovery unknown vulnerabilities and put in place fixes. It is also useful for training staff who are required to be on-call as during war games the infrastructure can become very unstable and diagnosing issues quickly can make the difference between winning or losing . (https://en.wikipedia.org/wiki/Wargame_(hacking))

We would run our War Games Day over a single day (Monday) and have prizes awarded four days later (Friday). Giving enough time for any long running scripts to execute and for fixes to be put in place.

Training

This is obviously the most important step, the better the training the more likely we are to find security weaknesses. Ravelin is very fortunate to have an ex-pen tester from RSA on the data science team, who could deliver all the training. If this wasn’t the case, we would have used our external pen testing company to come in and deliver the training.

To make things a little easier we also asked staff to join teams that covered part of the system they were most familiar with, reducing the training overhead. For example we didn’t need to train API developers on the internal office subnet structure.

Attack Surface

We decided early on that we wanted to be as inclusive as possible, so pretty much everything was in scope. This was split into three distinct attack surfaces: All Dashboards (client facing and internal), All API Endpoints, All Networks (internal, external, office etc).

Aspects of the business that were out of scope:

Teams

The formation of teams was based around interest from each engineer/data scientist for one of the three attack surfaces, I then attempted to balance the teams with both senior and more junior members. Importantly, we encouraged staff to pick the part of Ravelin’s stack they were most familiar with, hopefully leading to “better” results.

Each team could run their attack as they saw fit, some teams delegated parts of the system (within their remit) to an individual team member whilst other teams worked together in a control room fashion. Both methods worked well.

For the next War Games, we will encourage more of the control room style teams as engineers will be working on unfamiliar parts of the system.

Assessment

Four days after the War Games Day, we held the debrief. Each team presented their finding and real prizes were awarded (~£150 worth of prizes per team member of the winning team). In total 8 low vulnerabilities and 2 medium vulnerabilities were discovered, with each team finding at least a couple. Things like default password on our printer and being able to SSH into our telephones both from within the office network, to a redirect parameter being set as a GET variable in the dashboard. For judging we decided on an anonymous peer review poll based on the following criteria:

Our criteria being a watered down version of: https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator pen-test-results

Conclusion & Learnings

We found the experience exceptionally useful and would highly recommend it to every company. Ravelin will be running the next War Games in 6 months and every 6 months from then on.

Having the business bought into the process and allowing time for bugs/vulnerabilities to be fixed needs to be factored in next time. Although most of the bugs found were fixed during the war games week, we still have a couple of none critical bugs that still need to be fixed.

Having prizes of real value isn’t 100% necessary; however, is a good idea as it goes a little way to represent the real business value.

Next time round, some engineers will work on parts of the application they are least familiar with; this should lead to a smaller Bus Factor (https://en.wikipedia.org/wiki/Bus_factor) but also allow for working within teams that don’t normally work together.