ባለ ሁለት ደረጃ ማረጋገጥ ከፈለጉ እና ቢያቅማሙ ምን ማድረግ ይጠበቅብዎታል ነገር ግን ለሃርድዌር ቶከኖች ምንም ገንዘብ የለም እና በአጠቃላይ ጥሩ ስሜትን እንዲይዙ ይጠቁማሉ።
ይህ መፍትሔ እጅግ በጣም የመጀመሪያ የሆነ ነገር አይደለም, ይልቁንም በበይነመረቡ ላይ የተገኙ የተለያዩ መፍትሄዎች ድብልቅ ነው.
ስለዚህ ተሰጥቷል
Домен የ Active Directory.
በቪፒኤን የሚሰሩ የጎራ ተጠቃሚዎች ልክ እንደ ዛሬው ሁሉ።
ቪፒኤን እንደ መግቢያ በር ሆኖ ያገለግላል ተከራካሪ.
የይለፍ ቃሉን ለቪፒኤን ደንበኛ ማስቀመጥ በደህንነት ፖሊሲ የተከለከለ ነው።
ፖለቲካ Fortinet ከራሱ ምልክቶች ጋር በተያያዘ ከቀይ አንገት በታች ብለው ሊጠሩት አይችሉም - እስከ 10 የሚደርሱ ነፃ ቶከኖች አሉ ፣ የተቀሩት ደግሞ በጣም በኮሸር ያልሆነ ዋጋ ነው። ክፍት ምንጭ ስለምፈልግ RSASEcureID፣ Duo እና የመሳሰሉትን አላጤንኩም ነበር።
ቅድመ ሁኔታዎች፡- አስተናጋጅ * nix ከተጫነ ጋር ፍሪራዲየስ, ኤስ - ወደ ጎራው ገብቷል፣ የጎራ ተጠቃሚዎች በእሱ ላይ በቀላሉ ማረጋገጥ ይችላሉ።
ተጨማሪ ጥቅሎች፡- shellinabox, የበለስ, freeradius-ldap፣ ቅርጸ-ቁምፊ አመጸኛ.tlf ከማከማቻው
በእኔ ምሳሌ CentOS 7.8.
የስርዓተ ክወናው አመክንዮ እንደሚከተለው ነው፡ ከቪፒኤን ጋር ሲገናኙ ተጠቃሚው በይለፍ ቃል ፈንታ የጎራ መግቢያ እና OTP ማስገባት አለበት።
አገልግሎቶችን ማዋቀር
В /ወዘተ/raddb/radiusd.conf በስሙ የጀመረው ተጠቃሚ እና ቡድን ብቻ ይቀየራል። ፍሪራዲየስ, ከአገልግሎቱ ጀምሮ ራዲየስ በሁሉም ንዑስ ማውጫዎች ውስጥ ፋይሎችን ማንበብ መቻል አለበት። / 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
}
}
ከተጫነ በኋላ ፍሪራዲየስ-ldap በማውጫው ውስጥ raddb / mods-ይገኛል ፋይል ተፈጥሯል ldap.
ወደ ማውጫው ምሳሌያዊ አገናኝ መፍጠር ያስፈልግዎታል raddb/mods-የነቃ.
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/ጣቢያዎች-የነቁ/ነባሪ и raddb/ጣቢያዎች-የነቁ/ውስጥ-ዋሻ በክፍል ውስጥ ፈቀዳ ጥቅም ላይ የሚውለውን የመመሪያውን ስም እጨምራለሁ - የቡድን_ፍቃድ. አንድ አስፈላጊ ነጥብ - የፖሊሲው ስም በማውጫው ውስጥ ባለው ፋይል ስም አይወሰንም ፖሊሲ.ዲ, ነገር ግን በፋይሉ ውስጥ ያለው መመሪያ ከመጠምዘዣው ቅንፍ በፊት።
በክፍል ውስጥ ማረጋገጥ በተመሳሳዩ ፋይሎች ውስጥ መስመሩን መፍታት ያስፈልግዎታል ድካም.
በፋይል ውስጥ ደንበኞች.conf የሚገናኙበትን መለኪያዎች ይግለጹ ተከራካሪ:
client fortigate {
ipaddr = 192.168.1.200
secret = testing123
require_message_authenticator = no
nas_type = other
}
የሞዱል ውቅር 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
ጥቅሉን ለመተግበር ነባሪ አማራጮች ፍሪራዲየስ с የ google አረጋጋጭ ተጠቃሚው በሚከተለው ቅርጸት ምስክርነቶችን እንዲያስገባ ጠይቅ፡- የተጠቃሚ ስም የይለፍ ቃል+OTP.
ነባሪውን ኮፑላ ከተጠቀሙ በጭንቅላታችሁ ላይ የሚወድቁትን የእርግማን ብዛት አስቡ ፍሪራዲየስ с የ Google ማረጋገጫ አካል, የሞጁሉን ውቅረት ለመጠቀም ተወስኗል ድካም ማስመሰያው ብቻ እንዲረጋገጥ የ Google ማረጋገጫ አካል.
ተጠቃሚው ሲገናኝ የሚከተለው ይከሰታል።
- ፍሪራዲየስ ተጠቃሚው በጎራው ውስጥ እና በአንድ የተወሰነ ቡድን ውስጥ መሆኑን ያረጋግጣል እና ከተሳካ የኦቲፒ ቶከንን ይፈትሻል።
“ኦቲፒን ለ300+ ተጠቃሚዎች እንዴት መመዝገብ እችላለሁ?” ብዬ እስካስብ ድረስ ሁሉም ነገር የተሳካ መስሎ ነበር።
ተጠቃሚው ወደ አገልጋዩ መግባት አለበት። ፍሪራዲየስ እና ከመለያዎ እና መተግበሪያውን ያስጀምሩ ጎግል አረጋጋጭለመተግበሪያው ለተጠቃሚው የQR ኮድ ያመነጫል። ለማዳን የሚመጣው እዚህ ላይ ነው። shellinabox ጋር በማጣመር .ባሽ_መገለጫ.
[root@freeradius ~]# yum install -y shellinabox
የዴሞን ውቅር ፋይል የሚገኘው በ ውስጥ ነው። /etc/sysconfig/shellinabox.
እኔ ወደብ 443 እዛ እገልጻለሁ እና የምስክር ወረቀትዎን መግለጽ ይችላሉ.
[root@freeradius ~]#systemctl enable --now shellinaboxd
ተጠቃሚው አገናኙን ብቻ መከተል፣ የጎራ ምስክርነቶችን ማስገባት እና ለመተግበሪያው የQR ኮድ መቀበል ይችላል።
ስልተ ቀመር እንደሚከተለው ነው
- ተጠቃሚው በአሳሽ በኩል ወደ ማሽኑ ውስጥ ይገባል.
- ተጠቃሚው የጎራ ተጠቃሚ ስለመሆኑ ይጣራል። ካልሆነ ምንም እርምጃ አይወሰድም.
- ተጠቃሚው የጎራ ተጠቃሚ ከሆነ የአስተዳዳሪዎች ቡድን አባልነት ምልክት ይደረግበታል።
- አስተዳዳሪ ካልሆነ፣ Google አረጋጋጭ መዋቀሩን ያረጋግጣል። ካልሆነ፣ የQR ኮድ ይፈጠራል እና ተጠቃሚው ዘግቶ ይወጣል።
- አስተዳዳሪ ካልሆኑ እና ጎግል አረጋጋጭ ከተዋቀረ በቀላሉ ውጣ።
- አስተዳዳሪ ከሆኑ፣ ጉግል አረጋጋጭን እንደገና ያረጋግጡ። ካልተዋቀረ የQR ኮድ ይፈጠራል።
ሁሉም ሎጂክ የሚከናወነው በመጠቀም ነው። /ወዘተ/skel/.bash_profile.
ድመት /ወዘተ/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
የማጠናከሪያ ዝግጅት፡
- እኛ እንፈጥራለን ራዲዩስ- አገልጋይ
- በቡድን መድረስን ለመለየት አስፈላጊ ከሆነ አስፈላጊ የሆኑትን ቡድኖች እንፈጥራለን. የቡድን ስም በርቷል ተከራካሪ ከተላከው ቡድን ጋር መዛመድ አለበት። የአቅራቢ ልዩ ባህሪ Fortinet-ቡድን-ስም.
- አስፈላጊውን ማረም SSL- ፖርታል.
- ቡድኖችን ወደ ፖሊሲዎች ማከል።
የዚህ መፍትሔ ጥቅሞች:
- በOTP በኩል ማረጋገጥ ይቻላል። ተከራካሪ ክፍት ምንጭ መፍትሄ.
- ተጠቃሚው በቪፒኤን ሲገናኝ የጎራ ይለፍ ቃል ማስገባት የለበትም፣ ይህም የግንኙነት ሂደቱን በተወሰነ ደረጃ ቀላል ያደርገዋል። ባለ 6 አሃዝ የይለፍ ቃል በደህንነት ፖሊሲ ከቀረበው ለመግባት ቀላል ነው። በውጤቱም, ከርዕሰ-ጉዳዩ ጋር የቲኬቶች ብዛት: "ከቪፒኤን ጋር መገናኘት አልቻልኩም" እየቀነሰ ነው.
PS ይህንን መፍትሄ ከፈተና-ምላሽ ጋር ወደ ሙሉ ባለ ሁለት ደረጃ ማረጋገጫ ለማሻሻል እቅድ አለ።
ዝማኔ:
ቃል በገባሁት መሰረት፣ በፈታኝ ምላሽ ወደ ምርጫው አሻሽዬዋለሁ።
ስለዚህ:
በፋይል ውስጥ /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
}
አሁን ተጠቃሚው የሚከተለውን ስልተ ቀመር በመጠቀም ተረጋግጧል።
- ተጠቃሚው በቪፒኤን ደንበኛ ውስጥ የጎራ ምስክርነቶችን ያስገባል።
- ፍሪራዲየስ የመለያውን ትክክለኛነት እና የይለፍ ቃል ያረጋግጣል
- የይለፍ ቃሉ ትክክል ከሆነ የማስመሰያ ጥያቄ ይላካል።
- ማስመሰያው እየተረጋገጠ ነው።
- ትርፍ)።
ምንጭ: hab.com