Page cover

TACACS+ နဲ့ Windows AD ကိုတွဲပြီး အသုံးပြုနည်း – အပိုင်း (၂)

အရှေ့ post မှာ TACACS+ server ကို standalone setup ဘယ်လို လုပ်သလဲဆိုတာကို ရှင်းပြပြီးသွားပါပြီ။ အခြေခံအားဖြင့် authentication အတွက် Ubuntu 18.04 LTS local user login database ဖြစ်တဲ့ /etc/passwd file ကို အသုံးပြုပြီးတော့၊ authorization အတွက်တော့ /etc/tacacs+/tac_plus.conf file ကိုအသုံးပြုထားတာပဲဖြစ်ပါတယ်။ configuration အကုန်လုံးက server ဘက်မှာပဲ ပြီးပါသေးတယ်။ Network devices တွေအတွက်တော့ ဘယ်လို configure လုပ်သလဲဆိုတာကို နောက်ဆုံးမှာ ရှင်းသွားပါ့မယ်။ devices config အတွက်တော့ TACACS+ standalone နဲ့ TACACS+ Windows AD မှာပါ အကုန်လုံးတူပါတယ်။ ဘာမှပြောင်းစရာမလိုပါဘူး။ အဲဒီအတွက် နောက်ဆုံးမှာ ရှင်းတာဖြစ်ပါတယ်၊။ ဒီအဆင့်မှာတော့ Ubuntu 18.04 box ဟာ Windows 2019 AD ကို join ပြီးဖြစ်ပါတယ်။ အခု domain joined Linux TACACS+ server ကို Windows AD နဲ့ ဘယ်လို integrate လုပ်သလဲဆိုတာကို ဆက်ရှင်းသွားပါ့မယ်။ Integration အပိုင်းမှာတော့ ပုံစံမျိုးစုံနဲ့ လုပ်လို့ရပါတယ်။ စာရေးသူ အခုရှင်းမယ့် ပုံစံကတော့ အနည်းငယ် လက်ဝင်ပေမယ့် အလုပ်ဖြစ်ပါတယ်။ နောက်ပြီးတော့ စာရေးသူသတိထားမိတာ တစ်ခုက Internet ပေါ်မှာ စာရေးသူ လုပ်ချင်တဲ့ ပုံစံမျိုး ရအောင်လို့ setup လုပ်ဖို့ရာ ပြီးပြည့်စုံတဲ့ tutorial မရှိပါဘူး။ ဟိုနည်းနည်းဖတ် ဒီနည်းနည်းရှာနဲ့ပဲ မရရအောင်လို့ ကြံဖန်ပြီးတော့ လုပ်ရပါတော့တယ်။ အဲ့ဒီအတွက် အလုံးစုံ ရိုးရှင်းတဲ့ integration process တော့ မဟုတ်ပါဘူး။ သို့သော် အလုပ်ဖြစ်ပြီးတော့ နားလည်ရလွယ်တဲ့ solution တစ်ခုပါ။ Linux မှာရနိုင်တဲ့ tools တွေကိုပဲ ကိုယ်လိုချင်တဲ့ပုံစံ ဖြစ်အောင် လုပ်ရတာဖြစ်တဲ့အတွက် စိတ်ဝင်စားဖို့တော့ကောင်းပါတယ်။ အကျဉ်းချုပ်အားဖြင့်တော့ Linux ရဲ့ PAM ရယ်၊ bash script တစ်ခုရယ်၊ crontab နဲ့ built-in Linux command သုံးလေးငါးခုလောက်ကို လှည့်ပြီးတော့ သုံးထားတာ လည်းဖြစ်တဲ့အတွက် ဘာမှထက်ပြီးတော့ ထွေထွေထူးထူး install လုပ်စရာ မရှိပါဘူး။ သို့သော် တစ်ခုချင်းစီရဲ့ အလုပ်လုပ်ဆောင်ပုံနဲ့ ဘယ်လိုမျိုး အသုံးပြုရတာလဲဆိုတော့ အနည်းငယ်သိဖို့တော့လိုပါလိမ့်မယ်။ စာရေးသူ တတ်နိုင်သလောက်တော့ တစ်ခုချင်းစီကို အကျဉ်းချုပ်ပြီးတော့ ရှင်းသွားပါ့မယ်။

Windows AD တွင် user group ကို setup လုပ်ပုံ

