freeradius c onfigura tion

53
connect • communicate • collaborate FreeRADIUS configuration Jovana Palibrk, AMRES NA3 T2, Sofia, 19.06.2014.

Upload: dyami

Post on 23-Feb-2016

45 views

Category:

Documents


0 download

DESCRIPTION

FreeRADIUS c onfigura tion. Jovana Palibrk , AMRES NA3 T 2, Sofia, 1 9 .0 6 .201 4. Who am I?. [email protected] Academic network of Serbia Network security engineer Campus best practice task. Content s. Introduction FreeRADIUS platform FreeRADIUS server installation - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

FreeRADIUS configuration

Jovana Palibrk, AMRESNA3 T2, Sofia, 19.06.2014.

Page 2: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Who am I?

[email protected]

Academic network of Serbia

Network security engineer

Campus best practice task

Page 3: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Contents

Introduction

FreeRADIUS platform

FreeRADIUS server installation

Authentication configuration

Accounting configuration

marko stojakovic
the primary goal of this presentation is to present freeradius configuration for....potrebno je naglasiti da ova prezentacija nema glavni cilj da predstavi konfiguraciju potrebnu za eduroam servis već uopšteno za wireless mreže
marko stojakovic
takođe naglasiti da će najviše vremena biti posvećeno authentication configuration temi, tj ona je najbitnija
Page 4: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Introduction

Wireless infrastructureIEEE 802.1x standard

Supplicant – user deviceAuthenticator – access pointAuthentication Server – RADIUS server

Page 5: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Introduction – RADIUS/EAP authentication

Supplicant

Authenticator(AP)

Authentication server (RADIUS)

Internet or

other LAN resources

1.

2.

3.

4.

1. Association request and response2. EAP in 802.1x3. EAP in RADIUS4. Access to Internet or other LAN resources

Page 6: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Introduction – eduroam

TLR

FTLR

Institutional RADIUS

.rs .bg

Page 7: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Introduction – eduroam

[email protected]

AP inst.bg

.bg .rsTLR

inst.ac.rs

Internet

Page 8: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Introduction – RADIUS/EAP authentication

RADIUS – Remote Authentication Dial In User Service

Networking protocol which provides centralized AAA service

“Who are you?” (Authentication)

“What services am I allowed to give you?” (Authorization)

“What did you do with my services while you were using them?” (Accounting)

Page 9: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

FreeRADIUS platform

www.freeradius.org Open-source project Current versions are 2.2.5 and 3.0.3:Supported OSs:

Linux (CentOS, Debian, Mandriva, Red Hat, SUSE, Ubuntu)FreeBSDSolarisOpenBSD..

marko stojakovic
configuration is presented on the centos platform, the comands presented here could be slightly different on other OSs
marko stojakovic
freeradius is widely deployed radius server, it is feature rich, modular and scalableand is free which is very convinient :) current version is 2.1.11 - on the freeradius.org are listed releace notes if anyone wants to see
Page 10: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

FreeRADIUS platform

radiusd.conf

clients.conf eap.conf

proxy.conf

sql.conf users

FreeRADIUS

inner-tunnel

ldap

ippool

Page 11: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

FreeRADIUS installation

Before FreeRADIUS installation:

Make sure your system has gcc, glibc, binutils, and gmake installed before trying to compile

Other dependencies (based on modules that you need):

Openssl, openssl-devel – needed for FR EAP module to work

LDAP (if you have LDAP database)

MySQL

marko stojakovic
Make sure your system at least has gcc, glibc, binutils, and gmake installed before trying to compile
Page 12: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

FreeRADIUS installation

Installation (with output redirection):

./configure -flags > text.filemakemake install (root privileges)

You can use –flags to customize the settings (use

--help to see all available flags)

Page 13: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

FreeRADIUS installation

[root@radius freeradius-server-2.1.11]# ./configure --with-openssl > config.txt

configure: WARNING: snmpget not found - Simultaneous-Use and checkrad.pl may not workconfigure: WARNING: snmpwalk not found - Simultaneous-Use and checkrad.pl may not workconfigure: WARNING: pcap library not found, silently disabling the RADIUS sniffer.configure: WARNING: silently not building rlm_counter.configure: WARNING: FAILURE: rlm_counter requires: libgdbm.configure: WARNING: FAILURE: rlm_dbm requires: (ndbm.h or gdbm/ndbm.h or gdbm-ndbm.h)

