0
0
Cybersecurityknowledge~30 mins

Directory services (Active Directory, LDAP) in Cybersecurity - Mini Project: Build & Apply

Choose your learning style9 modes available
Understanding Directory Services: Active Directory and LDAP
📖 Scenario: You are learning about directory services used in organizations to manage users and resources securely. Two common directory services are Active Directory and LDAP. This project will help you understand their basic structure and how they store information.
🎯 Goal: Build a simple representation of a directory service using a dictionary to store user information, then filter users based on a condition, and finally add a configuration setting to simulate access control.
📋 What You'll Learn
Create a dictionary named directory with user entries and their roles
Add a variable named access_level to set a minimum role for access
Use a dictionary comprehension to create a filtered dictionary allowed_users with users meeting the access level
Add a final key service_status to the directory dictionary indicating if the service is active
💡 Why This Matters
🌍 Real World
Directory services like Active Directory and LDAP are used in companies to manage who can access computers, files, and applications securely.
💼 Career
Understanding directory services is important for cybersecurity professionals to control user permissions and protect organizational resources.
Progress0 / 4 steps
1
Create the directory data structure
Create a dictionary called directory with these exact entries: 'alice': 'admin', 'bob': 'user', 'carol': 'guest', 'dave': 'user', and 'eve': 'admin'.
Cybersecurity
Need a hint?

Use curly braces {} to create a dictionary and separate each key-value pair with a comma.

2
Add access level configuration
Add a variable called access_level and set it to the string 'user' to represent the minimum role allowed access.
Cybersecurity
Need a hint?

Assign the string 'user' to the variable access_level.

3
Filter users by access level
Create a new dictionary called allowed_users using dictionary comprehension. Include only users from directory whose role is either 'admin' or 'user' (roles equal to or higher than access_level). Use for username, role in directory.items() to iterate.
Cybersecurity
Need a hint?

Use dictionary comprehension with for username, role in directory.items() and an if condition to filter roles.

4
Add service status to directory
Add a new key-value pair to the directory dictionary: set the key 'service_status' to the string 'active'.
Cybersecurity
Need a hint?

Use directory['service_status'] = 'active' to add the new key and value.