user group ၃ ခုဖြစ်တဲ့ enabler၊ temper၊ reader တို့ကို အောက်ကအတိုင်း Windows AD ရဲ့ domain controller ပေါ်မှာ PowerShell နဲ့ create လုပ်လိုက်ပါ။

# adding "enabler" security group to Windows AD domain
PS C:Userstyla.GNU> New-ADGroup -Name "enabler" -SamAccountName enabler -GroupCategory Security -GroupScope Global -DisplayName "enabler" -Path "CN=Users,DC=GNU,DC=NET" -Description "Privilege 15 admins"

# adding "reader" security group to Windows AD domain
PS C:Userstyla.GNU> New-ADGroup -Name "reader" -SamAccountName reader -GroupCategory Security -GroupScope Global -DisplayName "reader" -Path "CN=Users,DC=GNU,DC=NET" -Description "Restricted read-only users"

# adding "temper" security group to Windows AD domain
PS C:Userstyla.GNU> New-ADGroup -Name "temper" -SamAccountName temper -GroupCategory Security -GroupScope Global -DisplayName "temper" -Path "CN=Users,DC=GNU,DC=NET" -Description "Temporary Privilege 15 access to edge devices"

Windows AD မှာ domain user groups တွေကို create လုပ်ပြီးသွားတာနဲ့ ကိုယ်လိုချင်တဲ့ user account တွေကို အောက်ကအတိုင်း ဖန်းတီးပြီးတော့ ကိုယ်ကြိုက်တဲ့ group မှာထည့်လိုက်ပါ။

# Import Active Directory Module in PowerShell
PS C:Userstyla.GNU> Import-Module ActiveDirectory                             

# Add new AD user account
PS C:Userstyla.GNU> New-ADUser tyla.lin -UserPrincipalName [email protected]

# Set newly created AD user account's password
PS C:Userstyla.GNU> Set-ADAccountPassword -Identity tyla.lin                  
Please enter the current password for "CN=tyla.lin,CN=Users,DC=gnu,DC=net"    
Password:                                                                       
Please enter the desired password for "CN=tyla.lin,CN=Users,DC=gnu,DC=net"    
Password: ***********                                                           
Repeat Password: *********** 

# Enable the new AD user account
PS C:Userstyla.GNU> Enable-ADAccount -Identity tyla.lin                       

# Verify the new AD user account
PS C:Userstyla.GNU> Get-ADUser tyla.lin                                       

DistinguishedName : CN=tyla.lin,CN=Users,DC=gnu,DC=net                        
Enabled           : True                                                        
GivenName         :                                                             
Name              : tyla.lin                                                    
ObjectClass       : user                                                        
ObjectGUID        : fa260d1c-3de5-4939-b6b7-052ff5ce0e2f                        
SamAccountName    : tyla.lin                                                    
SID               : S-1-5-21-3725648376-1897747198-2438019021-1119              
Surname           :                                                             
UserPrincipalName : [email protected]    

# Add the newly created AD user account to enabler AD security users group
PS C:Userstyla.GNU> Add-ADGroupMember -Identity enabler -Member tyla.lin

# Verify the enabler group's membership
PS C:Userstyla.GNU> Get-ADGroupMember enabler                                 

distinguishedName : CN=tyla.lin,CN=Users,DC=gnu,DC=net                        
name              : tyla.lin                                                    
objectClass       : user                                                        
objectGUID        : fa260d1c-3de5-4939-b6b7-052ff5ce0e2f                        
SamAccountName    : tyla.lin                                                    
SID               : S-1-5-21-3725648376-1897747198-2438019021-1119

အခုဆိုရင်တော့ Windows AD မှာ သက်ဆိုင်ရာ AD group နဲ့ user တွေကိုပြင်ဆင်ပြီးသွားပါပြီ။ အောက်ကပုံမှာတော့ စာရေးသူရဲ့ network topology အကြမ်းဖြစ်ပါတယ်။

