Why OS Hardening Reduces Attack Surface
📖 Scenario: You are a cybersecurity trainee learning how to protect computers from attacks. One important way is to make the operating system (OS) more secure by removing or fixing weak points. This process is called OS hardening.
🎯 Goal: Build a simple explanation using a list of common OS features and then mark which ones to disable or secure. This will show how OS hardening reduces the attack surface by limiting what attackers can use to break in.
📋 What You'll Learn
Create a dictionary called
os_features with these exact entries: 'File Sharing': True, 'Remote Desktop': True, 'Unused Services': True, 'Default Passwords': True, 'Firewall': FalseCreate a variable called
features_to_disable and set it to a list containing 'File Sharing', 'Remote Desktop', and 'Unused Services'Create a new dictionary called
hardened_os using dictionary comprehension that sets the value to False for all features in features_to_disable and keeps the original value for othersAdd a final line that sets
hardened_os['Firewall'] to True to show enabling protection💡 Why This Matters
🌍 Real World
OS hardening is a key step in protecting computers and servers from hackers by reducing the number of ways they can attack.
💼 Career
Cybersecurity professionals use OS hardening to secure systems before deploying them in networks, reducing risks and improving safety.
Progress0 / 4 steps