logica de aprobacion ejecutandose, no se evalua siempre
This commit is contained in:
@@ -12,13 +12,21 @@ server default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
authorize {
|
authorize {
|
||||||
# Si es EAP (WPA-Enterprise), procesar EAP y salir para no interferir
|
# Si es EAP (WPA-Enterprise)
|
||||||
if (&EAP-Message) {
|
if (&EAP-Message) {
|
||||||
|
# Si el usuario está deshabilitado según SQL, rechazar antes de llamar a eap
|
||||||
|
if ("%{sql:SELECT COUNT(*) FROM radcheck WHERE username='%{User-Name}' AND attribute='Auth-Type' AND value='Reject'}" != "0") {
|
||||||
|
reject
|
||||||
|
}
|
||||||
eap
|
eap
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
# Cargar atributos desde SQL (VLAN/bw, etc.)
|
# Cargar atributos desde SQL (VLAN/bw, etc.)
|
||||||
sql
|
sql
|
||||||
|
# Si está deshabilitado en SQL, rechazar
|
||||||
|
if ("%{sql:SELECT COUNT(*) FROM radcheck WHERE username='%{User-Name}' AND attribute='Auth-Type' AND value='Reject'}" != "0") {
|
||||||
|
reject
|
||||||
|
}
|
||||||
# Laboratorio: aceptar todo en flujos no EAP
|
# Laboratorio: aceptar todo en flujos no EAP
|
||||||
update control {
|
update control {
|
||||||
Auth-Type := Accept
|
Auth-Type := Accept
|
||||||
@@ -28,6 +36,9 @@ server default {
|
|||||||
authenticate {
|
authenticate {
|
||||||
# EAP para WPA-Enterprise
|
# EAP para WPA-Enterprise
|
||||||
eap
|
eap
|
||||||
|
Auth-Type Reject {
|
||||||
|
reject
|
||||||
|
}
|
||||||
# Aceptar todo cuando control:Auth-Type := Accept (no EAP)
|
# Aceptar todo cuando control:Auth-Type := Accept (no EAP)
|
||||||
Auth-Type Accept {
|
Auth-Type Accept {
|
||||||
ok
|
ok
|
||||||
|
|||||||
@@ -8,6 +8,10 @@ server inner-tunnel {
|
|||||||
authorize {
|
authorize {
|
||||||
# Cargar credenciales/atributos del usuario desde SQL
|
# Cargar credenciales/atributos del usuario desde SQL
|
||||||
sql
|
sql
|
||||||
|
# Si está deshabilitado en SQL, rechazar antes de EAP
|
||||||
|
if ("%{sql:SELECT COUNT(*) FROM radcheck WHERE username='%{User-Name}' AND attribute='Auth-Type' AND value='Reject'}" != "0") {
|
||||||
|
reject
|
||||||
|
}
|
||||||
# En caso de que el módulo SQL no haya poblado Cleartext-Password, obténlo vía xlat
|
# En caso de que el módulo SQL no haya poblado Cleartext-Password, obténlo vía xlat
|
||||||
update control {
|
update control {
|
||||||
Cleartext-Password := "%{sql:SELECT value FROM radcheck WHERE username='%{User-Name}' AND attribute='Cleartext-Password' ORDER BY id DESC LIMIT 1}"
|
Cleartext-Password := "%{sql:SELECT value FROM radcheck WHERE username='%{User-Name}' AND attribute='Cleartext-Password' ORDER BY id DESC LIMIT 1}"
|
||||||
@@ -32,6 +36,9 @@ server inner-tunnel {
|
|||||||
Auth-Type MS-CHAP {
|
Auth-Type MS-CHAP {
|
||||||
mschap
|
mschap
|
||||||
}
|
}
|
||||||
|
Auth-Type Reject {
|
||||||
|
reject
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
post-auth {
|
post-auth {
|
||||||
|
|||||||
Reference in New Issue
Block a user