two-factor authentication သည် နှစ်လိုဖွယ်ကောင်းပြီး ပေါက်နေပါက၊ သို့သော် ဟာ့ဒ်ဝဲတိုကင်များအတွက် ပိုက်ဆံမရှိသဖြင့် ယေဘုယျအားဖြင့် စိတ်ကောင်းရှိနေရန် ကမ်းလှမ်းသည်ဆိုပါစို့။
ဤဖြေရှင်းချက်သည် အလွန်ကောင်းမွန်သော မူရင်းအရာမဟုတ်သော်လည်း အင်တာနက်ပေါ်တွင် တွေ့ရှိရသည့် မတူညီသောဖြေရှင်းနည်းများ ရောနှောထားသည်။
ဒါကြောင့် ပေးထားတာပါ။
Домен active Directory.
ယနေ့ခေတ်များစွာကဲ့သို့ပင် VPN မှတဆင့် အလုပ်လုပ်သော ဒိုမိန်းအသုံးပြုသူများ။
VPN တံခါးပေါက်အဖြစ် လုပ်ဆောင်သည်။ ခံတပ်.
VPN သုံးစွဲသူအတွက် စကားဝှက်ကို လုံခြုံရေးမူဝါဒအရ တားမြစ်ထားသည်။
နိုင်ငံရေး Fortinet သင့်ကိုယ်ပိုင်တိုကင်များနှင့်စပ်လျဉ်း၍ ၎င်းကို zhlob ထက်နည်းသည်ဟု ခေါ်ဆို၍မရပါ - အခမဲ့တိုကင် 10 ခုအထိရှိသည်၊ ကျန်သည် - အလွန်မဟုတ်သော kosher စျေးနှုန်းဖြင့်။ ကျွန်ုပ်သည် open source လိုချင်သောကြောင့် RSASecureID၊ Duo နှင့် အခြားအရာများကို မစဉ်းစားခဲ့ပါ။
ကြိုတင်လိုအပ်ချက်များ- အိမ်ရှင် * nix တည်ထောင်ထားသည်။ freeradius, ပြောလေ - ဒိုမိန်းထဲသို့ ဝင်လိုက်သည်၊ ဒိုမိန်းအသုံးပြုသူများသည် ၎င်းကို အလွယ်တကူ စစ်မှန်ကြောင်း အထောက်အထားပြနိုင်သည်။
အပိုပက်ကေ့ဂျ်များ- shellina သေတ္တာ, သင်္ဘောသဖန်းသီး, freeradius-ldap၊ဖောင့် rebel.tlf repository မှ
ကျွန်ုပ်၏ဥပမာတွင် - CentOS 7.8 ။
အလုပ်၏ယုတ္တိမှာ အောက်ပါအတိုင်းဖြစ်သင့်သည်- VPN သို့ချိတ်ဆက်သောအခါ၊ အသုံးပြုသူသည် စကားဝှက်အစား ဒိုမိန်းဝင်ရောက်မှုနှင့် OTP ကိုထည့်သွင်းရပါမည်။
ဝန်ဆောင်မှုများ စနစ်ထည့်သွင်းခြင်း။
В /etc/raddb/radiusd.conf အသုံးပြုသူနှင့် အဖွဲ့ကိုယ်စား စတင်သည်။ freeradiusဝန်ဆောင်မှုပေးကတည်းက အချင်းဝက် subdirectories အားလုံးတွင် ဖိုင်များကို ဖတ်နိုင်ရမည်။ / home /.
user = root
group = root
ဆက်တင်များတွင် အုပ်စုများကို သုံးနိုင်စေရန် ခံတပ်, ကူးစက်ရမယ်။ ရောင်းချသူ တိကျသော အရည်အချင်း. ဒီလိုလုပ်ဖို့၊ လမ်းညွှန်ထဲမှာ raddb/policy.d ကျွန်ုပ်သည် အောက်ပါ အကြောင်းအရာများဖြင့် ဖိုင်တစ်ခုကို ဖန်တီးသည်-
group_authorization {
if (&LDAP-Group[*] == "CN=vpn_admins,OU=vpn-groups,DC=domain,DC=local") {
update reply {
&Fortinet-Group-Name = "vpn_admins" }
update control {
&Auth-Type := PAM
&Reply-Message := "Welcome Admin"
}
}
else {
update reply {
&Reply-Message := "Not authorized for vpn"
}
reject
}
}
တပ်ဆင်ပြီးနောက် freeradius-ldap လမ်းညွှန်ထဲမှာ raddb/mods-ရရှိနိုင်သည်။ ဖိုင်ကိုဖန်တီးထားသည်။ ldap.
လမ်းညွှန်သို့ သင်္ကေတလင့်ခ်တစ်ခု ဖန်တီးရန် လိုအပ်သည်။ raddb/mods-enabled.
ln -s /etc/raddb/mods-available/ldap /etc/raddb/mods-enabled/ldap
ကျွန်ုပ်သည် ၎င်း၏ အကြောင်းအရာများကို ဤဖောင်သို့ ယူဆောင်လာပါသည်-
ldap {
server = 'domain.local'
identity = 'CN=freerad_user,OU=users,DC=domain,DC=local'
password = "SupeSecretP@ssword"
base_dn = 'dc=domain,dc=local'
sasl {
}
user {
base_dn = "${..base_dn}"
filter = "(sAMAccountname=%{%{Stripped-User-Name}:-%{User-Name}})"
sasl {
}
scope = 'sub'
}
group {
base_dn = "${..base_dn}"
filter = '(objectClass=Group)'
scope = 'sub'
name_attribute = cn
membership_filter = "(|(member=%{control:Ldap-UserDn})(memberUid=%{%{Stripped-User-Name}:-%{User-Name}}))"
membership_attribute = 'memberOf'
}
}
ဖို raddb/sites-enabled/default и raddb/sites-enabled/inner-tunnel အပိုင်း ခွင့်ပြုချက် ငါအသုံးပြုမည့်မူဝါဒ၏အမည်ကိုထည့်ပါ - group_authorization။ အရေးကြီးသောအချက် - မူဝါဒ၏အမည်ကို လမ်းညွှန်ရှိဖိုင်၏အမည်ဖြင့် မဆုံးဖြတ်ပါ။ မူဝါဒ။dဒါပေမယ့် ဖိုင်ထဲမှာရှိတဲ့ ညွှန်ကြားချက်တစ်ခုက curly braces တွေရှေ့မှာ။
အဝိဇ္ဇာ ခွင့်ပြုချက် တူညီသောဖိုင်များတွင် စာကြောင်းကို မှတ်ချက်မပေးလိုပါ။ Pam.
ဖိုင်ထဲမှာ clients.conf ချိတ်ဆက်မည့် ဘောင်များကို သတ်မှတ်ပါ။ ခံတပ်:
client fortigate {
ipaddr = 192.168.1.200
secret = testing123
require_message_authenticator = no
nas_type = other
}
Module ကိုထည့်သွင်းထားပါသည် pam.d/radiusd:
#%PAM-1.0
auth sufficient pam_google_authenticator.so
auth include password-auth
account required pam_nologin.so
account include password-auth
password include password-auth
session include password-auth
မူရင်းအစုအဝေး အကောင်အထည်ဖော်မှု ရွေးချယ်စရာများ freeradius с google Authenticator အသုံးပြုသူကို ဖော်မတ်တွင် အထောက်အထားများ ထည့်သွင်းရန် လိုအပ်သည်- အသုံးပြုသူစကားဝှက်+OTP.
ပုံသေအစုအဝေးကို အသုံးပြုရာတွင် ဦးခေါင်းပေါ်ကျမည့် ကျိန်စာအရေအတွက်ကို စိတ်ကူးကြည့်ခြင်းဖြင့်၊ freeradius с Google Authenticatormodule configuration ကိုအသုံးပြုရန်ဆုံးဖြတ်ခဲ့သည်။ Pam သို့မှသာ တိုကင်ကို စစ်ဆေးနိုင်မည်ဖြစ်သည်။ Google Authenticator.
အသုံးပြုသူတစ်ဦး ချိတ်ဆက်သောအခါတွင်၊ အောက်ပါအတိုင်း ဖြစ်သွားသည်-
- Freeradius သည် အသုံးပြုသူသည် ဒိုမိန်းတွင်ရှိပြီး အချို့သောအုပ်စုတွင်ရှိမရှိ စစ်ဆေးပြီး အောင်မြင်ပါက OTP တိုကင်ကို စစ်ဆေးသည်။
"အသုံးပြုသူ 300+ အတွက် OTP ကို ဘယ်လို စာရင်းသွင်းရမလဲ" လို့ တွေးလိုက်မိတဲ့ အထိ အရာအားလုံးက ကောင်းမွန်နေခဲ့ပါတယ်။
အသုံးပြုသူသည် ဆာဗာဖြင့် ဝင်ရောက်ရပါမည်။ freeradius သင့်အကောင့်အောက်မှ လျှောက်လွှာကို run ပါ။ Google စစ်မှန်ကြောင်းအထောက်အထားအသုံးပြုသူအတွက် အပလီကေးရှင်းအတွက် QR ကုဒ်တစ်ခုထုတ်ပေးပါမည်။ ဤနေရာတွင် အကူအညီ ဝင်လာသည်။ shellina သေတ္တာ နှင့်အတူ .bash_ ပရိုဖိုင်.
[root@freeradius ~]# yum install -y shellinabox
daemon configuration file မှာတည်ရှိပါတယ်။ /etc/sysconfig/shellinabox.
အဲဒီမှာ port 443 ကို ငါ သတ်မှတ်ပြီး မင်းရဲ့ လက်မှတ်ကို မင်း သတ်မှတ်နိုင်ပါတယ်။
[root@freeradius ~]#systemctl enable --now shellinaboxd
အသုံးပြုသူသည် လင့်ခ်ကို လိုက်နာရန်၊ ဒိုမိန်းခရက်ဒစ်များ ထည့်သွင်းရန်နှင့် အပလီကေးရှင်းအတွက် QR ကုဒ်ကို လက်ခံရန်သာ လိုအပ်သည်။
algorithm မှာအောက်ပါအတိုင်းဖြစ်သည်။
- အသုံးပြုသူသည် ဘရောက်ဆာမှတဆင့် စက်ထဲသို့ ဝင်ရောက်သည်။
- ဒိုမိန်းအသုံးပြုသူ ဟုတ်မဟုတ် စစ်ဆေးပါ။ မဟုတ်ရင် အရေးယူတာ မရှိဘူး။
- အသုံးပြုသူသည် ဒိုမိန်းအသုံးပြုသူဖြစ်ပါက၊ စီမံခန့်ခွဲသူများအဖွဲ့တွင် အဖွဲ့ဝင်ခြင်းကို စစ်ဆေးမည်ဖြစ်သည်။
- စီမံခန့်ခွဲသူမဟုတ်ပါက၊ ၎င်းသည် Google Authenticator ကို configure လုပ်ထားခြင်းရှိမရှိ စစ်ဆေးပေးပါသည်။ မဟုတ်ပါက QR ကုဒ်နှင့် အသုံးပြုသူ အကောင့်ထွက်ခြင်းကို ထုတ်ပေးပါသည်။
- စီမံခန့်ခွဲသူမဟုတ်ပါက Google Authenticator ကို စီစဉ်သတ်မှတ်ထားပါက၊ ထွက်လိုက်ရုံပါပဲ။
- စီမံခန့်ခွဲသူဖြစ်ပါက Google Authenticator ကို ထပ်မံစစ်ဆေးပါ။ မသတ်မှတ်ပါက၊ QR ကုဒ်တစ်ခုထုတ်ပေးသည်။
ယုတ္တိဗေဒအားလုံးကို အသုံးပြုပြီး လုပ်ဆောင်သည်။ /etc/skel/.bash_profile.
ကြောင် /etc/skel/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
# Make several commands available from user shell
if [[ -z $(id $USER | grep "admins") || -z $(cat /etc/passwd | grep $USER) ]]
then
[[ ! -d $HOME/bin ]] && mkdir $HOME/bin
[[ ! -f $HOME/bin/id ]] && ln -s /usr/bin/id $HOME/bin/id
[[ ! -f $HOME/bin/google-auth ]] && ln -s /usr/bin/google-authenticator $HOME/bin/google-auth
[[ ! -f $HOME/bin/grep ]] && ln -s /usr/bin/grep $HOME/bin/grep
[[ ! -f $HOME/bin/figlet ]] && ln -s /usr/bin/figlet $HOME/bin/figlet
[[ ! -f $HOME/bin/rebel.tlf ]] && ln -s /usr/share/figlet/rebel.tlf $HOME/bin/rebel.tlf
[[ ! -f $HOME/bin/sleep ]] && ln -s /usr/bin/sleep $HOME/bin/sleep
# Set PATH env to <home user directory>/bin
PATH=$HOME/bin
export PATH
else
PATH=PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
fi
if [[ -n $(id $USER | grep "domain users") ]]
then
if [[ ! -e $HOME/.google_authenticator ]]
then
if [[ -n $(id $USER | grep "admins") ]]
then
figlet -t -f $HOME/bin/rebel.tlf "Welcome to Company GAuth setup portal"
sleep 1.5
echo "Please, run any of these software on your device, where you would like to setup OTP:
Google Autheticator:
AppStore - https://apps.apple.com/us/app/google-authenticator/id388497605
Play Market - https://play.google.com/stor/apps/details?id=com.google.android.apps.authenticator2&hl=en
FreeOTP:
AppStore - https://apps.apple.com/us/app/freeotp-authenticator/id872559395
Play Market - https://play.google.com/store/apps/details?id=org.fedorahosted.freeotp&hl=en
And prepare to scan QR code.
"
sleep 5
google-auth -f -t -w 3 -r 3 -R 30 -d -e 1
echo "Congratulations, now you can use an OTP token from application as a password connecting to VPN."
else
figlet -t -f $HOME/bin/rebel.tlf "Welcome to Company GAuth setup portal"
sleep 1.5
echo "Please, run any of these software on your device, where you would like to setup OTP:
Google Autheticator:
AppStore - https://apps.apple.com/us/app/google-authenticator/id388497605
Play Market - https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2&hl=en
FreeOTP:
AppStore - https://apps.apple.com/us/app/freeotp-authenticator/id872559395
Play Market - https://play.google.com/store/apps/details?id=org.fedorahosted.freeotp&hl=en
And prepare to scan QR code.
"
sleep 5
google-auth -f -t -w 3 -r 3 -R 30 -d -e 1
echo "Congratulations, now you can use an OTP token from application as a password to VPN."
logout
fi
else
echo "You have already setup a Google Authenticator"
if [[ -z $(id $USER | grep "admins") ]]
then
logout
fi
fi
else
echo "You don't need to set up a Google Authenticator"
fi
Fortigate စနစ်ထည့်သွင်းမှု-
- ငါတို့ဖန်တီးတယ်။ အချင်းဝက်မျဉ်း- ဆာဗာ
- လိုအပ်ပါက လိုအပ်ပါက အုပ်စုများအလိုက် ဝင်ရောက်ထိန်းချုပ်နိုင်ရန် ကျွန်ုပ်တို့ ဖန်တီးပါသည်။ အဖွဲ့အမည်ကို ဖွင့်ထားသည်။ ခံတပ် ဝင်ခွင့်အုပ်စုနှင့် ကိုက်ညီရမည်။ ရောင်းချသူ တိကျသော အရည်အချင်း Fortinet-Group-အမည်.
- လိုအပ်သည်များကို တည်းဖြတ်ခြင်း။ SSL ကို-ပေါ်တယ်။
- မူဝါဒများတွင် အုပ်စုများထည့်ခြင်း။
ဤဖြေရှင်းချက်၏အားသာချက်များ:
- OTP ဖြင့် စစ်မှန်ကြောင်းအထောက်အထားပြရန် ဖြစ်နိုင်သည်။ ခံတပ် open source ဖြေရှင်းချက်။
- VPN မှတစ်ဆင့် ချိတ်ဆက်ရာတွင် အသုံးပြုသူသည် ချိတ်ဆက်မှုလုပ်ငန်းစဉ်ကို အနည်းငယ်ရိုးရှင်းစေမည့် ဒိုမိန်းစကားဝှက်ကို မထည့်ပါ။ လုံခြုံရေးမူဝါဒက ပေးထားသည့် ဂဏန်း 6 လုံး စကားဝှက်သည် ထည့်ရန် ပိုမိုလွယ်ကူသည်။ ရလဒ်အနေဖြင့်၊ အကြောင်းအရာပါရှိသော လက်မှတ်အရေအတွက်- "ကျွန်ုပ် VPN ကို ချိတ်ဆက်၍မရပါ" လျော့နည်းသွားပါသည်။
PS ကျွန်ုပ်တို့သည် စိန်ခေါ်မှု-တုံ့ပြန်မှုဖြင့် ပြည့်စုံသော two-factor authentication သို့ ဤဖြေရှင်းချက်ကို အဆင့်မြှင့်ရန် စီစဉ်ထားပါသည်။
အပ်ဒိတ်:
ကတိပြုထားသည့်အတိုင်း၊ ၎င်းကို စိန်ခေါ်မှု-တုံ့ပြန်မှု ရွေးချယ်မှုသို့ ပြောင်းလဲခဲ့သည်။
ဒီတော့:
ဖိုင်ထဲမှာ /etc/raddb/sites-enabled/default အပိုင်း ခွင့်ပြုချက် အောက်မှာဖေါ်ပြတဲ့အတိုင်းဒါဟာဖြစ်ပါသည်:
authorize {
filter_username
preprocess
auth_log
chap
mschap
suffix
eap {
ok = return
}
files
-sql
#-ldap
expiration
logintime
if (!State) {
if (&User-Password) {
# If !State and User-Password (PAP), then force LDAP:
update control {
Ldap-UserDN := "%{User-Name}"
Auth-Type := LDAP
}
}
else {
reject
}
}
else {
# If State, then proxy request:
group_authorization
}
pap
}
အပိုင်း ခွင့်ပြုချက် ယခုဤပုံသည်-
authenticate {
Auth-Type PAP {
pap
}
Auth-Type CHAP {
chap
}
Auth-Type MS-CHAP {
mschap
}
mschap
digest
# Attempt authentication with a direct LDAP bind:
Auth-Type LDAP {
ldap
if (ok) {
update reply {
# Create a random State attribute:
State := "%{randstr:aaaaaaaaaaaaaaaa}"
Reply-Message := "Please enter OTP"
}
# Return Access-Challenge:
challenge
}
}
pam
eap
}
ယခုတွင် အသုံးပြုသူ အတည်ပြုခြင်းမှာ အောက်ပါ algorithm အရ ဖြစ်ပေါ်သည် ။
- အသုံးပြုသူသည် VPN ကလိုင်းယင့်တွင် ဒိုမိန်းခရက်ဒစ်များကို ထည့်သွင်းသည်။
- Freeradius သည် အကောင့်နှင့် စကားဝှက်၏ တရားဝင်မှုကို စစ်ဆေးသည်။
- စကားဝှက်မှန်ကန်ပါက၊ တိုကင်တစ်ခုတောင်းဆိုမှုကို ပေးပို့မည်ဖြစ်သည်။
- တိုကင်ကို စစ်ဆေးအတည်ပြုနေပါသည်။
- အမြတ်အစွန်း)။
source: www.habr.com