strutture:lnf:dr:calcolo:wireless:dot1x
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
strutture:lnf:dr:calcolo:wireless:dot1x [2017/01/31 14:20] – pistoni@infn.it | strutture:lnf:dr:calcolo:wireless:dot1x [2018/04/03 14:17] (current) – [Configurazione Radius per INFN-dot1x] pistoni@infn.it | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Configurazione Radius per INFN-dot1x ====== | ||
+ | |||
+ | Ai LNF e' stata implementata la rete wireless INFN-dot1x secondo le specifiche del progetto [[http:// | ||
+ | |||
+ | La soluzione tecnica prevede l' | ||
+ | |||
+ | |||
+ | ===== Radius Server ===== | ||
+ | |||
+ | Questo documento fornisce una guida per l' | ||
+ | |||
+ | * Installare l' | ||
+ | * Posizionarsi nella directory ove sono situati i file di configurazione (ad esempio: / | ||
+ | |||
+ | |||
+ | **radiusd.conf** | ||
+ | |||
+ | * Modificare {{: | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | impostare la variabile prefix (ove e' installato il s/w freeradius) | ||
+ | |||
+ | prefix = / | ||
+ | | ||
+ | definire l' | ||
+ | |||
+ | user = radiusd | ||
+ | group = radiusd | ||
+ | |||
+ | impostare opportunamente la sezione log: | ||
+ | |||
+ | log { | ||
+ | ... | ||
+ | | ||
+ | ... | ||
+ | | ||
+ | ... | ||
+ | } | ||
+ | |||
+ | ====== ====== | ||
+ | |||
+ | **eap.conf** | ||
+ | |||
+ | * Modificare {{: | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | eap { | ||
+ | | ||
+ | | ||
+ | ... | ||
+ | tls { | ||
+ | ... | ||
+ | certdir = ${confdir}/ | ||
+ | cadir = ${confdir}/ | ||
+ | ... | ||
+ | ## | ||
+ | ## Inserire i nomi dei files rispettivamente della chiave privata e del certificato x509 (rilasciato dalla CA INFN) | ||
+ | private_key_file = ${certdir}/ | ||
+ | certificate_file = ${certdir}/ | ||
+ | ... | ||
+ | ## inserire il file contenente tutti i certificati pubblici delle seguenti CA: INFN e TERENA | ||
+ | ## Attenzione!: | ||
+ | ## di COMODO (root CA) e UTN-USERFirst-Client-Authentication-and-Email (Intermediate CA) [Vedi file INFN-TERENA-CA.pem allegato] | ||
+ | CA_file = ${cadir}/ | ||
+ | ... | ||
+ | fragment_size = 1200 | ||
+ | check_cert_cn = %{User-Name} | ||
+ | ... | ||
+ | } | ||
+ | ... | ||
+ | ttls { | ||
+ | ... | ||
+ | ## | ||
+ | ... | ||
+ | copy_request_to_tunnel = yes | ||
+ | ... | ||
+ | use_tunneled_reply = yes | ||
+ | ... | ||
+ | virtual_server = " | ||
+ | ... | ||
+ | } | ||
+ | ... | ||
+ | peap { | ||
+ | ... | ||
+ | default_eap_type = mschapv2 | ||
+ | ... | ||
+ | copy_request_to_tunnel = yes | ||
+ | ... | ||
+ | use_tunneled_reply = yes | ||
+ | ... | ||
+ | virtual_server = " | ||
+ | ... | ||
+ | } | ||
+ | ... | ||
+ | } | ||
+ | |||
+ | Allegato: {{: | ||
+ | |||
+ | |||
+ | ====== ====== | ||
+ | |||
+ | **proxy.conf** | ||
+ | |||
+ | * Modificare {{: | ||
+ | |||
+ | ===== ===== | ||
+ | home_server localhost { | ||
+ | ... | ||
+ | secret = mysecret1 | ||
+ | ... | ||
+ | } | ||
+ | home_server radius.infn.it { | ||
+ | type = auth+acct | ||
+ | ipaddr = 193.206.190.118 | ||
+ | port = 1812 | ||
+ | secret = mysecret2 | ||
+ | require_message_authenticator = yes | ||
+ | response_window = 20 | ||
+ | zombie_period = 40 | ||
+ | revive_interval = 60 | ||
+ | status_check = status-server | ||
+ | check_interval = 30 | ||
+ | num_answers_to_alive = 3 | ||
+ | max_outstanding = 65536 | ||
+ | coa { | ||
+ | irt = 2 | ||
+ | mrt = 16 | ||
+ | mrc = 5 | ||
+ | mrd = 30 | ||
+ | } | ||
+ | } | ||
+ | home_server radius2.infn.it { | ||
+ | type = auth+acct | ||
+ | ipaddr = 193.206.144.38 | ||
+ | port = 1812 | ||
+ | secret = mysecret2 | ||
+ | require_message_authenticator = yes | ||
+ | response_window = 20 | ||
+ | zombie_period = 40 | ||
+ | revive_interval = 60 | ||
+ | status_check = status-server | ||
+ | check_interval = 30 | ||
+ | num_answers_to_alive = 3 | ||
+ | max_outstanding = 65536 | ||
+ | coa { | ||
+ | irt = 2 | ||
+ | mrt = 16 | ||
+ | mrc = 5 | ||
+ | mrd = 30 | ||
+ | } | ||
+ | } | ||
+ | home_server_pool radius-infn-pool { | ||
+ | type = load-balance | ||
+ | home_server = radius.infn.it | ||
+ | home_server = radius2.infn.it | ||
+ | } | ||
+ | ... | ||
+ | realm LOCAL { | ||
+ | # If we do not specify a server pool, the realm is LOCAL, and | ||
+ | # requests are not proxied to it. | ||
+ | } | ||
+ | ... | ||
+ | realm NULL { | ||
+ | authhost | ||
+ | accthost | ||
+ | nostrip | ||
+ | } | ||
+ | ... | ||
+ | realm lnf.infn.it { | ||
+ | authhost | ||
+ | accthost | ||
+ | strip | ||
+ | } | ||
+ | ... | ||
+ | realm " | ||
+ | pool = radius-infn-pool | ||
+ | nostrip | ||
+ | } | ||
+ | ... | ||
+ | realm DEFAULT { | ||
+ | authhost | ||
+ | accthost | ||
+ | nostrip | ||
+ | } | ||
+ | |||
+ | ====== ====== | ||
+ | |||
+ | **clients.conf** | ||
+ | |||
+ | * Modificare {{: | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | client localhost { | ||
+ | ... | ||
+ | secret = mysecret | ||
+ | ... | ||
+ | } | ||
+ | ... | ||
+ | # | ||
+ | # Definizione relativa al server stesso (radius.lnf.infn.it) | ||
+ | # | ||
+ | client radius.lnf.infn.it { | ||
+ | secret | ||
+ | shortname | ||
+ | nastype | ||
+ | } | ||
+ | # | ||
+ | # Definizione relativa al radius server di autenticazione dei LNF su rete wireless eduroam (edugw.lnf.infn.it) | ||
+ | # | ||
+ | client edugw.lnf.infn.it { | ||
+ | secret | ||
+ | shortname | ||
+ | nastype | ||
+ | } | ||
+ | # | ||
+ | # Definizione (eventuale) del server di monitoring (Nagios) | ||
+ | # | ||
+ | client 193.206.84.50 { | ||
+ | secret | ||
+ | shortname | ||
+ | nastype | ||
+ | } | ||
+ | # | ||
+ | # Proxy INFN (TRIP per SSID INFN-dot1x) | ||
+ | # | ||
+ | client radius.infn.it { | ||
+ | ipaddr = 193.206.190.118 | ||
+ | secret = mysecret2 | ||
+ | shortname = TRIP-INFN-dot1x-1 | ||
+ | nastype = other | ||
+ | } | ||
+ | client radius2.infn.it { | ||
+ | ipaddr = 193.206.144.38 | ||
+ | secret = mysecret2 | ||
+ | shortname = TRIP-INFN-dot1x-2 | ||
+ | nastype = other | ||
+ | } | ||
+ | # | ||
+ | # Definizione del server proxy del GARR (DEFAULT GARR) | ||
+ | # | ||
+ | #client 192.84.145.15 { | ||
+ | # secret | ||
+ | # shortname | ||
+ | # nastype | ||
+ | #} | ||
+ | # | ||
+ | # VPNBOX dei LNF | ||
+ | # | ||
+ | client 193.206.84.7 { | ||
+ | secret | ||
+ | shortname | ||
+ | nastype | ||
+ | } | ||
+ | # | ||
+ | # Captive Portal | ||
+ | # | ||
+ | client 193.205.228.106 { | ||
+ | secret | ||
+ | shortname | ||
+ | nastype | ||
+ | } | ||
+ | # | ||
+ | # Definizione del Wireless LAN Controller WLC4400 AP Ports IP | ||
+ | # | ||
+ | client 172.16.14.18 { | ||
+ | secret | ||
+ | shortname | ||
+ | nastype | ||
+ | } | ||
+ | client 172.16.14.19 { | ||
+ | secret | ||
+ | shortname | ||
+ | nastype | ||
+ | } | ||
+ | # | ||
+ | # Elenco degli aironet dei LNF ordinati per IP Address (o N. di edificio) | ||
+ | # | ||
+ | client 172.16.1.2 { | ||
+ | secret | ||
+ | shortname | ||
+ | nastype | ||
+ | } | ||
+ | ... | ||
+ | etc. | ||
+ | ... | ||
+ | | ||
+ | In alternativa alla definizione dell' | ||
+ | |||
+ | client 172.16.0.0/ | ||
+ | secret | ||
+ | shortname | ||
+ | nastype | ||
+ | } | ||
+ | | ||
+ | |||
+ | ====== ====== | ||
+ | |||
+ | **modules/ | ||
+ | |||
+ | * Al fine di specializzare i log, in modo che venga scritto anche il subject del certificato dell' | ||
+ | |||
+ | |||
+ | * Creare logger-accept in modo che contenga la stringa di log per le richieste di autenticazione EAP-TLS accettate; vedi esempio: | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | exec logger-accept { | ||
+ | wait = yes | ||
+ | #radiuspid = " | ||
+ | outlog = " | ||
+ | program = "/ | ||
+ | input_pairs = request | ||
+ | output_pairs = reply | ||
+ | # | ||
+ | shell_escape = yes | ||
+ | } | ||
+ | |||
+ | * Creare logger-reject in modo che contenga la stringa di log per le richieste di autenticazione EAP-TLS rifiutate; vedi esempio: | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | exec logger-reject { | ||
+ | wait = yes | ||
+ | #radiuspid = " | ||
+ | outlog = " | ||
+ | program = "/ | ||
+ | input_pairs = request | ||
+ | output_pairs = reply | ||
+ | # | ||
+ | shell_escape = yes | ||
+ | } | ||
+ | |||
+ | * Nota: non sono riuscito a far scrivere il pid del processo radiusd nel log, ma non e' molto importante. | ||
+ | |||
+ | |||
+ | ====== ====== | ||
+ | |||
+ | **sites-enabled/ | ||
+ | |||
+ | * Modificare {{: | ||
+ | |||
+ | ===== ===== | ||
+ | ... | ||
+ | authorize { | ||
+ | ... | ||
+ | preprocess | ||
+ | ... | ||
+ | chap | ||
+ | ... | ||
+ | mschap | ||
+ | ... | ||
+ | suffix | ||
+ | ... | ||
+ | eap { | ||
+ | ok = return | ||
+ | } | ||
+ | ... | ||
+ | files | ||
+ | ... | ||
+ | expiration | ||
+ | logintime | ||
+ | ... | ||
+ | pap | ||
+ | ... | ||
+ | } | ||
+ | ... | ||
+ | Authenticate { | ||
+ | ... | ||
+ | Auth-Type PAP { | ||
+ | pap | ||
+ | } | ||
+ | ... | ||
+ | Auth-Type CHAP { | ||
+ | chap | ||
+ | } | ||
+ | ... | ||
+ | Auth-Type MS-CHAP { | ||
+ | mschap | ||
+ | } | ||
+ | ... | ||
+ | Auth-Type Kerberos { | ||
+ | krb5 | ||
+ | } | ||
+ | ... | ||
+ | ntlm_auth | ||
+ | ... | ||
+ | eap | ||
+ | ... | ||
+ | } | ||
+ | |||
+ | |||
+ | * e inserire i controlli sul certificato dell' | ||
+ | |||
+ | ... | ||
+ | post-auth { | ||
+ | ... | ||
+ | # | ||
+ | # Reply-Message += " | ||
+ | # Reply-Message += " | ||
+ | # Reply-Message += " | ||
+ | # Reply-Message += " | ||
+ | # Reply-Message += " | ||
+ | # | ||
+ | # Reply-Message += " | ||
+ | # Reply-Message += " | ||
+ | # Reply-Message += " | ||
+ | # Reply-Message += " | ||
+ | # Reply-Message += " | ||
+ | # } | ||
+ | ... | ||
+ | ### if ( TLS-Client-Cert-Subject !~ /^$/ ) { | ||
+ | ### if ( TLS-Client-Cert-Issuer != "/ | ||
+ | ### logger-reject | ||
+ | ### reject | ||
+ | ### } | ||
+ | ### if ( TLS-Client-Cert-Subject !~ / | ||
+ | ### logger-reject | ||
+ | ### reject | ||
+ | ### } | ||
+ | ### else { | ||
+ | ### logger-accept | ||
+ | ### } | ||
+ | ### } | ||
+ | ### | ||
+ | if ( TLS-Client-Cert-Subject !~ /^$/ ) { | ||
+ | if ( TLS-Client-Cert-Issuer != "/ | ||
+ | logger-reject | ||
+ | reject | ||
+ | } | ||
+ | if ( TLS-Client-Cert-Subject !~ / | ||
+ | logger-reject | ||
+ | reject | ||
+ | } | ||
+ | else { | ||
+ | logger-accept | ||
+ | } | ||
+ | } | ||
+ | ... | ||
+ | } | ||
+ | |||
+ | ====== ====== | ||
+ | |||
+ | **sites-enabled/ | ||
+ | |||
+ | Il server inner-tunnel viene chiamato in causa nel caso di richiesta di autenticazione passata all' | ||
+ | * Modificare {{: | ||
+ | |||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | server inner-tunnel { | ||
+ | ... | ||
+ | authorize { | ||
+ | ... | ||
+ | chap | ||
+ | ... | ||
+ | mschap | ||
+ | ... | ||
+ | suffix | ||
+ | ... | ||
+ | ... | ||
+ | eap { | ||
+ | ok = return | ||
+ | } | ||
+ | ... | ||
+ | files | ||
+ | ... | ||
+ | expiration | ||
+ | logintime | ||
+ | ... | ||
+ | pap | ||
+ | ... | ||
+ | # if ( " | ||
+ | # fail | ||
+ | # } | ||
+ | } | ||
+ | ... | ||
+ | Authenticate { | ||
+ | ... | ||
+ | Auth-Type PAP { | ||
+ | pap | ||
+ | } | ||
+ | ... | ||
+ | Auth-Type CHAP { | ||
+ | chap | ||
+ | } | ||
+ | ... | ||
+ | Auth-Type MS-CHAP { | ||
+ | mschap | ||
+ | } | ||
+ | ... | ||
+ | Auth-Type Kerberos { | ||
+ | krb5 | ||
+ | } | ||
+ | ... | ||
+ | ntlm_auth | ||
+ | ... | ||
+ | eap | ||
+ | ... | ||
+ | } | ||
+ | ... | ||
+ | } | ||
+ | |||
+ | |||
+ | * Nota: le ultime righe (commentate) nella sezione // | ||
+ | |||
+ | |||
+ | ====== ====== | ||
+ | |||
+ | **modules/ | ||
+ | |||
+ | |||
+ | * Se si vuole demandare l' | ||
+ | * Assegnare al file le giuste protezioni di accesso: | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | chmod g-r,o-r krb/ | ||
+ | |||
+ | ====== ====== | ||
+ | |||
+ | * Quindi creare il file {{: | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | krb5 { | ||
+ | keytab = ${raddbdir}/ | ||
+ | service_principal = radius/ | ||
+ | } | ||
+ | |||
+ | ====== ====== | ||
+ | |||
+ | **users** | ||
+ | |||
+ | * Modificare il file users secondo le esigenze di sede; puo' essere utile aggiungere un utente locale di test per la verifica della funzionalita' | ||
+ | |||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | test Auth-Type := Local, Cleartext-Password := " | ||
+ | | ||
+ | DEFAULT | ||
+ | | ||
+ | DEFAULT | ||
+ | | ||
+ | DEFAULT | ||
+ | | ||
+ | $INCLUDE | ||
+ | | ||
+ | DEFAULT | ||
+ | Fall-Through = Yes | ||
+ | |||
+ | |||
+ | * Nota: lasciare una riga vuota sotto ogni entry del file users | ||
+ | |||
+ | * Nell' | ||
+ | - il primo record definisce l' | ||
+ | - il secondo record demanda al modulo kerberos l' | ||
+ | - il terzo record demanda al proxy radius INFN (TRIP, definito nel file proxy.conf) la autenticazione degli utenti aventi username del tipo: < | ||
+ | - il quarto record, forse e' inutile, ma rifiuta l' | ||
+ | - il quinto record include un file con utenti locali (di tipo username e Cleartext-Password) aggiornato periodicamente dal database di Gestione Ospiti e Visitatori per l' | ||
+ | - il sesto record demanda al modulo kerberos l' | ||
+ | |||
+ | |||
+ | ==== Configurazione opzionale per abilitare l' | ||
+ | |||
+ | Se non si vuole abilitare l' | ||
+ | |||
+ | Il protocollo di autenticazione PEAP-EAP/ | ||
+ | Windows permette di configrare nativamente tale protocollo, che consente di effettuare l' | ||
+ | |||
+ | Volendo abilitare l' | ||
+ | |||
+ | **modules/ | ||
+ | |||
+ | * Modificare il file {{: | ||
+ | |||
+ | === === | ||
+ | |||
+ | eap inner-eap { | ||
+ | | ||
+ | | ||
+ | ... | ||
+ | | ||
+ | } | ||
+ | ... | ||
+ | tls { | ||
+ | ... | ||
+ | certdir = ${confdir}/ | ||
+ | cadir = ${confdir}/ | ||
+ | ... | ||
+ | ## | ||
+ | ## Inserire i nomi dei files rispettivamente della chiave privata e del certificato x509 (rilasciato dalla CA INFN) | ||
+ | private_key_file = ${certdir}/ | ||
+ | certificate_file = ${certdir}/ | ||
+ | ... | ||
+ | ## inserire il file contenente tutti i certificati pubblici delle seguenti CA: INFN e TERENA | ||
+ | ## Attenzione!: | ||
+ | ## di COMODO (root CA) e UTN-USERFirst-Client-Authentication-and-Email (Intermediate CA) [Vedi file INFN-TERENA-CA.pem allegato] | ||
+ | CA_file = ${cadir}/ | ||
+ | ... | ||
+ | ## Attenzione il fragment size deve essere inferiore a quello definito nel file eap.conf (valori consigliati | ||
+ | ## sono: 1200 in eap.conf e 1024 in modules/ | ||
+ | fragment_size = 1024 | ||
+ | ... | ||
+ | ## attenzione: commentare la seguente riga: | ||
+ | ## | ||
+ | ... | ||
+ | } | ||
+ | ... | ||
+ | } | ||
+ | |||
+ | ==== ==== | ||
+ | |||
+ | **eap.conf** | ||
+ | |||
+ | * Modificare il file eap.conf | ||
+ | |||
+ | === === | ||
+ | |||
+ | eap { | ||
+ | ... | ||
+ | tls { | ||
+ | ... | ||
+ | ## attenzione: commentare la seguente riga: | ||
+ | ## | ||
+ | ... | ||
+ | } | ||
+ | ... | ||
+ | } | ||
+ | |||
+ | ==== ==== | ||
+ | |||
+ | **sites-enabled/ | ||
+ | |||
+ | * Modificare il file sites-enabled/ | ||
+ | |||
+ | === === | ||
+ | |||
+ | server inner-tunnel { | ||
+ | ... | ||
+ | authorize { | ||
+ | ... | ||
+ | inner-eap { | ||
+ | ok = return | ||
+ | } | ||
+ | ... | ||
+ | } | ||
+ | ... | ||
+ | Authenticate { | ||
+ | ... | ||
+ | inner-eap | ||
+ | ... | ||
+ | } | ||
+ | ... | ||
+ | post-auth { | ||
+ | ... | ||
+ | / | ||
+ | if ( TLS-Client-Cert-Subject !~ /^$/ ) { | ||
+ | if ( TLS-Client-Cert-Issuer != "/ | ||
+ | logger-reject | ||
+ | reject | ||
+ | } | ||
+ | if ( TLS-Client-Cert-Subject !~ / | ||
+ | logger-reject | ||
+ | reject | ||
+ | } | ||
+ | else { | ||
+ | logger-accept | ||
+ | } | ||
+ | } | ||
+ | ... | ||
+ | } | ||
+ | |||
+ | |||
+ | * Nota: Affinche' | ||
+ | |||
+ | |||
+ | ====== Start del server radius ====== | ||
+ | |||
+ | * Prima dello start occorre modificare la proprieta' | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | chown -R radiusd: | ||
+ | chmod -R u+rw, | ||
+ | chmod -R g-r,o-r certs/* | ||
+ | |||
+ | ====== ====== | ||
+ | |||
+ | * Lanciare il servizio in debug mode: | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | / | ||
+ | |||
+ | oppure (piu' verboso): | ||
+ | |||
+ | / | ||
+ | |||
+ | ====== ====== | ||
+ | |||
+ | * Lanciare il servizio come daemon: | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | / | ||
+ | |||
+ | ====== ====== | ||
+ | |||
+ | * Start automatico al boot | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | chkconfig --add radiusd | ||
+ | chkconfig --level 35 radiusd on | ||
+ | |||
+ | ====== ====== | ||
+ | |||
+ | * Eseguire un banale test di autenticazione: | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | / | ||
+ | |||
+ | (verificare il file di log / | ||
+ | |||
+ | |||
+ | ====== Aggiornamento del file delle autenticazioni per i visitatori ====== | ||
+ | |||
+ | Per le sedi che usano l' | ||
+ | |||
+ | * Creare il file {{: | ||
+ | * All' | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | ' | ||
+ | |||
+ | ====== ====== | ||
+ | |||
+ | * Quindi inserire lo script GOsync.sh a crontab con la seguente linea (senza l' | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | '*/10 * * * * / | ||
+ | |||
+ | ====== ====== | ||
+ | |||
+ | * In tal modo lo script aggiornera' | ||
+ | * Tale file viene utilizzato dal radius server per l' | ||
+ | |||
+ | |||
+ | |||
+ | ====== Configurazione del metodo di autenticazione PEAP-MSCHAPv2 --> KerberosV MIT ====== | ||
+ | |||
+ | Per le sedi che usano kerberosV come protocollo di autenticazione, | ||
+ | |||
+ | **Nota:** perche' | ||
+ | per poter utilizzare l' | ||
+ | |||
+ | Per implementare tale metodo di autenticazione c' | ||
+ | Kcrap e' un s/w free realizzato da [[http:// | ||
+ | |||
+ | Riferimenti: | ||
+ | * http:// | ||
+ | * http:// | ||
+ | |||
+ | Il s/w con le modifiche di Dan Fuhry, e' stato installato e testato ai LNF da Sandro Angius. Tuttavia, per eliminare qualche piccolo malfunzionamento e per adattarlo alle esigenze dell' | ||
+ | |||
+ | * eliminazione della parte che esegue la patch a freeradius (questo step e' fondamentale per poter liberamente installare le nuove versioni di freeradius via via che vengono rilasciate, senza dipendere dal rilascio di patch aggiornate di kcrap) | ||
+ | * conseguente realizzazione di un task aggiuntivo, chiamato kcrapclient, | ||
+ | * ritorno della NT_KEY con cifratura MD4 da parte del server verso il client (suggerito da Sandro e realizzato da Dan) | ||
+ | * inserimento dei log sulla parte kcrap server | ||
+ | * inserimento di output di debug ed eliminazione di alcuni bug | ||
+ | * aggiunta qua e la di istruzioni per cancellazione e/o eliminazione di buffer di memoria non piu' usati. | ||
+ | |||
+ | Alcune di queste modifiche sono state inglobate da Dan Fuhry nella sua versione del s/w. | ||
+ | A seguito di queste modifiche sono stati creati due nuovi pacchetti di distribuzione (by Sandro Angius): | ||
+ | |||
+ | * {{: | ||
+ | * {{: | ||
+ | |||
+ | Il primo e' da utilizzare per chi ha kerberosV MIT versione 1.6, il secondo e' da utilizzare per chi ha kerberosV MIT versione 1.9. | ||
+ | Il primo tarball dovrebbe funzionare anche con kerberosV versione 1.7, ma non e' stato testato con tale versione. Infatti soltanto nella versione 1.9 di kerberosV cambia il metodo di accesso al DB delle credenziali, | ||
+ | |||
+ | ===== Installazione di kcrap server ===== | ||
+ | |||
+ | Il s/w kcrap server va installato su un kdc. Per motivi di sicurezza, e' caldamente consigliato di utilizzare un secondary kdc. | ||
+ | Per installare kcrap server e' necessario rispettare i seguenti prerequisiti: | ||
+ | |||
+ | * avere installato i seguenti RPMs: | ||
+ | * openssl-devel | ||
+ | * krb5-devel | ||
+ | |||
+ | Per l' | ||
+ | |||
+ | * si consiglia di avere anche i sorgenti kerberosV della versione installata sul server kdc, altrimenti kcrap utilizzera' | ||
+ | |||
+ | ==== ==== | ||
+ | |||
+ | mkdir /root/kcrap | ||
+ | cd /root/kcrap | ||
+ | wget http:// | ||
+ | tar xf krb5-1.6.1-signed.tar | ||
+ | tar xzf krb5-1.6.1.tar.gz | ||
+ | cd krb5-1.6.1/ | ||
+ | ./configure | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | * scaricare il tarball di kcrap (versione LNF) ed eseguire i seguenti comandi (modificare il prefix secondo le proprie necessita' | ||
+ | |||
+ | ==== ==== | ||
+ | |||
+ | tar xzf kcrap-0.2.3-LNF.tgz | ||
+ | cd kcrap-0.2.3-LNF/ | ||
+ | ./configure --prefix=/ | ||
+ | make | ||
+ | make install | ||
+ | ln -s / | ||
+ | ldconfig | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | * creare il file / | ||
+ | |||
+ | ==== ==== | ||
+ | |||
+ | [kcrap_server] | ||
+ | port = 1999 | ||
+ | realm = LNF.INFN.IT | ||
+ | | ||
+ | [realms] | ||
+ | LNF.INFN.IT = { | ||
+ | database_name = / | ||
+ | key_stash_file = / | ||
+ | } | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | * Nella sezione //' | ||
+ | |||
+ | ==== ==== | ||
+ | |||
+ | ... | ||
+ | [logging] | ||
+ | | ||
+ | ## | ||
+ | ... | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | * Opzionalmente si puo' configurare la parte client anche sul server (per effettuare test di funzionamento); | ||
+ | |||
+ | |||
+ | ==== ==== | ||
+ | |||
+ | ... | ||
+ | [realms] | ||
+ | LNF.INFN.IT = { | ||
+ | ... | ||
+ | ... | ||
+ | kcrap = kcrapsrv1.lnf.infn.it: | ||
+ | } | ||
+ | ... | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | * Configurare iptables per consentire l' | ||
+ | |||
+ | ==== ==== | ||
+ | |||
+ | iptables -A INPUT -m state --state NEW -s 193.206.84.29/ | ||
+ | |||
+ | (ovviamente prima della necessaria direttiva di drop finale dei pacchetti udp) | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | * Creare il file {{: | ||
+ | |||
+ | ==== ==== | ||
+ | |||
+ | #!/bin/bash | ||
+ | # | ||
+ | # kcrap_server | ||
+ | # | ||
+ | # chkconfig: | ||
+ | # description: | ||
+ | # processname: | ||
+ | # config: / | ||
+ | # | ||
+ | | ||
+ | # Get config. | ||
+ | . / | ||
+ | | ||
+ | # Get config. | ||
+ | [ -r / | ||
+ | | ||
+ | # Source function library. | ||
+ | . / | ||
+ | | ||
+ | RETVAL=0 | ||
+ | prog=" | ||
+ | kcrap_server=/ | ||
+ | | ||
+ | # Sheel functions to cut down on useless shell instances. | ||
+ | start() { | ||
+ | [ -x $kcrap_server ] || exit 5 | ||
+ | echo -n $" | ||
+ | daemon ${kcrap_server} | ||
+ | RETVAL=$? | ||
+ | echo | ||
+ | [ $RETVAL = 0 ] && touch / | ||
+ | } | ||
+ | stop() { | ||
+ | echo -n $" | ||
+ | killproc ${kcrap_server} | ||
+ | RETVAL=$? | ||
+ | echo | ||
+ | [ $RETVAL = 0 ] && rm -f / | ||
+ | } | ||
+ | | ||
+ | # See how we were called. | ||
+ | case " | ||
+ | start) | ||
+ | start | ||
+ | ;; | ||
+ | stop) | ||
+ | stop | ||
+ | ;; | ||
+ | restart) | ||
+ | stop | ||
+ | start | ||
+ | ;; | ||
+ | status) | ||
+ | status ${kcrap_server} | ||
+ | RETVAL=$? | ||
+ | ;; | ||
+ | condrestart) | ||
+ | if [ -f / | ||
+ | stop | ||
+ | start | ||
+ | fi | ||
+ | ;; | ||
+ | *) | ||
+ | echo $" | ||
+ | RETVAL=2 | ||
+ | ;; | ||
+ | esac | ||
+ | | ||
+ | exit $RETVAL | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | * Lanciare il servizio come daemon: | ||
+ | |||
+ | ==== ==== | ||
+ | |||
+ | / | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | * Start automatico al boot | ||
+ | |||
+ | ==== ==== | ||
+ | |||
+ | chkconfig --add kcrap | ||
+ | chkconfig --level 35 kcrap on | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | **Procedure di postinstallazione: | ||
+ | |||
+ | Per testare che tutto funzioni, creare temporaneamente l' | ||
+ | comando: | ||
+ | |||
+ | ==== ==== | ||
+ | |||
+ | ## / | ||
+ | / | ||
+ | |||
+ | e verificare che la stringa di ritorno sia: | ||
+ | |||
+ | NT_KEY: 3f373ea8e4af954f14faa506f8eebdc4 | ||
+ | | ||
+ | verificare anche che cambiando una cifra (esadecimale) della challenge o della response l' | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | **Note:** | ||
+ | |||
+ | Se il syslog e' configurato per i livelli a partire da info il log sara' del tipo: | ||
+ | |||
+ | ==== ==== | ||
+ | |||
+ | Mar 27 17:21:18 kdcs3 kcrap[8649]: | ||
+ | Mar 27 17:21:26 kdcs3 kcrap[8649]: | ||
+ | Mar 27 17:21:28 kdcs3 kcrap[8649]: | ||
+ | Mar 27 17:27:07 kdcs3 kcrap[8649]: | ||
+ | Mar 27 17:27:08 kdcs3 kcrap[8649]: | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | mentre con i livelli da debug si ottiene: | ||
+ | |||
+ | ==== ==== | ||
+ | |||
+ | Mar 27 17:27:09 kdcs3 kcrap[8649]: | ||
+ | Mar 27 17:27:09 kdcs3 kcrap[8649]: | ||
+ | Mar 27 17:27:09 kdcs3 kcrap[8649]: | ||
+ | Mar 27 17:27:10 kdcs3 kcrap[8649]: | ||
+ | Mar 27 17:27:10 kdcs3 kcrap[8649]: | ||
+ | Mar 27 17:27:10 kdcs3 kcrap[8649]: | ||
+ | ===== Installazione di kcrap client ===== | ||
+ | |||
+ | |||
+ | Per installare kcrapclient sul server radius e' necessario rispettare i seguenti prerequisiti: | ||
+ | |||
+ | * avere installato i seguenti RPMs: | ||
+ | * krb5-libs | ||
+ | * krb5-devel | ||
+ | |||
+ | Quindi seguire le istruzioni: | ||
+ | |||
+ | * scaricare il tarball di kcrap (versione LNF) ed eseguire i seguenti comandi (modificare il prefix secondo le proprie necessita' | ||
+ | |||
+ | ==== ==== | ||
+ | |||
+ | tar xzf kcrap-0.2.3-LNF.tgz | ||
+ | cd kcrap-0.2.3-LNF/ | ||
+ | ./configure --prefix=/ | ||
+ | make | ||
+ | make install | ||
+ | ln -s / | ||
+ | ldconfig | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | * modificare il file / | ||
+ | |||
+ | ==== ==== | ||
+ | |||
+ | ... | ||
+ | [realms] | ||
+ | LNF.INFN.IT = { | ||
+ | ... | ||
+ | ... | ||
+ | kcrap = kcrapsrv1.lnf.infn.it: | ||
+ | kcrap = kcrapsrv2.lnf.infn.it: | ||
+ | kcrap = kcrapsrv3.lnf.infn.it: | ||
+ | } | ||
+ | ... | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | * Accertarsi che radiusd (owner del radius daemon) abbia i diritti di esecuzione di kcrapclient, | ||
+ | |||
+ | ==== ==== | ||
+ | |||
+ | chmod a+rx / | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | * Se non esiste gia', creare e posizionare in /etc il keytab file (krb5.keytab) per il radius server del tipo: | ||
+ | * host/< | ||
+ | |||
+ | |||
+ | ==== ==== | ||
+ | e dare i diritti di lettura a radiusd (owner del radius daemon): | ||
+ | |||
+ | chown root: | ||
+ | chmod g+r / | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | **Procedure di postinstallazione: | ||
+ | |||
+ | Per testare che tutto funzioni, lanciare il seguente comando: | ||
+ | |||
+ | ==== ==== | ||
+ | |||
+ | ## / | ||
+ | / | ||
+ | |||
+ | e verificare che la stringa di ritorno sia: | ||
+ | |||
+ | NT_KEY: 3f373ea8e4af954f14faa506f8eebdc4 | ||
+ | |||
+ | verificare anche che cambiando una cifra (esadecimale) della challenge o della response l' | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | **Integrazione con freeradius** | ||
+ | |||
+ | Una volta installato kcrap (server e client) si puo' fare in modo che l' | ||
+ | |||
+ | * Modificare il file {{: | ||
+ | |||
+ | ==== ==== | ||
+ | |||
+ | ... | ||
+ | mschap { | ||
+ | ... | ||
+ | ## ntlm_auth = "/ | ||
+ | | ||
+ | ntlm_auth = "/ | ||
+ | ... | ||
+ | } | ||
+ | | ||
+ | ===== ===== | ||
+ | |||
+ | * Quindi far ripartire freeradius | ||
+ | |||
+ | ==== ==== | ||
+ | |||
+ | / | ||
+ | | ||
+ | ===== ===== | ||
+ | |||
+ | A questo punto si puo' provare a configurare un supplicant affinche' | ||
+ | |||
+ | **Nota:** quando tutto funziona, ricordarsi di rimuovere la username //user// da kerberos! | ||
+ | |||
+ | ====== ====== | ||
+ | |||
+ | **Buona fortuna!** | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | --- // | ||
+ | |||
+ | |||