Lesson 01 of 16 · Why and what
Why security matters
Why anyone would attack your server, what they want and how they usually get in. The three things security protects (confidentiality, integrity, availability) and the handful of principles behind almost every control in this course: defence in depth, least privilege, small attack surface, secure defaults and assume breach.
"Who would attack my server?"
Almost certainly, a program. Within minutes of a new server getting a public IP address, automated scanners find it and start trying common passwords, known vulnerabilities and default settings. Nobody chose your server; it was simply there.
Try it
On any internet-facing Linux server, count today's SSH password guesses:
sudo journalctl -u ssh --since today | grep -c "Failed password".
On a public server with password login enabled, the number is often in the hundreds or thousands.
What attackers want
| Goal | What happens |
|---|---|
| Money | Ransomware (encrypt your data, demand payment), stealing card or bank details |
| Your computing power | Crypto-mining on your CPUs, which you pay for |
| A launching point | Sending spam, attacking other sites, hiding their tracks behind your IP |
| Data | Customer records, passwords, business secrets, to sell or use |
| A way in | Your server is the door to a bigger network or to your customers |
| Disruption | Taking a service down (denial of service), defacing a website |
How they usually get in
Mostly not with clever, unknown attacks. The common ways are:
- Weak or reused passwords, and passwords leaked from other sites.
- Unpatched software with a published vulnerability.
- Misconfiguration: a database open to the internet, a storage bucket made public, a debug page left on.
- Phishing: tricking a person into giving credentials or running something.
- Leaked secrets: API keys or passwords committed to a public Git repository.
The good news: the basics in this course block most of these.
What we protect: the CIA triad
Confidentiality
only the right people
can read
▲
/ \
/ \
Integrity ─────── Availability
nobody changes it it works when
without being noticed it is needed
Every security control protects one or more of these. When you read about a control (encryption, backups, MFA), ask "which of the three does this protect?"
Think of your diary. Confidentiality: only you can read it (a lock). Integrity: nobody can rip out a page or change what you wrote without you noticing. Availability: it's there when you want to write in it, and not lost or locked away.
The principles behind the controls
- Defence in depth: several independent layers. A firewall, and key-only SSH, and updates, and monitoring. One layer will fail one day; the others hold.
- Least privilege: each person and program gets only the access it needs. A web app does not need root; a developer does not need production database admin.
- Small attack surface: every open port, installed service and user account is a possible way in. Remove what you do not use.
- Secure by default: make the safe setting the default one, so forgetting does not create a hole.
- Assume breach: prevention will sometimes fail. Have logs, alerts, backups and a plan to recover.
Security is a shared job
On a cloud server, the provider secures the data centre, hardware and hypervisor; you secure the operating system, software, configuration, accounts and data. Using a cloud does not make a server secure.
Recap
- Attacks are mostly automated and opportunistic; any public server is a target.
- Attackers want money, computing power, a launching point, data or disruption, and mostly get in through passwords, unpatched software, misconfiguration, phishing and leaked secrets.
- Security protects confidentiality, integrity and availability.
- Principles: defence in depth, least privilege, small attack surface, secure defaults, assume breach.
This site is a public version of my personal engineering knowledge hub. It intentionally excludes confidential company information and internal operational details.