config.debian-8.6.patch 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. diff -ru default-ori /etc/freeradius/sites-available/default
  2. --- original/freeradius/sites-available/default 2010-11-14 18:13:00.000000000 -0300
  3. +++ /etc/freeradius/sites-available/default 2011-11-15 11:49:55.081320643 -0300
  4. --- original/freeradius/sql.conf 2017-01-20 15:42:22.990386917 -0300
  5. +++ /etc/freeradius/sql.conf 2017-01-20 15:42:49.831448774 -0300
  6. @@ -64,7 +64,7 @@
  7. # If set to 'yes' (default) we read the group tables
  8. # If set to 'no' the user MUST have Fall-Through = Yes in the radreply table
  9. - # read_groups = yes
  10. + read_groups = yes
  11. # Remove stale session if checkrad does not see a double login
  12. deletestalesessions = yes
  13. @@ -105,7 +105,7 @@
  14. # and security reasons, finding clients via SQL queries CANNOT
  15. # be done "live" while the server is running.
  16. #
  17. - #readclients = yes
  18. + readclients = yes
  19. # Table to keep radius client info
  20. nas_table = "nas"
  21. --- etc/freeradius/dialup-mod.conf 2017-01-20 15:43:21.836720515 -0300
  22. +++ /etc/freeradius/sql/mysql/dialup.conf 2017-01-20 15:43:24.924843537 -0300
  23. @@ -287,17 +287,17 @@
  24. #######################################################################
  25. # Uncomment simul_count_query to enable simultaneous use checking
  26. - #simul_count_query = "SELECT COUNT(*) \
  27. - #FROM ${acct_table1} \
  28. - #WHERE username = '%{SQL-User-Name}' \
  29. - #AND acctstoptime IS NULL"
  30. + simul_count_query = "SELECT COUNT(*) \
  31. + FROM ${acct_table1} \
  32. + WHERE username = '%{SQL-User-Name}' \
  33. + AND acctstoptime IS NULL"
  34. - simul_verify_query = "SELECT radacctid, acctsessionid, username, \
  35. - nasipaddress, nasportid, framedipaddress, \
  36. - callingstationid, framedprotocol \
  37. - FROM ${acct_table1} \
  38. - WHERE username = '%{SQL-User-Name}' \
  39. - AND acctstoptime IS NULL"
  40. +# simul_verify_query = "SELECT radacctid, acctsessionid, username, \
  41. +# nasipaddress, nasportid, framedipaddress, \
  42. +# callingstationid, framedprotocol \
  43. +# FROM ${acct_table1} \
  44. +# WHERE username = '%{SQL-User-Name}' \
  45. +# AND acctstoptime IS NULL"
  46. #######################################################################
  47. # Authentication Logging Queries
  48. +++ /etc/freeradius/radiusd.conf 2017-01-20 15:43:40.509465219 -0300
  49. --- etc/freeradius/radiusd-mod.conf 2017-01-20 15:43:37.969363797 -0300
  50. @@ -473,7 +473,7 @@
  51. #
  52. # allowed values: {no, yes}
  53. #
  54. - auth = no
  55. + auth = yes
  56. # Log passwords with the authentication requests.
  57. # auth_badpass - logs password if it's rejected
  58. @@ -481,8 +481,8 @@
  59. #
  60. # allowed values: {no, yes}
  61. #
  62. - auth_badpass = no
  63. - auth_goodpass = no
  64. + auth_badpass = yes
  65. + auth_goodpass = yes
  66. # Log additional text at the end of the "Login OK" messages.
  67. # for these to work, the "auth" and "auth_goopass" or "auth_badpass"
  68. @@ -740,7 +740,7 @@
  69. # Include another file that has the SQL-related configuration.
  70. # This is another file only because it tends to be big.
  71. #
  72. -# $INCLUDE sql.conf
  73. + $INCLUDE sql.conf
  74. #
  75. # This module is an SQL enabled version of the counter module.
  76. +++ /etc/freeradius/policy.conf 2017-01-20 15:44:04.126409923 -0300
  77. --- etc/freeradius/policy-mod.conf 2017-01-20 15:43:58.002164648 -0300
  78. @@ -56,6 +56,56 @@
  79. # If you want the server to pretend that it is dead,
  80. # then use the "do_not_respond" policy.
  81. #
  82. +
  83. + # Rewrite password if password is empty and user-name have mac format
  84. + rewrite_password {
  85. + if (User-Name =~ /([0-9a-f]{2})[-:]([0-9a-f]{2})[-:]([0-9a-f]{2})[-:]([0-9a-f]{2})[-:]([0-9a-f]{2})[-:]([0-9a-f]{2})/i){
  86. + if (Password||CHAP-Password){
  87. +
  88. + #update request {
  89. + # User-Name := "%{1}%{2}%{3}%{4}%{5}%{6}"
  90. + #}
  91. + update request{
  92. + Password := "%{User-Name}"
  93. + }
  94. + update control {
  95. + Auth-Type = 'PAP'
  96. + }
  97. + }
  98. +
  99. + }
  100. + else {
  101. + noop
  102. + }
  103. + }
  104. +
  105. + #
  106. + # Rewrite called station id attribute into a standard format.
  107. + #
  108. + rewrite_calling_station_id {
  109. + if (Calling-Station-Id =~ /([0-9a-f]{2})[-:]?([0-9a-f]{2})[-:]?([0-9a-f]{2})[-:]?([0-9a-f]{2})[-:]?([0-9a-f]{2})[-:]?([0-9a-f]{2})/i){
  110. + if(Calling-Statind-Id == User-Name){
  111. + #update request {
  112. + # User-Name := "%{1}%{2}%{3}%{4}%{5}%{6}"
  113. + #}
  114. +
  115. + if(Password||CHAP-Password){
  116. + update request{
  117. + Password := "%{User-Name}"
  118. + }
  119. + update control {
  120. + Auth-Type = 'PAP'
  121. + }
  122. + }
  123. + }
  124. + }
  125. + else {
  126. + noop
  127. + }
  128. + }
  129. +
  130. +
  131. +
  132. do_not_respond {
  133. update control {
  134. Response-Packet-Type := Do-Not-Respond
  135. +++ /etc/freeradius/sites-available/default 2017-01-20 15:48:10.227616980 -0300
  136. --- etc/freeradius/default-mod 2017-01-20 15:48:22.860091196 -0300
  137. @@ -66,6 +66,7 @@
  138. #
  139. # Make *sure* that 'preprocess' comes before any realm if you
  140. # need to setup hints for the remote radius server
  141. +server radius {
  142. authorize {
  143. #
  144. # Security settings. Take a User-Name, and do some simple
  145. @@ -93,6 +94,16 @@
  146. # section, above.
  147. # auth_log
  148. + # Machine (Calling-Station-ID based) authentication
  149. + #
  150. + # RFC 2865 says that a Service-Type value of Call Check is used
  151. + # to specify this kind of authentication (though were now dealing with ethernet ports instead of lines).
  152. + #
  153. + rewrite_password
  154. + rewrite_calling_station_id
  155. +
  156. +
  157. +
  158. #
  159. # The chap module will set 'Auth-Type := CHAP' if we are
  160. # handling a CHAP request and Auth-Type has not already been set
  161. @@ -167,14 +178,15 @@
  162. #
  163. # Read the 'users' file
  164. - files
  165. + #files
  166. #
  167. # Look in an SQL database. The schema of the database
  168. # is meant to mirror the "users" file.
  169. #
  170. # See "Authorization Queries" in sql.conf
  171. -# sql
  172. + dupsess
  173. + sql
  174. #
  175. # If you are using /etc/smbpasswd, and are also doing
  176. @@ -333,6 +345,16 @@
  177. preacct {
  178. preprocess
  179. + #
  180. + # Authentication based on Calling-Station-ID
  181. + #
  182. + # Calling-Station-ID authentication is usually done by comparing normalised
  183. + # forms of the Calling-Station-ID and User-name fields.
  184. + #
  185. +
  186. + rewrite_calling_station_id
  187. +
  188. +
  189. #
  190. # Session start times are *implied* in RADIUS.
  191. # The NAS never sends a "start time". Instead, it sends
  192. @@ -364,12 +386,12 @@
  193. # Accounting requests are generally proxied to the same
  194. # home server as authentication requests.
  195. # IPASS
  196. - suffix
  197. +# suffix
  198. # ntdomain
  199. #
  200. # Read the 'acct_users' file
  201. - files
  202. + #files
  203. }
  204. #
  205. @@ -403,7 +425,7 @@
  206. # Log traffic to an SQL database.
  207. #
  208. # See "Accounting queries" in sql.conf
  209. -# sql
  210. + sql
  211. #
  212. # If you receive stop packets with zero session length,
  213. @@ -447,11 +469,11 @@
  214. # or rlm_sql module can handle this.
  215. # The rlm_sql module is *much* faster
  216. session {
  217. - radutmp
  218. + #radutmp
  219. #
  220. # See "Simultaneous Use Checking Queries" in sql.conf
  221. -# sql
  222. + sql
  223. }
  224. @@ -472,7 +494,7 @@
  225. # After authenticating the user, do another SQL query.
  226. #
  227. # See "Authentication Logging Queries" in sql.conf
  228. -# sql
  229. + sql
  230. #
  231. # Instead of sending the query to the SQL server,
  232. @@ -657,4 +679,4 @@
  233. # detail
  234. # }
  235. }
  236. -
  237. +}