Firstly, let's define what sort of hack I'm talking about /1
computerworlduk.com/security/magec…
This works as follows:
1. Attacker compromises the site
2. Attacker injects JavaScript into the site
3. JavaScript listens for and send credit card details to attacker
/2
Well, it seems to happen one of two ways:
1. The server gets owned, or
2. The administrative control panel of the application (such as Magento) gets owned
From there, JS insertion is trivial. /3
We, as systems administrators, have little / no visibility* to what happens within the browser. So,
1. We get hacked, and,
2. We don't know about it.
So, these hacks can persist for months!
/4
*except this changed recently
This is called "Content Security Policy" or CSP
/5
1. Only accept JavaScript from one domain (default-src, script-src)
2. Only allow in-page connections to a specific set of domains (connect-src)
/6
THIS IS AMAZING! /7
Not so fast road runner
It turns out, this issue is more problematic than you'd imagine. /8
- Hotjar
- Optimizely
- Email marketing
And other such marketing pieces.
These provide super valuable pieces of data to users who are helping design a website. /9
How do you know if you do this? If you've got Google Tag Manager, you do this.
This means that if we deploy CSP we'll break all of this tracking stuff. /10
CSP allows a "report-only" function, where it doesn't *block* stuff, it just allows you to check if you've got things running on your website you don't know about.
This is simple and safe to deploy. /11
It's a sign that it's too damned hard to get new JS deployed on a site. So, make that easier, or explain why it shouldn't be as easy as GTM.
/12
1. Things get hacked all the time, but
2. There's ways to quickly mitigate, detect and resolve these hacks, except
3. They rely on you having your fundamentals sorted out.
Deploy CSP (at least in report-only)
13/13 🎤👇