Windows AD ရဲ့ domain controller ပေါ်မှာ group နဲ့ user တွေလည်း ဖန်းတီးပြီးပြီ၊ TACACS+ တင်ထားတဲ့ Linux box ကိုလည်း အဲ့ဒီ GNU.NET ဆိုတဲ့ domain ကို join ပြီးသွားပြီဆိုရင် တော့၊ domain user နဲ့ group တွေကို Linux ကနေ မြင်ရ မမြင်ရဆိုတာကို တချက်တော့ verify လုပ်ရပါ့မယ်။ ဒီအဆင့်က အရေးကြီးပါတယ်။ Linux box ကနေ Windows AD ရဲ့ user နဲ့ group ကို မမြင်ရရင်တော့ နည်းနည်းပါးပါး troubleshoot လုပ်ရပါလိမ့်မယ်။ အားလုံးအဆင်ပြေရင်တော့မှ နောက်တဆင့်ကို ဆက်သွားပါ။

အထက်ကအတိုင်းတွေ့ရတယ်ဆိုရင်တော့ အားလုံးအဆင်ပြေပါပြီ။ နောက်တဆင့်မှာတော့ tac_plus.conf ကို local user database ဖြစ်တဲ့ /etc/passwd အစား PAM ကိုအသုံးပြုဖို့အတွက် အနည်းငယ် ပြင်ဆင်ဖို့လိုပါလိမ့်မယ်။

ဒီနေရာမှာ ဘာဖြစ်လို့ group သုံးခု ဖြစ်တဲ့ enabler၊ temper နဲ့ reader တို့ကိုတည်ဆောက်ပြီးတော့ configure လုပ်ရသလဲဆိုတာအနည်းငယ်ရှင်းဖို့လိုပါလိမ့်မယ်။ enabler ဆိုတဲ့ group ကိုတော့ network အတွင်းမှာ ကြိုက်တဲ့ core ရော access devices တိုင်းကို privilege 15 နဲ့ အကန့်အသတ် မရှိ ဝင်လို့ရဖို့လိုတဲ့ super users တွေအတွက်ရည်စူးပါတယ်။ reader ဆိုတဲ့ဟာကတော့ core ရော access devices တိုင်းကို privilege 15 နဲ့ သတ်မှတ်ထားတဲ့ commands တွေကိုပဲ run လို့ရအောင် authorization မှာလုပ်ထားတာဖြစ်ပါတယ်။ Troubleshoot လုပ်ဖို့လိုရင် လိုသလောက် ကိုယ်ကြိုက်တဲ့ commands တွေကို ထက်ပြီးတော့ထည့်လို့ရအောင် privilege 15 ပေးထားတာလည်း ဖြစ်ပါတယ်။ နောက်ဆုံးတစ်ခုကတော့ temper ဖြစ်တဲ့ group ဖြစ်ပြီး temporarily privilege 15 ကို access device တွေပေါ်မှာပဲ initial setup လုပ်တဲ့အခါအသုံးပြုလို့ရအောင်ရည်ရွယ်ပါတယ်။ စာရေးသူ အနေနဲ့ level 1 network support team က initial device setup လုပ်ဖို့လိုတယ်ဆိုရင် privilege 15 ကို access devices တွေကို ပေးဖို့အတွက် သီးသန့် တတိယ group ကို ဖန်းတီးထားတာလည်းဖြစ်ပါတယ်။ ဒီထက်ကောင်းအောင်တော့ authorization ကို implement လုပ်လို့ရပါတယ်။ အခုလက်ရှိမှာတော့ team ရဲ့ လိုအပ်ချက်တွေအပေါ်မှာ မူတည်ပြီးတော့ လက်ရှိ staging မှာ အခုလို setup လုပ်ထားတာဖြစ်ပါတယ်။

အခုဆိုရင် စာရေးသူတို့ လက်ရှိ tac_plus.conf ကိုအခြေခံပြီးတော့ template တစ်ခုတည်ဆောက်ပါ့မယ်။ ဒီ template ဟာ tac_plus.conf ရဲ့ မပြောင်းတဲ့ အပိုင်းတွေကိုရွေးယူပြီးတော့ ထက်ထည့်လာမယ့် အစိတ်အပိုင်းတွေနဲ့ ပေါင်းသွားမှာပါ။ နောက်အဆင့်မှာ ဘာဖြစ်လို့ template လိုသလဲဆိုတာကိုတွေ့ပါလိမ့်မယ်။ tac_plus_template.conf ကို /etc/tacacs+ ရဲ့အောက်မှာ ဖန်းတီးရမှာဖြစ်ပါတယ်။ နောက်တခု သတိထားရမှာက ဒီ template ကိုသုံးမယ်ဆိုရင် user ကိုသာ အထည့်အသွင်း ပြုလုပ်ဖို့အတွက်ဖြစ်ပြီး၊ group ကို တော့ enabler၊ temper နဲ့ reader ဆိုပြီး အသေထားဖို့အတွက် ရည်ရွယ်ပါတယ်။ Group အပြောင်းအလဲ အတွက်ပါ လိုမယ်ဆိုရင်တော့ automate လုပ်မယ့် bash script ကို အနည်းငယ်ပြင်ဆင်ရပါလိမ့်မယ်။

