CY2: Authorised assessment: settings, packages and reports

Lesson 2 of 5 · reading 15–25 minutes; practice and project time is on the module page

Reviewing settings

🎯You'll be able to

Spot risky settings, such as debug mode, written-in secrets, weak cookie flags, long sessions and open cross-origin access.

🏠The everyday picture

A new flat can have strong doors but a spare key under the mat, a window left open, and the alarm switched to "test". None of them is a broken lock; all of them are settings.

📘What it really is

📝A worked example

Input: data/assessment-target/settings.json from the kit.

Steps:

  1. Read each setting. "debug": true, a secret_key written in the file, "session_hours": 720, cookie_secure and cookie_httponly false, and "cors_allow_origins": ["*"].
  2. Compare with the baseline in docs/FORMATS.md, which gives a rule ID and severity for each: for example CFG-DEBUG medium, CFG-SECRET high.
  3. Write each as a finding with the rule, the evidence (the setting and value) and the fix.

Expected output: five settings findings, one each for debug, secret, cookie, session length and CORS.

🌍Where it's used

📝Case scenario

An online learning company left debug mode on after a busy release. An error page showed the database password to anyone who triggered it. They turned debug off within an hour, but also had to change the password, because it had already been on screen.

🖱️Try it

In the kit, open data/assessment-target/settings.json and config/settings.json side by side. Success: you can name two settings the old server had that the starter's config file still repeats.

⚠️Common mistakes

🛠️For your project

In Project 1 you write check_settings in assess/assess.py. Tests 1 and 2 check it finds all five problems, and finds nothing in safe settings.

✅Quick check

Why isn't moving a leaked key into an environment variable enough?

Show the answer

The old key has already been exposed and must be replaced.

What does the HttpOnly cookie flag stop?

Show the answer

Scripts on the page reading the cookie.

← PreviousPlanning an assessment
ProLearners Assist