Thuta Learning
ရှာဖွေရန်
ProjectsSecurityintermediate

Project — Linux Server Security Hardening

စိတ်လျှော့ပါ။ ဒီခန်းကို စာအုပ်လိုမဟုတ်ဘဲ စကားပြောသလိုပဲ၊ နားလည်လွယ်အောင် ရှင်းပါမယ်။

ဒီခန်းပြီးရင် ဘာတတ်သွားမလဲ

  • Project — Linux Server Security Hardening ကို ကြောက်စရာမလိုအောင် နားလည်မယ်
  • ကိုယ်တိုင် authorized lab environment ထဲမှာ tool ကို run ကြည့်တတ်မယ်
  • Real assessment/report ထဲမှာ ဒီ concept ကို ချက်ချင်း အသုံးချတတ်မယ်

ခဏလေး ဒီလိုပဲ စဉ်းစားကြည့်

Security Hardening ဆိုတာ system ရဲ့ attack surface ကို လျှော့ချပြီး, default/misconfigured setting တွေကို secure configuration ဆီ ပြောင်းလဲတဲ့ process ပါ — unnecessary service disable, firewall rule tighten, SSH configuration secure ဖြစ်အောင် ချိန်ညှိ, automatic security update enable စတဲ့ concrete step တွေ ပါဝင်ပါတယ်။ Firewall/Password Security (Intermediate chapter) ကနေ လေ့လာခဲ့တဲ့ concept တွေကို ဒီ project မှာ practically အသုံးချရပါတယ်.

လက်တွေ့ scenario နဲ့ ချိတ်ကြည့်မယ်

Lab Linux VM (fresh install, ဒါမှမဟုတ် Metasploitable ကို hardening လေ့ကျင့်ခန်း အနေနဲ့) ပေါ်မှာ — unnecessary service (telnet, FTP) ကို disable, `ufw`/`iptables` firewall ကို default-deny + minimum-required-open ဖြစ်အောင် configure, SSH ကို password authentication အစား key-based authentication ဆီ ပြောင်း, root login ကို SSH ကနေ တိုက်ရိုက် disable စတဲ့ hardening step တွေကို တစ်ဆင့်ချင်း run ကြည့်ပါ.

အတူတူ ကြည့်မယ်

bash
# Hardening checklist commands (on your own lab VM)

# Disable unnecessary services
sudo systemctl disable telnet
sudo systemctl disable vsftpd  # if not needed

# Configure firewall: default deny, allow only SSH
sudo ufw default deny incoming
sudo ufw allow 22/tcp
sudo ufw enable

# Disable SSH root login (edit /etc/ssh/sshd_config)
# PermitRootLogin no
# PasswordAuthentication no  (after setting up key-based auth)
sudo systemctl restart sshd
You should see
$ sudo ufw status
Status: active
To                         Action      From
--                         ------      ----
22/tcp                     ALLOW       Anywhere

၅ မိနစ် စမ်းကြည့်

Lab VM တစ်ခုကို hardening checklist အတိုင်း ကိုယ်တိုင် hardening လုပ်ကြည့်ပါ — hardening မလုပ်ခင် vs ပြီးနောက် Nmap scan (Basic chapter) ကို ထပ်run ပြီး attack surface ကျဉ်းသွားတာကို compare ကြည့်ပါ။

သတိလေးတစ်ချက်

SSH hardening (root login disable, password auth disable) ကို production server ပေါ်မှာ လုပ်ခင် — key-based access ကို အရင်ဆုံး setup/test လုပ်ပြီးမှသာ password auth ကို disable လုပ်ပါ, မဟုတ်ရင် server ကို ကိုယ်တိုင် locked out ဖြစ်နိုင်ပါတယ်.

ဒီနေရာမှာ လူအများမှားတတ်တယ်

  • SSH ကို key-based authentication ဆီ ပြောင်းရာမှာ, key setup ပြီးအောင် မစစ်ဆေးဘဲ password authentication ကို disable လိုက်ခြင်း — server ကို locked out ဖြစ်နိုင်ပါတယ် (VM ဆိုရင် console access ရှိမှသာ ပြန်ဝင်နိုင်ပါလိမ့်မယ်)
  • Firewall default-deny ကို configure ရာမှာ, application ရဲ့ လိုအပ်တဲ့ port (ဥပမာ - web server အတွက် 80/443) ကို ဖွင့်ဖို့ မေ့ခြင်း — legitimate service ကို accidentally block ဖြစ်နိုင်ပါတယ်

အခု ကိုယ်တိုင် စမ်းကြည့်

Lab VM တစ်ခုကို hardening checklist အတိုင်း ကိုယ်တိုင် hardening လုပ်ကြည့်ပါ — hardening မလုပ်ခင် vs ပြီးနောက် Nmap scan (Basic chapter) ကို ထပ်run ပြီး attack surface ကျဉ်းသွားတာကို compare ကြည့်ပါ။

You'll know it worked when: $ sudo ufw status Status: active To Action From -- ------ ---- 22/tcp ALLOW Anywhere

Project — Linux Server Security Hardening | Thuta Learning