Cyberlium
Cyberlium
Cyberlium on Android·Google Play Store

Learn cybersecurity with hands-on labs and AI mentor support on your phone.

Mod 10 · Les 2/5
In progress
Module 10•Lesson 2 of 5•⏱️ 15 min read•Beginner+39 XP

Monitoring and Logging

Log auth decisions and denials — never full secrets.

Monitoring and Logging
00:00/02:11

Visual · api_monitoring

Observability without leaking tokens. Original Cyberlium.

If you cannot see denials, you cannot defend.

Log who called what and whether authz denied. Redact Authorization and bodies with secrets. Alert on spikes of 401/403/429.

1. What to log

subject, route, method, status, latency, request id.

Authz deny reasons at a safe level of detail.

Command guide

Try these commands — What to log

═══ TOOLS & WEBSITES ═══ Browse / read these (authorized learning only — stay in YOUR lab / program scope)

Structured logging — https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html Elastic observability — https://www.elastic.co/guide/en/welcome-to-elastic/current/getting-started-observability.html

═══ INSTALL ═══

Linux (Debian/Ubuntu):

Command — copy this

sudo apt install curl
sudo apt install jq

macOS:

Command — copy this

brew install jq

Windows: Built-in (PowerShell: Invoke-WebRequest)

Command — copy this

choco install jq

═══ LINUX / macOS ═══

Command — copy this

curl -sS http://127.0.0.1:8819/logs/recent 2>/dev/null | jq '.[0:3]' || curl -sS http://127.0.0.1:8819/logs/recent | head -20
grep -rEn 'api[_-]?key|Authorization:' "$HOME/cyberlium-lab/t13-api" --include='*.log' 2>/dev/null | head -3 || echo 'Review YOUR lab logs — redact secrets before sharing'

Primary tools to practice this lesson: curl, grep, jq. Reference sites: Structured logging (https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html); Elastic observability (https://www.elastic.co/guide/en/welcome-to-elastic/current/getting-started-observability.html). Run every command in the box — install first, then the usage lines — only on YOUR lab / program scope.

2. What never to log

Raw passwords, full JWTs, API keys, card data.

Align with privacy lessons.

3. Alerts

Burst 401/403, 429 storms, sudden 5xx.

On-call should not need production tokens in chat to debug.

4. What you ship: logging allow/deny list

Log fields vs never-log fields. Alert ideas.

5. What you record before the next lesson

Two lists in notes.

6. Wrong vs right: stranger APIs vs literacy on systems you own

Worked failure — same API word, opposite target. Right never needs a live shop or classmate token.

  • Wrong: Log every Authorization header in plaintext.
  • Right: Write lists. Next: checklist.
Hands-on Exercise

Mission: logging hygiene sheet

1) Fields to log. 2) Fields never to log. 3) One alert idea.

Pro Tip

Stuck? Ask Cyberlium AI Mentor

Ask Mentor: “Safe correlation IDs?”

Practice QuizQuestion 1
Multiple choice
Q1

APPLY: Never log:

Practice QuizQuestion 2
True or False
Q2

APPLY: True or False: Alert on 401 bursts can help.

Practice QuizQuestion 3
Multiple choice
Q3

APPLY: Authz denials should be:

←Previous: API Gateways
Answer 3 practice quiz questions to unlock XP reward. (0/3 answered)
Skip quiz & read next →