Wednesday 7 December 2016

Dynamic ACL

Lock and Key ခေါ် Dynamic ACL လို့ခေါ်တဲ့ ACL နောက်တမျိုးကိုထပ်ကြည့်ကြတာပေါ့။ လုပ်ငန်းခွင်အနေနဲ့တော့ သိပ်ပြီးအသုံးပြုလေ့မရှိပါဘူး၊ ဒါပေမယ့် အရေးကြုံလို့လိုအပ်လာတဲ့အချိန်၊ စာမေးပွဲဖြေတဲ့ အချိန်တွေမှာ သုံးတတ်အောင်လို့တော့ သိထားသင့်ပါတယ်။ အသုံးမပြုကြဘူးဆိုတာက သူ့ရဲ့ လုပ်ဆောင်ပုံဟာ VPN အသုံးပြုပုံနဲ့သွားတူနေတာကြောင့်လည်းဖြစ်ပါတယ်။ VPN အထိ အသုံးပြု ရအောင် လည်း မရပါဘူး။ VPN သုံးတဲ့အခါမှာ Mobile users VPN အနေနဲ့Client သုံးပြီး VPN Login ဝင်၊ ပြီးရင် အတွင်းက Network/ Resource ကိုအသုံးပြုရသလိုမျိုး၊ ACL ကိုဖွင့်ပေးဖို့အတွက် Authentication အရင်လုပ်၊ Login ရပြီးမှ ACL ကို Dynamic ဖွင့်ပေးပြီး အတွင်းက Network/ Resource ကိုအသုံးပြု ခွင့်ပေးတာမျိုးပါ။

Dynamic ACL ကို လက်ရှိအသုံးပြုနေတဲ့ Extended ACL နဲ့ တွဲသုံးပြီး ကိုယ်ဖွင့်ပေးချင်တဲ့ Protocol/ Destination ကိုခွင့်ပြုထားရပါတယ်၊ ဒါပေမဲ့ အဲ့ဒီ Dynamic Entry ဟာ Authentication/ Login ဝင်လို့ရတဲ့ Source အတွက်သာ ယာယီဖွင့်ပေးပါတယ်။ သူရဲ့သတ်မှတ်တဲ့ အချိန် Timeout ဖြစ်သွားရင် သူ့အလိုလို ပြန်ပိတ်သွားပါတယ်။ ထပ်သုံးချင်ရင်တော့ Login ထပ်ဝင်ရပါတယ်။ Show run configuration အနေနဲ့ ကြည့်ရင် အသေးစိတ်မမြင်ရပဲ၊ Dynamic ACL active ဖြစ်နေတဲ့ အချိန်မှသာ ဘာကိုဖွင့်ထားတယ်ဆိုတာကို Show access-list ကနေကြည့်လို့ရပါတယ်။ Dynamic ACL တစ်ကြောင်းသာ Extended ACL အောက်မှာ ရေးလို့ရတဲ့ အတွက် များသောအားဖြင့် General အနေနဲ့သာ ရေးလေ့ရှိပါတယ်။ ဥပမာ permit IP any any ဆိုတာမျိုး။ Permit any ဆိုပေမဲ့ Authentication ထပ်ခံထားတဲ့အတွက် ကြောက်စရာမလိုပါဘူး။ ဒီနေရာမှာ အရေးကြီးတာက Timeout ပါ။ Absolute Timeout နဲ့ idle timeout ဆိုပြီးရှိပါတယ်။ Timeout မရှိရင် တခါဝင်ထားတဲ့ Login user ဟာအမြဲတမ်း ဝင်ခွင့်ရနေပြီး လုံခြုံရေးအရ ACL ရဲ့ အနှစ်သာရကို ပျက်ဆီး စေပါတယ်။