(libndbm or libgdbm or libgdbm_compat).configure: WARNING: silently not building rlm_dbm.configure: WARNING: the TNCS library isn't found!configure: WARNING: silently not building rlm_eap_tnc.configure: WARNING: FAILURE: rlm_eap_tnc requires: -lTNCS.configure: WARNING: silently not building rlm_eap_ikev2.configure: WARNING: FAILURE: rlm_eap_ikev2 requires: libeap-ikev2 EAPIKEv2/connector.h.configure: WARNING: silently not building rlm_ippool.configure: WARNING: FAILURE: rlm_ippool requires: libgdbm.configure: WARNING: silently not building rlm_pam.configure: WARNING: FAILURE: rlm_pam requires: libpam.configure: WARNING: silently not building rlm_python.configure: WARNING: FAILURE: rlm_python requires: Python.h.configure: WARNING: silently not building rlm_sql_iodbc.configure: WARNING: FAILURE: rlm_sql_iodbc requires: libiodb.

Page 14: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

FreeRADIUS installation

configure: WARNING: silently not building rlm_ippool.

configure: WARNING: FAILURE: rlm_ippool requires: libgdbm.

Page 15: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

FreeRADIUS installation

raddb - FreeRADIUS directory:

cd /usr/local/etc/raddb

All configuration files and modules are located in raddb, to list them use:

ls -la

marko stojakovic
marko stojakovic9/2/2011When the server has been installed on a new machine, the first step is to start it in debugging mode, as user root:$ radiusd -XThis step demonstrates that the server is installed and configured properly. If you have installed Version 2 from source, this step will also create the default certificates used for EAP authentication.
Page 16: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

FreeRADIUS installation

Starting the server

radiusd

Stopping the server

killall radiusd

Check if the radius deamon will start (with default configuration)

Starting the server in debugging mode:

radiusd -X

marko stojakovic
marko stojakovic9/2/2011When the server has been installed on a new machine, the first step is to start it in debugging mode, as user root:$ radiusd -XThis step demonstrates that the server is installed and configured properly. If you have installed Version 2 from source, this step will also create the default certificates used for EAP authentication.
Page 17: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

FreeRADIUS installation

Listening on authenticatio address * port 1812Listening on accounting address * port 1813Listening on command file /usr/local/var/run/radiusd/radiusd.sockListening on authentication address 127.0.0.1 port 18120 as server

inner-tunnelListening on proxy address * port 1814Ready to process requests.

CTRL + C

Page 18: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Authentication configuration

Which EAP type to deploy

EAP type configuration

Virtual server configuration

NAS client parameter configuration

Connecting FreeRADIUS with user database

Processing of Auth requests

Page 19: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Which EAP type to deploy

Supported EAP authentication types (by FreeRADIUS):

EAP-TLSEAP-TTLSPEAPEAP-GTCLEAPEAP-MD5

Page 20: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Which EAP type to deploy

If your ID management infrastructure supports X.509 client certificates – then you can use EAP-TLS

If your ID management infrastructure uses username/password:

Passwords in clear-text or as NT-hash? – EAP-TTLS, PEAPIf the passwords are in any other format - then you can use only EAP-TTLS

marko stojakovic
Regarding the identity management backend, the most fundamental differentiation between EAP types is the type of credential they support.
marko stojakovic
i will concentrate on ttls and peap
Page 21: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Which EAP type to deploy

clear-text

NT-hash MD5 hash

Salted MD5 hash

SHA1 hash

Salted SH1 hash

Unix Crypt

PAP o o o o o o o

CHAP o x x x x x x

Digest o x x x x x x

MS-Chap o o x x x x x

PEAP o o x x x x x

EAP-MSCHAPv2 o o x x x x x

Cisco LEAP o o x x x x x

EAP-GTC o o o o o o o

EAP-MD5 o x x x x x x

EAP-SIM o x x x x x x

Page 22: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

EAP type configurationraddb/eap.conf

$ cd /usr/local/etc/raddb/$ joe eap.conf

Page 23: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

EAP type configurationraddb/eap.conf

eap {      default_eap_type = ttls      timer_expire     = 60      ignore_unknown_eap_types = no      cisco_accounting_username_bug = no   

tls {       certdir = ${confdir}/certs       cadir = ${confdir}/certs       private_key_password = whatever       private_key_file =${certdir}/private.key       certificate_file = ${certdir}/server.pem       CA_file = ${cadir}/ca.pem       dh_file = ${certdir}/dh       random_file = /dev/urandom       fragment_size = 1024       include_length = yes       check_crl = no       cipher_list = "DEFAULT"       }

  ttls {

        default_eap_type = md5        copy_request_to_tunnel = no        use_tunneled_reply = no        virtual_server = "inner-tunnel"          }      peap {         default_eap_type = mschapv2         copy_request_to_tunnel = no         use_tunneled_reply = no         virtual_server = "inner-tunnel"           }       mschapv2 {            }       }

Page 24: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

EAP type configurationraddb/eap.conf

