SEC/Lesson 1 of 7/6 min read
Security Fundamentals
The CIA triad, AAA, threats, vulnerabilities and risk, threat modeling with STRIDE, defense in depth, least privilege, zero trust, and security design principles.
On this page
Cybersecurity
Cybersecurity is protecting systems, networks and data from unauthorized access, damage or disruption. It is a balance: perfect security is impossible, so the goal is to make attacks expensive enough, and detect and recover from the ones that succeed.
CIA Triad
The three core properties every security control protects.
Confidentiality
Only authorized parties can read the data. Controls: encryption, access control, data classification. Breach example: a leaked customer database.
Integrity
Data is not modified without authorization, and modifications are detectable. Controls: hashes, MACs, digital signatures, checksums, version control, audit logs. Breach example: an attacker changing a bank transfer amount in transit.
Availability
Authorized users can access the system when needed. Controls: redundancy, backups, DDoS mitigation, capacity planning. Breach example: a DDoS attack or ransomware.
The DAD triad is the attacker's view: Disclosure, Alteration, Destruction (denial).
AAA
| Step | Question | Example |
|---|---|---|
| Authentication | Who are you? | Password, passkey, certificate |
| Authorization | What are you allowed to do? | Roles, permissions, ACLs |
| Accounting (auditing) | What did you do? | Logs, audit trails |
Identification (claiming an identity, such as a username) comes before authentication (proving it). See authentication and access control.
Non-Repudiation
Non-repudiation means a party cannot deny having performed an action. Achieved with digital signatures (only the private key holder could have signed) plus trustworthy logs. A shared secret (a MAC) does not give non-repudiation, because both parties could have produced it.
Threats, vulnerabilities and risk
Vulnerability
A vulnerability is a weakness that can be exploited: a bug (SQL injection), a misconfiguration (a public storage bucket), or a process gap (no MFA). Public vulnerabilities get CVE identifiers and CVSS severity scores.
Threat
A threat is anything that can exploit a vulnerability: a threat actor (cybercriminal, nation state, hacktivist, insider, script kiddie) or an event (flood, hardware failure). An exploit is the code or technique that does it.
Risk
Risk = likelihood × impact. A critical bug in an unreachable internal tool can be lower risk than a medium bug on the login page.
Ways to handle risk:
- Mitigate: apply controls to reduce it.
- Transfer: insurance, outsourcing.
- Avoid: stop the risky activity.
- Accept: document and live with it when mitigation costs more than the risk.
Attack Surface
The attack surface is the sum of all points where an attacker can try to get in: open ports, APIs, forms, file uploads, third-party dependencies, employees. Shrinking it (disable unused services, remove old endpoints) is one of the cheapest defenses.
Control types
| By function | Examples |
|---|---|
| Preventive | Firewalls, MFA, input validation |
| Detective | IDS, log monitoring, file integrity checks |
| Corrective | Patching, restoring from backup |
| Deterrent | Warning banners, legal policies |
| Compensating | Extra monitoring when a fix is not possible yet |
By type: technical (firewalls, encryption), administrative (policies, training), physical (locks, guards).
Threat Modeling
Threat modeling is a structured way to find what can go wrong in a design before it is built:
- What are we building? Draw a data flow diagram with trust boundaries.
- What can go wrong? Apply STRIDE to each element and flow.
- What are we going to do about it? Mitigate, transfer, avoid or accept.
- Did we do a good job? Review and validate.
STRIDE
| Threat | Violates | Example | Mitigation |
|---|---|---|---|
| Spoofing | Authentication | Forged login, stolen session | Strong auth, MFA |
| Tampering | Integrity | Modified request or file | Signatures, MACs, validation |
| Repudiation | Non-repudiation | "I never made that transfer" | Audit logs, signatures |
| Information disclosure | Confidentiality | Leaked data, verbose errors | Encryption, access control |
| Denial of service | Availability | Flooding, resource exhaustion | Rate limits, redundancy |
| Elevation of privilege | Authorization | User becomes admin | Least privilege, authz checks |
Security design principles
Defense in Depth
Defense in depth layers several independent controls so that one failure does not mean compromise: perimeter firewall, network segmentation, host hardening, application validation, encryption, monitoring, backups. Like a castle with a moat, walls, gates and guards.
Principle of Least Privilege
Every user, process and service gets only the permissions it needs, for only as long as it needs them. A web app's database account should not be able to drop tables; an intern should not have production access. Limits the blast radius of any compromise.
Related: separation of duties (no single person can complete a sensitive action alone, such as both creating and approving a payment) and need to know.
Zero Trust
Zero trust drops the idea of a trusted internal network: "never trust, always verify".
- Authenticate and authorize every request, regardless of network location.
- Strong identity for users and devices; check device posture.
- Micro-segmentation; least-privilege, short-lived access.
- Assume breach: monitor continuously.
It replaces the old castle-and-moat model, where a VPN connection meant full access to everything inside.
More principles
- Fail securely: on error, deny access rather than allow it.
- Secure by default: the default configuration is the safe one.
- Keep it simple: complexity hides bugs.
- Open design (Kerckhoffs's principle): security must not depend on the design being secret; only keys are secret. "Security through obscurity" alone is not security.
- Complete mediation: check authorization on every access, not just the first.
Quick revision
- CIA: confidentiality (no unauthorized reads), integrity (no unauthorized changes), availability (accessible when needed).
- AAA: authentication, authorization, accounting. Digital signatures give non-repudiation.
- Vulnerability is the weakness, threat is who exploits it, risk is likelihood times impact.
- Threat model with data flow diagrams and STRIDE.
- Defense in depth, least privilege, zero trust, fail securely, secure by default.