Getting Hit by a Boat - Defensive Design

In a group discussion last week – I heard a story (I could not find the origin – if you know where it comes from – please let me know) – which I would like to share with you.

John was floating out in the ocean, on his back, with his shades, just enjoying the sun, the quiet, the time to himself, not a care in the world.

When all of a sudden he got bumped on the head (not hard enough to cause any serious damage) with a small rowing boat.

John was pissed…. All sorts of thoughts running through his head.

  • Who gave the driver their license?
  • Why are they not more careful?
  • I could have been killed?
  • Why are they sailing out here – this is not even a place for boats.

And with all that anger and emotion he pulled himself over the side of the boat, ready to give the owner/driver one hell of a mouthful.

When he pulls himself over the side, he sees an empty boat. No–one there, no-one to scream at.

And at that moment all the anger and rage that was building up inside – slowly went away.

We encounter things every day – many of them we think are directly aimed at us – deliberately or not – but we immediately become all defensive, build up a bias against the other and are ready to go ballistic. Until we understand that there is no-one to direct all this emotion and energy at.

And then we understand that sometimes thing just happen, things beyond our control and we cannot or should not put our fate into some else’s hands.

That was the original story – which I really can relate to.

14221418411_385101705b_z
(Source: Flickr – Steenaire)

But before I heard the last part of the story – my mind took this to a totally different place – which is (of course) architecture related.
John was enjoying a great day in the sun – and all of a sudden he got hit in the head by a boat.
Where did that boat come from?
No-one knows.. I assume the owner had tied it up properly on the dock.

  • Maybe the rope was cut.
  • Maybe someone stole it and dumped it when they were done.
  • Maybe there was a storm that set the boat loose.
  • Or maybe there was a bloopers company that was following the boat all along to see who would get hit in the head.

There are endless options as to how the boat got there. But they all have something in common. The boat was never supposed to end up hitting John in the head.. John expected to be able to bake nicely in the sun and not be hit in the head by a boat
But what if John had taken additional precautionary measures?

  • Set up a fence / guardrail around where he was floating
  • Put someone as a lookout to warn him about floating boats
  • Have a drone above his head hooked into a heads-up-display in his sunglasses that he can see what is going around him

There are endless possibilities and you can really let your imagination take you to where you want to go as to how John could have prevented this accident.

What does this have to do with Defensive Design?

When we design an application – we think that we are going to be ok – because we expect to be able to do what we want to do without interference.

For example.

My web server is suppose to serve web requests of a certain type. I did not plan for someone crafting a specific request that would crash my server or bombarding the webserver with such an influx of traffic that would bring the application to its knees.

But then something unexpected happens.

When you design your application you will never be able to predict every possibility of attack or some esoteric ways  people are going to use your software. There is always something new that comes up – or someone thinks of a different way to use your idea that you did not even think of.

What you can do, is put some basic guardrails into your software that will protect you from what you do know or think can happen.

  • Throttling the number of connections or request – to prevent DDOS attacks.
  • Introducing circuit breakers to prevent cascading failures
  • Open only specific ports / sockets
  • Sufficient authentication to verify that you should be doing what you are supposed to
  • Monitoring for weird or suspicious behavior.

Again the options are practically endless. And you will not think of it all. You should address the issues as they happen, iterate, rinse, repeat.

That was a 4 minute read into thing that I think about during the day.

What kind of things do you think about when during your daily work? I would be interested in hearing. Please feel free to leave comments down below.