hs20-osu-server.txt 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. Hotspot 2.0 OSU server
  2. ======================
  3. The information in this document is based on the assumption that Ubuntu
  4. 12.04 server (64-bit) distribution is used and the web server is
  5. Apache2. Neither of these are requirements for the installation, but if
  6. other combinations are used, the package names and configuration
  7. parameters may need to be adjusted.
  8. NOTE: This implementation and the example configuration here is meant
  9. only for testing purposes in a lab environment. This design is not
  10. secure to be installed in a publicly available Internet server without
  11. considerable amount of modification and review for security issues.
  12. NOTE: While this describes use on Ubuntu 12.04, the version of Apache2
  13. included in that distribution is not new enough to support all OSU
  14. server validation steps. In other words, it may be most adapt the steps
  15. described here to Ubuntu 13.10.
  16. Build dependencies
  17. ------------------
  18. Ubuntu 12.04 server
  19. - default installation
  20. - upgraded to latest package versions
  21. sudo apt-get update
  22. sudo apt-get upgrade
  23. Packages needed for running the service:
  24. sudo apt-get install sqlite3
  25. sudo apt-get install apache2
  26. sudo apt-get install php5-sqlite libapache2-mod-php5
  27. Additional packages needed for building the components:
  28. sudo apt-get install build-essential
  29. sudo apt-get install libsqlite3-dev
  30. sudo apt-get install libssl-dev
  31. sudo apt-get install libxml2-dev
  32. Installation location
  33. ---------------------
  34. Select a location for the installation root directory. The example here
  35. assumes /home/user/hs20-server to be used, but this can be changed by
  36. editing couple of files as indicated below.
  37. sudo mkdir -p /home/user/hs20-server
  38. sudo chown $USER /home/user/hs20-server
  39. mkdir -p /home/user/hs20-server/spp
  40. mkdir -p /home/user/hs20-server/AS
  41. Build
  42. -----
  43. # hostapd as RADIUS server
  44. cd hostapd
  45. #example build configuration
  46. cat > .config <<EOF
  47. CONFIG_DRIVER_NONE=y
  48. CONFIG_PKCS12=y
  49. CONFIG_RADIUS_SERVER=y
  50. CONFIG_EAP=y
  51. CONFIG_EAP_TLS=y
  52. CONFIG_EAP_MSCHAPV2=y
  53. CONFIG_EAP_PEAP=y
  54. CONFIG_EAP_GTC=y
  55. CONFIG_EAP_TTLS=y
  56. CONFIG_EAP_SIM=y
  57. CONFIG_EAP_AKA=y
  58. CONFIG_EAP_AKA_PRIME=y
  59. CONFIG_SQLITE=y
  60. CONFIG_HS20=y
  61. EOF
  62. make hostapd hlr_auc_gw
  63. cp hostapd hlr_auc_gw /home/user/hs20-server/AS
  64. # build hs20_spp_server
  65. cd ../hs20/server
  66. make clean
  67. make
  68. cp hs20_spp_server /home/user/hs20-server/spp
  69. # prepare database (web server user/group needs to have write access)
  70. mkdir -p /home/user/hs20-server/AS/DB
  71. sudo chgrp www-data /home/user/hs20-server/AS/DB
  72. sudo chmod g+w /home/user/hs20-server/AS/DB
  73. sqlite3 /home/user/hs20-server/AS/DB/eap_user.db < sql.txt
  74. sudo chgrp www-data /home/user/hs20-server/AS/DB/eap_user.db
  75. sudo chmod g+w /home/user/hs20-server/AS/DB/eap_user.db
  76. # add example configuration (note: need to update URLs to match the system)
  77. sqlite3 /home/user/hs20-server/AS/DB/eap_user.db < sql-example.txt
  78. # copy PHP scripts
  79. # Modify config.php if different installation directory is used.
  80. # Modify PHP scripts to get the desired behavior for user interaction (or use
  81. # the examples as-is for initial testing).
  82. cp -r www /home/user/hs20-server
  83. # Configure subscription policies
  84. mkdir -p /home/user/hs20-server/spp/policy
  85. cat > /home/user/hs20-server/spp/policy/default.xml <<EOF
  86. <Policy>
  87. <PolicyUpdate>
  88. <UpdateInterval>30</UpdateInterval>
  89. <UpdateMethod>ClientInitiated</UpdateMethod>
  90. <Restriction>Unrestricted</Restriction>
  91. <URI>https://policy-server.osu.example.com/hs20/spp.php</URI>
  92. </PolicyUpdate>
  93. </Policy>
  94. EOF
  95. # Install Hotspot 2.0 SPP and OMA DM XML schema/DTD files
  96. # XML schema for SPP
  97. # Copy the latest XML schema into /home/user/hs20-server/spp/spp.xsd
  98. # OMA DM Device Description Framework DTD
  99. # Copy into /home/user/hs20-server/spp/dm_ddf-v1_2.dtd
  100. # http://www.openmobilealliance.org/tech/DTD/dm_ddf-v1_2.dtd
  101. # Configure RADIUS authentication service
  102. # Note: Change the URL to match the setup
  103. # Note: Install AAA server key/certificate and root CA in Key directory
  104. cat > /home/user/hs20-server/AS/as-sql.conf <<EOF
  105. driver=none
  106. radius_server_clients=as.radius_clients
  107. eap_server=1
  108. eap_user_file=sqlite:DB/eap_user.db
  109. ca_cert=Key/ca.pem
  110. server_cert=Key/server.pem
  111. private_key=Key/server.key
  112. private_key_passwd=passphrase
  113. eap_sim_db=unix:/tmp/hlr_auc_gw.sock db=eap_sim.db
  114. subscr_remediation_url=https://subscription-server.osu.example.com/hs20/spp.php
  115. EOF
  116. # Set RADIUS passphrase for the APs
  117. # Note: Modify to match the setup
  118. cat > /home/user/hs20-server/AS/as.radius_clients <<EOF
  119. 0.0.0.0/0 radius
  120. EOF
  121. Start RADIUS authentication server
  122. ----------------------------------
  123. cd /home/user/hs20-server/AS
  124. ./hostapd -B as-sql.conf
  125. Configure web server
  126. --------------------
  127. Edit /etc/apache2/sites-available/default-ssl
  128. Add following block just before "SSL Engine Switch" line":
  129. Alias /hs20/ "/home/user/hs20-server/www/"
  130. <Directory "/home/user/hs20-server/www/">
  131. Options Indexes MultiViews FollowSymLinks
  132. AllowOverride None
  133. Order allow,deny
  134. Allow from all
  135. </Directory>
  136. Update SSL configuration to use the OSU server certificate/key.
  137. Enable default-ssl site and restart Apache2:
  138. sudo a2ensite default-ssl
  139. sudo a2enmod ssl
  140. sudo service apache2 restart
  141. Management UI
  142. -------------
  143. The sample PHP scripts include a management UI for testing
  144. purposes. That is available at https://<server>/hs20/users.php
  145. AP configuration
  146. ----------------
  147. APs can now be configured to use the OSU server as the RADIUS
  148. authentication server. In addition, the OSU Provider List ANQP element
  149. should be configured to use the SPP (SOAP+XML) option and with the
  150. following Server URL:
  151. https://<server>/hs20/spp.php/signup?realm=example.com