0
0
Cybersecurityknowledge~30 mins

Logging and audit trails in Cybersecurity - Mini Project: Build & Apply

Choose your learning style9 modes available
Logging and Audit Trails
📖 Scenario: You work as a security analyst. Your job is to keep track of user actions on a system. This helps detect problems and keeps a record of what happened.
🎯 Goal: Create a simple logging system that records user actions with timestamps. You will build a list of logs, add a filter for important actions, and then display the filtered logs.
📋 What You'll Learn
Create a list called user_actions with exact user action entries.
Add a variable called important_action to filter logs.
Use a list comprehension to create filtered_logs with only important actions.
Print the filtered_logs list.
💡 Why This Matters
🌍 Real World
Logging user actions helps detect security issues and keeps a record for audits.
💼 Career
Security analysts and DevOps engineers use logging to monitor system activity and investigate incidents.
Progress0 / 4 steps
1
Create the initial user actions list
Create a list called user_actions with these exact entries: 'login', 'view_page', 'edit_profile', 'logout', 'delete_account'.
Cybersecurity
Need a hint?

Use square brackets to create a list and include the exact strings separated by commas.

2
Add a filter for important actions
Create a variable called important_action and set it to the string 'delete_account'.
Cybersecurity
Need a hint?

Assign the string 'delete_account' to the variable important_action.

3
Filter logs for important actions
Use a list comprehension to create a list called filtered_logs that includes only entries from user_actions equal to important_action.
Cybersecurity
Need a hint?

Use the syntax: [item for item in list if condition] to filter the list.

4
Display the filtered logs
Write a print statement to display the filtered_logs list.
Cybersecurity
Need a hint?

Use print(filtered_logs) to show the filtered list.