eap {      default_eap_type = ttls      . . .   

tls {       . . .       private_key_file =${certdir}/private.key       certificate_file = ${certdir}/server.pem       CA_file = ${cadir}/ca.pem       . . .       }

  ttls {        default_eap_type = md5        copy_request_to_tunnel = nouse_tunneled_reply = novirtual_server = "inner-tunnel"          } . . .

CTRL + K + F

CTRL + K + X

Page 25: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Virtual server creation

Two virtual serversFirst one processes requests before the EAP tunnel is established (“outer-tunnel”)Second one processes requests inside the EAP tunnel (“inner-tunnel”)

Location:raddb/sites-available/defaultraddb/sites-available/inner-tunnel

Virtual servers are activated by creating symbolic link to a sites-enabled directory:

raddb/sites-enabled/

marko stojakovic
možda bih ovde trebao da kažem kako fr funkcionišeda svaki servis može imati po jedan vsvirtual server configuration enables freeradius server to support multiple services simultaniously
Page 26: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Virtual server creationraddb/sites-available/outer-tunnel

$ cd sites-available$ ls –la-rw-r----- 1 root root 19174 Jun 14 15:30 default-rw-r----- 1 root root 12328 Jun 14 15:30 inner-tunnel$ cp default outer-tunnel$ joe outer-tunnel

Page 27: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Virtual server creationraddb/sites-available/outer-tunnel

server outer-tunnel {authorize { preprocess chap mschap digest suffix eap files expiration logintime pap

}authenticate { Auth-Type PAP { pap } Auth-Type CHAP { chap } Auth-Type MS-CHAP { mschap } digest unix eap}

preacct { preprocess acct_unique suffix files}accounting { detail unix radutmp exec attr_filter.accounting_response}session { radutmp}post-auth { reply_log exec Post-Auth-Type REJECT { attr_filter.access_reject }}pre-proxy {}post-proxy { eap}}

Page 28: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Virtual server creationraddb/sites-available/outer-tunnel

server outer-tunnel {authorize {. . .pre-proxy {}post-proxy { eap}}

CTRL + K + V

CTRL + K + U

Page 29: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Virtual server creationraddb/sites-available/inner-tunnel

$ cd sites-available$ joe inner-tunnel

Page 30: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Virtual server creationraddb/sites-available/inner-tunnel

server inner-tunnel {authorize { suffix update control { Proxy-To-Realm := LOCAL } eap files expiration logintime pap}authenticate { Auth-Type PAP { pap } Auth-Type CHAP { chap } Auth-Type MS-CHAP { mschap } unix eap}

session { radutmp}post-auth { Post-Auth-Type REJECT { attr_filter.access_reject }}pre-proxy {}post-proxy { eap}

Page 31: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Virtual server creationraddb/sites-enabled

$ cd ..$ cd /sites-enabled$ ln –s /usr/local/etc/raddb/sites-available/outer-tunnel$ ls –ladefault -> ../sites-available/defaultinner-tunnel -> ../sites-available/inner-tunnelouter-tunnel -> /usr/local/etc/raddb/sites-available/outer-tunnel

Page 32: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Virtual server creationraddb/clients.conf

$ cd ..$ joe clients.conf

Page 33: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Client parameter configurationraddb/clients.conf

client AP-library { ipaddr = 192.168.1.25 secret = mYs3cr3t shortname = AP1 nastype = other virtual_server = outer-tunnel}

client radius2 { ipaddr = 192.168.6.34 secret = uRs3cr3t shortname = radius2 nastype = other virtual_server = outer-tunnel}

marko stojakovic
RADIUS is based on a client-server model. The NAS-devices (Access Points, switches etc.) forward credentials to a RADIUS server, i.e. act as a client, and therefore need to be defined on the RADIUS server. Other RADIUS servers can act as a client as well, so every kind of RADIUS-request can be forwarded to another server.
Page 34: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Client parameter configurationraddb/clients.conf

client localhost { ipaddr = 127.0.0.1 secret = testing123 virtual_server = outer-tunnel require_message_authenticator = no}

CTRL + K + X

marko stojakovic
RADIUS is based on a client-server model. The NAS-devices (Access Points, switches etc.) forward credentials to a RADIUS server, i.e. act as a client, and therefore need to be defined on the RADIUS server. Other RADIUS servers can act as a client as well, so every kind of RADIUS-request can be forwarded to another server.
Page 35: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Connecting to user database

User database:LDAP – Lightweight Directory Access ProtocolFreeRADIUS users file

Additional configuration lines should be added to inner-tunnelConfiguration of additional modules depends of database type

Page 36: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Connecting to user database- LDAPLDAP configuration file /raddb/modules/ldap

ldap { server = "localhost" identity = "uid=reader,ou=SystemAccounts,dc=bg,dc=ac,dc=rs" password = b1g$3cr3t basedn = "ou=People,dc=bg,dc=ac,dc=rs“ ...

Mapping between RADIUS and LDAP attributes is configured in /raddb/ldap.attrmap

checkItem SMB-Account-CTRL-TEXT acctFlagscheckItem Expiration radiusExpirationcheckItem Cleartext-Password userPasswordcheckItem User-Name uid#checkItem Pool-Name ismemberof

Page 37: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Connecting to user database- LDAP – inner-tunnel

authorize { suffix update control { Proxy-To-Realm := LOCAL } eap files ldap expiration logintime pap}authenticate { Auth-Type PAP { pap }

Page 38: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Manipulation with authentication requestsAdding configuration parametar files to inner-tunnel:

server inner-tunnel {authorize { auth_log eap

files mschap pap}

Connecting to user database- FR users file

Page 39: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

$ cd /usr/local/etc/raddb

$ joe users

sofia Cleartext-Password:= “cbp“

Connecting to user database- FR users file

CTRL + K + V CTRL + K + X

Page 40: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Processing of Auth requests

Do we want to process the requests only localy or some authentication requests requires proxying to another server?

Relevant configuration file is raddb/proxy.conf

Page 41: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Processing of Auth requests proxy.conf – Local

proxy server { default_fallback = no}home_server localhost { type = auth+acct ipaddr = 127.0.0.1 port = 1812 secret = testing123 response_window = 20 zombie_period = 40 revive_interval = 120 status_check = status-server check_interval = 30 num_answers_to_alive = 3}realm workshop.bg { authhost = LOCAL accthost = LOCAL User-Name = "%{Stripped-User-Name}"}realm LOCAL {}realm NULL {}

Page 42: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Processing of Auth requests proxy.conf – Local

proxy server { default_fallback = no}. . .realm workshop.bg { authhost = LOCAL accthost = LOCAL User-Name = "%{Stripped-User-Name}"}realm LOCAL {}realm NULL {}

CTRL + K + V CTRL + K + X

Page 43: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Processing of Auth requests proxy.conf – Local + Proxyhome_server radius2 { type = auth+acct ipaddr = 192.168.14.15 port = 1812 secret = r@diu$ response_window = 20 zombie_period = 40 revive_interval = 120 status_check = status-server check_interval = 30 num_answers_to_alive = 3}home_server_pool radius2 { home_server = radius2}realm DEFAULT { pool = radius2 nostrip}

Page 44: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Testing

eapol_test - http://deployingradius.com/scripts/eapol_test/ EAP testing toolPart of wpa supplicant

Command eapol_test -c ttls-pap.conf -s testing123

marko stojakovic
možda bih ovde trebao da kažem kako fr funkcionišeda svaki servis može imati po jedan vsvirtual server configuration enables freeradius server to support multiple services simultaniously
Page 45: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

$ cd /usr/local/etc/raddb

$ joe ttls-pap.conf

Testing

Page 46: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Testing - ttls-pap.conf

## eapol_test -c ttls-pap.conf -s testing123#network={ ssid="example" key_mgmt=WPA-EAP eap=TTLS identity=“[email protected]" anonymous_identity="[email protected]" password=“cbp" phase2="auth=PAP"

# # Uncomment the following to perform server certificate

validation.# ca_cert="/etc/raddb/certs/ca.der"}

CTRL + K + X

Page 47: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Testing - testing123

client localhost { ipaddr = 127.0.0.1 secret = testing123 virtual_server = outer-tunnel require_message_authenticator = no}

marko stojakovic
RADIUS is based on a client-server model. The NAS-devices (Access Points, switches etc.) forward credentials to a RADIUS server, i.e. act as a client, and therefore need to be defined on the RADIUS server. Other RADIUS servers can act as a client as well, so every kind of RADIUS-request can be forwarded to another server.
Page 48: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

$ cd /usr/local/etc/raddb

$ joe ttls-pap.conf

$ eapol_test -c ttls-pap.conf -s testing123

Testing

Page 49: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Accounting configuration

Depends of whether the devices that you use as NAS supports RADIUS Acct (Cisco, Lancom)

MySQL configuration:Create a table (table examples can be found in raddb/sql/mysql/)Create a user with write priviledges

FreeRADIUS configuration: Create accounting queries in something.conf in raddb/sql/mysql/Edit raddb/sql.conf

Page 50: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Accounting configurationraddb/sql.conf

sql ws-test { . . . server = “192.168.14.23" login = “jupiter" password = “s@turn" radius_db = "radius" acct_table1 = “table1“ acct_table2 = “table1" . . . $INCLUDE sql/${database}/something.conf}

Page 51: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Accounting configurationraddb/sites-available/outer-tunnel

...preacct { preprocess acct_unique suffix files}accounting { ws-test detail unix radutmp exec attr_filter.accounting_response}session { radutmp}...

Page 52: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Questions?

Page 53: FreeRADIUS  c onfigura tion

connect • communicate • collaborate

Thank you!