အသုံးပြုတဲ့ နမူနာနဲ့ တွဲမကြည့်ရင် သိပ်မရှင်းပဲ နားလည်ရခက်နိုင်ပါတယ်။ ဥပမာ တစ်ခုနဲ့ကြည့်ရအောင်။ ကိုယ်အတွင်းမှာရှိတဲ့ Server/ Application တစ်ခုကို တခြား Network ကနေ ယာယီအသုံးပြုဖို့ တောင်းဆိုလာတယ်ဆိုပါတော့။ အသုံးပြုချင်တဲ့ သူရဲ့ Source IP က အတိအကျမသိရဘူး။ DHCP ကနေချပေးတဲ့ IP ဆိုတော့ ဒီနေ့ တမျိုး၊ နောက်တနေ့ တမျိုးဖြစ်နေတယ်။ Subnet တစ်ခုလုံး ဖွင့်ပေးဖို့ ကြတော့လဲ သိပ်အဆင်မပြေပြန်ဘူး၊ သုံးမည့်သူက တစ်ယောက်တည်း။ VPN ပေးသုံးဖို့ကလည်း Firewall နဲ့ VPN Gateway ကမရှိ။ ရှိရင်လည်း သူအတွက် ယာယီ အသုံးပြုဖို့အတွက် AD မှာ User ထည့်ဖို့၊ Token ပေးဖို့အတွက်ကလည်း Resource တွေသုံးရမှာ သိပ်မတန် ဖြစ်နေတယ်။ ဒီလိုအခြေနေမျိုးမှာ Border router ရဲ့ အဝင်မှာ သုံးထားတဲ့ Extended ACL မှာ Dynamic ACL ဝင်ထည့်ပြီး Local user တစ်ခုဝင်ရေးပြီး ပေးလိုက်တာက အမြန်ဆုံးနဲ့ အဆင်ပြေဆုံးဖြစ်ပါလိမ်မယ်။ Local user တင်မကပဲ Authentication server တွေဖြစ်တဲ့ TACACS+ တို့နဲ့လည်း သုံးလို့ရပါတယ်။ ဒါပေမဲ့ အပေါ်မှာ ပြောခဲ့သလိုပဲ Timeout ကတော့ အရေးကြီးပါတယ်။ အဲဒါမပါရင် ကိုယ့် Network ကိုလာဖို့Tunnel ဖောက်ပေးလိုက်သလိုဖြစ်သွားပါလိမ့်မယ်။

Configuration နဲ့တွဲကြည့်လိုက်ပြီး Lab တစ်ခုလောက်လုပ်လိုက်ရင်တော့ ပိုပြီး နားလည်သွားပါလိမ့်မယ်။ Cisco ရဲ့ Config ကို ဆက်လေ့လာကြည့်ပါ။

Lock-and-Key with Local Authentication Example

This example shows how to configure lock-and-key access, with authentication occurring locally at the router. Lock-and-key is configured on the Ethernet 0 interface.

username user-name password password

interface ethernet0
 ip address 172.18.23.9 255.255.255.0
 ip access-group 101 in

access-list 101 permit tcp any host 172.18.21.2 eq telnet
access-list 101 dynamic mytestlist timeout 120 permit ip any any

line vty 0
login local
autocommand access-enable timeout 5

The first access-list entry allows only Telnet into the router. The second access-list entry is always ignored until lock-and-key is triggered.
In the access-list command, the timeout is the absolute timeout. In this example, the lifetime of the mytestlist ACL is 120 minutes; that is, when a user logs in and enable the access-enable command, a dynamic ACL is created for 120 minutes (the maximum absolute time). The session is closed after 120 minutes, whether or not anyone is using it.
In the autocommand command, the timeout is the idle timeout. In this example, each time the user logs in or authenticates there is a 5-minute session. If there is no activity, the session closes in 5 minutes and the user has to reauthenticate. If the user uses the connection, the absolute time takes affect and the session closes in 120 minutes.
After a user opens a Telnet session into the router, the router will attempt to authenticate the user. If authentication is successful, the autocommand executes and the Telnet session terminates. The autocommand creates a temporary inbound access list entry at the Ethernet 0 interface, based on the second access-list entry (mytestlist). This temporary entry will expire after 5 minutes, as specified by the timeout.


ကိုဖြိုး

No comments:

Post a Comment