နောက်တဆင့်အနေနဲ့ စာရေးသူ bash script တစ်ခုကို အောက်က အတိုင်း bash shell မှာရှိတဲ့ tools တွေပဲယူသုံးပြီးတော့ Windows AD domain controller ရဲ့ group နဲ့ user တွေကို လိုအပ်သလို အချက်အလက်တွေကို ရယူပါတယ်။ file နာမည်ကိုတော့ sync_users.sh ဆိုပြီးတော့ /opt အောက်မှာ သွားပြီးတော့ ဖန်တီးတည်ဆောက်ထားပါတယ်။

Script တော့ရပြီ၊ သို့သော် အဲ့ဒီ script ကို automate လုပ်ဖို့ဆိုရင် crontab ကို အသုံးပြုဖို့လိုပါလိမ့်မယ်။ အောက်မှာတော့ crontab ကိုဘယ်လိုတည်ဆောက်သလဲဆိုတာကို ဖော်ပြထားပါတယ်။ စာရေးသူ ငါးမိနစ်တစ်ခါ cron ကို အဲ့ဒီ script သွားပြီးတော့ run ခိုင်းပါတယ်။ အဲ့ဒီတော့ ငါးမိနစ်တခါတော့ Windows AD နဲ့ user account နဲ့ group membership ကို sync သွားဖြစ်နေမှာပါ။

ဒါဆိုရင်တော့ server ဘက်မှာလုပ်စရာရှိတာ အကုန်လုပ်ပြီးသွားပါပြီ။ network device တွေပေါ်မှာ ဘယ်လိုမျိုး AAA ကို configure လုပ်သလဲဆိုတာကို ဆက်ပြီးတော့အောက်မှာရှင်းပါ့မယ်။ စာရေးသူ အတွက်တော့ အဓိကအားဖြင့် vendor သုံးခုသော network devices တွေကို manage လုပ်ရပါတယ်။ Cisco၊ Huawei နဲ့ HPE procurve တွေအတွက်လိုအပ်တဲ့ AAA configuration တွေကကို အောက်မှာ ဖော်ပြပေးထားပါတယ်။ မိမိတို့ production environment မှာ AAA configuration ကို အသုံးမပြုခင်မှာ staging မှာသေချာ စမ်းသပ်ပြီး ကိုယ်တိုင်သေချာပြီဆိုတော့မှ production မှာ rollout လုပ်ပါ။ Networking devices တွေမှာ TACACS+ နဲ့ RADIUS အတွက် integration လုပ်ဖို့လိုတဲ့ AAA statements တွေဟာ နှစ်ဘက်ခွန်ဓားသွား နဲ့တူပါတယ်။ သတိအထူးပြုပါရန် စာရေးသူ ဒီနေရာမှာ အသိပေးချင်ပါတယ်။

Cisco router နဲ့ switch တွေအတွက်တော့ အောက်က AAA configuration ကို အသုံးပြုရပါ့မယ်။

Huawei router နဲ့ switch တွေအတွက်တော့ အောက်က AAA configuration တွေကို ထည့်သွင်းရပါလိမ့်မယ်။

HPE procurve ဆိုရင်တော့ အောက်ကအတိုင်း configure လုပ်ရပါ့မယ်။

ဒါဆိုရင် အားလုံး အဆင်သင့်ဖြစ်ပါပြီ။ TACACS+ နဲ့ Windows AD တို့ရဲ့ integration process ပြီးပါပြီ။ Standalone TACACS+ မှာပဲ ဖြစ်ဖြစ်၊ TACACS+ Windows AD integration မှာပဲဖြစ်ဖြစ် network devices တွေဘက်မှာတော့ အားလုံးအတူတူပါပဲ။ အားလုံးပဲ အလွယ်တကူ setup လုပ်နိုင်မယ်လို့ မျှော်လင့်ပါတယ်။

Last updated

Was this helpful?