Cybersecurity Foundations·A security baseline you can use

A practical security checklist

A short list you can run against any project to catch the most common and costly mistakes.

Beginner 10 min read Lesson 5 of 300 Challenge included
What you will be able to do
  • Check authentication and authorization for every route.
  • Treat all input as untrusted and encode output.
  • Keep secrets out of code, logs and client bundles.
  • Verify headers, dependencies, monitoring and backups.

In plain English

Authentication is how a system proves who you are, such as a password plus MFA, while authorization is what that identity is allowed to do once logged in, and both need checking separately. Input is anything a user or another system sends you, and it must be treated as untrusted and handled with parameterised queries and output encoding. Secrets are credentials like API keys and database passwords that belong in a secret manager rather than in Git, client code or logs. Headers are instructions your server sends the browser, such as HTTPS, HSTS and Content Security Policy, that close whole classes of web attacks. Dependencies, monitoring and backups round out the list, because the code you did not write, the errors you cannot see and the data you cannot restore are where most failures begin.

Step by step

  1. 1Walk through each route and confirm authentication and authorization checks.
  2. 2Trace one request from input to output and confirm nothing untrusted becomes code.
  3. 3Search the repository and logs for hardcoded or leaked secrets.
  4. 4Review headers, lockfile and audit status, and confirm monitoring and backups run.
  5. 5Fix anything that fails before shipping, then re-run the checklist.
checklist.txtText
Authentication: slow password hashing, MFA, rate limiting
Authorization: least privilege, server-side checks
Input: parameterised queries, output encoding
Secrets: secret manager, nothing in Git or logs
Headers: HTTPS, HSTS, CSP, secure cookies
Dependencies: lockfile, audit, pinning
Monitoring: structured logs, few precise alerts
Backups: 3-2-1, immutable copy, restore drills

Common mistakes

  • Checking authentication but not authorization lets a logged-in user perform actions they should not be allowed to do.
  • Validating input at the front end but not on the server trusts an attacker to obey the browser.
  • Committing a secret and later deleting the file still leaves it in Git history, where it stays readable.
  • Treating the checklist as a one-time task misses that every new feature can reopen an old hole.
Your turn

Guard a user route

Medium

Write a function canReadUser that returns false unless the caller has a valid session and the requested user id equals the session user id.

JAVASCRIPT · starter
function canReadUser(request) {}
Check your understanding before moving on.
Knowledge checkQuestion 1

What is the difference between authentication and authorization?

Select an answer to continue
Study tools

Make it yours.

Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.

Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign in
Finished reading?

Lock in what you just learned.

Mark this lesson complete to save your place and move one step closer to the certificate.

Lesson 5 of 300 · 0% of course