OSDN Git Service

e6df2468a466fe64b9dce02f1e5544a607992fe9
[opengatem/opengatem.git] / conf / opengatemmng.conf.sample
1 <?xml version="1.0"?>
2 <Opengatemmng ConfigVersion="0.7.5">
3
4         <!-- #########################################################
5              ## Opengate gateway server hostname(FQDN or IP address)## -->
6         <OpengateServerName>opengate.example.com</OpengateServerName>
7
8         <!-- Debug dump level -->
9         <!-- Set 0 to write only open/close and error messages to syslog -->
10         <!-- Set 1 to write some information adding to 0 -->
11         <!-- Set 2 to write many information to syslog -->
12         <!-- Set 3 to write more information to syslog -->
13         <Debug>1</Debug>
14
15         <!-- Syslog (local0, local1, .., local7)-->
16         <Syslog>
17                 <Enable>1</Enable>
18                 <Facility>local1</Facility>
19         </Syslog>
20
21         <!-- ### MUST BE MODIFIED ## -->
22         <!-- network interface device name -->
23         <Device>fxp0</Device> 
24
25         <!-- ### MUST BE MODIFIED ## -->
26         <!-- auth server setting for administrators(watanaby,admin1,admin2) -->
27         <AuthServer>
28                 <UserType>admin</UserType>
29                 <Protocol>pop3s</Protocol>
30                 <Address>192.168.0.2</Address>
31                 <AcceptUsers>watanaby admin1 admin2</AcceptUsers>
32         </AuthServer>
33
34         <!-- ### MUST BE MODIFIED ## -->
35         <!-- auth server setting for normal(not admin) users  -->
36         <AuthServer>
37                 <Protocol>shibboleth</Protocol>
38                 <UidAttribute>uid</UidAttribute>
39                 <EppnAttribute>eppn</EppnAttribute>
40                 <MailAttribute>mail</MailAttribute>
41         </AuthServer>
42
43         <!-- ### MUST BE MODIFIED ## -->
44         <!-- # Set hosts where opengateMd (daemon) is running # --> 
45         <!-- Daemon acts as UDP server and opengateMmng as clients -->
46         <!-- DB update is transmitted immediately with this UDP --> 
47         <!-- (If failed, update is transmitted after cache timeout) --> 
48         <!-- Following set the servers [address port] receiving UDP -->
49         <!-- Be care to set firewall properly to pass the packet -->
50         <UdpServer>127.0.0.1 4989</UdpServer>
51         <!-- <UdpServer>192.168.1.1 4989</UdpServer> -->
52         <!-- <UdpServer>192.168.2.1 4989</UdpServer> -->
53         <!-- <UdpServer>192.168.3.1 4989</UdpServer> -->
54
55         <!-- ### MUST BE MODIFIED ## -->
56         <!-- MySql database (for mac address management) parameters -->
57         <MySqlDb>
58                 <Server>localhost</Server>
59                 <User>root</User>
60                 <Password></Password>
61                 <Database>opengatem</Database>
62         </MySqlDb>
63
64         <!-- ### MUST BE MODIFIED ## -->
65         <!-- Terminal allowed to register by owner oneself -->
66         <!-- The terminal type is checked by http-agent pattern 
67         having the form of "POSIX Extended Regular Expression".
68         Matching is sensitive to upper/lower case. 
69         If set NULL string, ALL agents are allowed -->
70         <!-- Can set multiple pattern tags. -->
71
72         <!-- TO ACTIVATE AGENT FILTER, REMOVE THIS COMMENT OUT TAG
73         <AllowableAgentPattern>iPhone|iPad|iPod|Android</AllowableAgentPattern>
74         <AllowableAgentPattern>Windows Phone|Windows CE</AllowableAgentPattern>
75         <AllowableAgentPattern>BlackBerry|RIM Tablet</AllowableAgentPattern>
76         -->
77
78         <!--  on click, network is opened in this time and closed (Sec) -->
79         <OpenTimeout>60</OpenTimeout>
80
81         <!-- SQLite busy timeout (milli-seconds) -->
82         <SqliteBusyTimeout>100</SqliteBusyTimeout>
83         
84         <!-- SQLite database file -->
85         <!-- opengatemd work db -->
86         <SqliteDbMd>/tmp/opengatemd.db</SqliteDbMd>
87
88         <!-- opengatemmng work db -->
89         <SqliteDbMmng>/tmp/opengatemng.db</SqliteDbMmng>
90
91         <!-- SQLite database file -->
92         <!-- for opengate session management -->
93         <SqliteDb>/tmp/opengate.db</SqliteDb>
94
95         <!-- IPFW rule number range and tag number used by opengate -->
96         <IpfwRule>
97                 <Min>10000</Min>
98                 <Max>40000</Max>
99                 <Interval>1</Interval>
100         </IpfwRule>
101
102         <!-- Ipfw is opened via perl script(1) or direct from C(0) -->
103         <IpfwScript>
104                 <Enable>0</Enable>
105                 <Path>/etc/opengate/ipfwctrlmd.pl</Path>
106         </IpfwScript>
107
108         <!-- IPFW Tag number used in rc.firewall -->
109         <IpfwTagNumber>123</IpfwTagNumber>
110
111         <!-- Related command path -->
112         <IpfwPath>/sbin/ipfw</IpfwPath>
113
114         <!-- ipfw exclusive exec lock timeout (second) -->
115         <LockTimeout>10</LockTimeout>
116
117         <!-- Lock file to prevent overlapped ipfw rule number -->
118         <!-- exclusive execution to opengate processes -->
119         <LockFile>/tmp/opengate.lock</LockFile>
120
121         <!-- daemon programs -->
122         <MacCheckDaemon>opengatemd</MacCheckDaemon>
123
124         <!-- Lock file to prevent overlapped daemon proc -->
125         <DaemonLockFile>/tmp/opengatemd.lock</DaemonLockFile>
126
127         <!-- Maximum count of register devices for one user -->
128         <MaxDevices>5</MaxDevices>
129
130         <!-- Mac Address Expiration Date(in MySql Date Format) -->
131         <LimitDate>adddate(last_day(adddate(now(),interval 15 day)),interval 1 day)</LimitDate>
132
133         <!-- The Date to Show Log in Web Page(in MySql Date Format) -->
134         <ShowLogAfter>adddate(now(), interval -1 month)</ShowLogAfter>
135
136         <!-- Available HTML languages (first lang is used as default) -->
137         <HtmlLangs>ja en</HtmlLangs>
138
139         <!-- Path to Apache Contents -->
140         <DocumentRoot>/usr/local/www/apache24/data</DocumentRoot>
141         <CgiDir>/cgi-bin</CgiDir>
142         <OpengateDir>/opengate</OpengateDir>
143
144         <!-- HTML Documents (in each language dir)-->
145         <DenyDoc>macdeny.html</DenyDoc>
146         <CheckDoc>macchk.html</CheckDoc>
147         <RegisterDoc>macreg.html</RegisterDoc>
148         <UpdateDoc>macupdate.html</UpdateDoc>
149         <AuthDoc>macauth.html</AuthDoc>
150         <AuthAdminDoc>macauth.html</AuthAdminDoc>
151         <OwnRegisterDoc>macreg.html</OwnRegisterDoc>
152         <OwnUpdateDoc>macupdate.html</OwnUpdateDoc>
153         <FwdDoc>macfwd.html</FwdDoc>
154         <ReturnDoc>macreturn.html</ReturnDoc>
155
156         <!-- timeout for above return jump -->
157         <ReturnWaitTime>3</ReturnWaitTime>
158
159         <!-- Related command path -->
160         <ArpPath>/usr/sbin/arp</ArpPath>
161         <NdpPath>/usr/sbin/ndp</NdpPath>
162
163         <!-- CGIs -->
164         <CheckCgi>opengatemchk.cgi</CheckCgi>
165         <RegisterCgi>opengatemreg.cgi</RegisterCgi>
166         <UpdateCgi>opengatemup.cgi</UpdateCgi>
167         <OwnCgi>opengatemown.cgi</OwnCgi>
168         <JumpCgi>opengatemown.cgi</JumpCgi> <!-- to insert page, modify this -->
169         <FwdCgi>opengatemfwd.cgi</FwdCgi>
170
171         <!-- maximum request count per day to modify mac registraion -->
172         <MaxMacModifyPerDay>30</MaxMacModifyPerDay>
173
174         <!-- cookie name to hold the dmin/user authentication state -->
175         <AuthAdminCookie>OpengatemAdmin</AuthAdminCookie>
176         <AuthUserCookie>OpengatemUser</AuthUserCookie>
177
178         <!-- Limit Date Warning Mail -->
179         <Mail>
180                 <CmdPath>/bin/rmail</CmdPath>
181                 <Content>/etc/opengate/warningmail</Content>
182                 <Timing>date(now())=date(adddate(limitDate, interval -7 day)) or date(now())=date(adddate(limitDate, interval -1 day))</Timing>
183         </Mail>
184
185         <!-- Separate char between userID and extraID [userID@extraID] -->
186         <UserIdSeparator>@</UserIdSeparator>
187
188 </Opengatemmng> 
189 <!-- ## End of Configuration ## -->
190
191
192 <!-- ## Following is only documentation ## -->
193
194
195 <!--    ######################################
196         ###### About AuthServer setting ######
197         
198         ########### Format ############# 
199                 {a|b}: a or b, set one of them 
200                 [ x ]: x is optional
201                  -x- : x is a value
202         
203         #### TYPE 1 (POP or FTP) ####
204         <AuthServer>
205                 <Protocol>{pop3|pop3s|ftp|ftpse|ftpsi}</Protocol>
206                 <Address>{-hostname-|-ip_address-}</Address>
207                 [ <Port>-portno-</Port> ]
208                 [ <Timeout>-seconds-</Timeout> ]
209                 [<MailDomain>-mail-address-after-@-</MailDomain>]
210         </AuthServer>
211         #   AuthOK, if request by <Protocol> is accepted by <Address>.
212         #   Address is FQDN or IP address       
213         #   If <Port> is not defined, port number in /etc/services is used.
214         #   The request is aborted at <Timeout> seconds.
215         #   If <Timeout> is not defined, system value is used.
216         #   pop3s is SSLed pop3
217         #   ftpse is SSLed ftp run in Explicit mode. 
218         #   ftpsi is SSLed ftp run in Implicit mode.
219
220         #   MailDomain indicates the domain to which warning mail is sent.
221         #    if userid=watanaby and MailDomain=og.saga-u.ac.jp, 
222         #     time-limit-warning-mail is sent to watanaby@og.saga-u.ac.jp.
223
224         #### TYPE 2 (PAM) ####
225         <AuthServer>
226                 <Protocol>pam</Protocol>
227                 [ <ServiceName>-servicename_in_pam_conf-</ServiceName> ]
228                 [ <Timeout>-second-</Timeout> ]
229                 [<MailDomain>-mail-address-after-@-</MailDomain>]
230         </AuthServer>
231         #   Auth by PAM
232         #   If not define <ServiceName>, "opengate" is used in "pam.conf".
233
234         #### TYPE 3 (RADIUS) ####
235         <AuthServer>
236                 <Protocol>radius</Protocol>
237                 [ <ConfFile>-path_to_radius_conf-</ConfFile> ]
238                 [ <Timeout>-second-</Timeout> ]
239                 [<MailDomain>-mail-address-after-@-</MailDomain>]
240         </AuthServer>
241         #   Auth by RADIUS
242         #   If not define <ConfigFile>, "/etc/radius.conf" is used.
243         
244         #### TYPE 4 (LDAP) ####
245         <AuthServer>
246                 <Protocol>ldap</Protocol>
247                 <Uri>-uri-of-ldap-server-</Uri>
248                 <BaseDN>-ldap_base_dn_to_search-</BaseDN>
249                 [ <Timeout>-second-</Timeout> ]
250                 [<MailDomain>-mail-address-after-@-</MailDomain>]
251         </AuthServer>
252         #   Auth by LDAP/LDAPS
253         #   Uri examples
254         #     'ldap://foo.bar.com' for NonSSL
255         #     'ldaps://foo.bar.com' for SSL
256         #     'ldaps://foo.bar.com:1234' to use specific port
257         
258         #### TYPE 5 (ACCEPT or DENY) ####
259         <AuthServer>
260                 <Protocol>{accept|deny}</Protocol>
261                 [<MailDomain>-mail-address-after-@-</MailDomain>]
262         </AuthServer>
263         #   The user is accepted or denied without inquiring auth.
264         #   ***This setting is prepared for debugging***
265
266         #### TYPE 6 (Shibboleth) ####
267         <AuthServer>
268                 <Protocol>shibboleth</Protocol>
269                 <UidAttribute>-env-vars-for-uid-</UidAttribute>
270                 [<OrgAttribute>-env-vars-for-uid-</OrgAttribute>]
271                 [<EppnAttribute>-env-vars-for-eppn-</EppnAttribute>]
272                 [<MailAttribute>-env-vars-for-mail-address-</MailAttribute>]
273                 [<MailDomain>-mail-address-after-@-</MailDomain>]
274         </AuthServer>
275         #   Auth by Shibboleth
276
277         #   'UidAttiribute' means the environment variable having UserId
278         #       in the organization.
279         #     E.G., 
280         #     <UidAttribute>uid persistent-id targeted-id</UidAttribute>
281         #       left item has priority, if not found, search next item
282
283         #   'OrgAttiribute' means the environment variable having Organization
284         #     E.G., 
285         #     <OrgAttribute>o affiliation Shib-Identity-Provider</OrgAttribute>
286         #       left item has priority, if not found, search next item
287
288         #   'EppnAttiribute' means the environment variable having
289         #     ePPN(edu person pricipal name 'user@org') or other global id 
290         #     E.G., 
291         #     <EppnAttribute>eppn mail</EppnAttribute>
292         #       left item has priority, if not found, search next item
293
294         #     If Uid and Eppn are defined, Uid has priority.
295
296         #   'MailAttiribute' means the environment variable for mail-address
297         #     E.G., 
298         #     <MailAttribute>mail</MailAttribute>
299         #       left item has priority, if not found, search next item
300
301         #   Set 'opengatemXXX.cgi as 'shibboleth' in .htaccess
302         #    <FILES opengatemXXX.cgi>
303         #      AuthType shibboleth
304         #      ShibRequestSetting requireSession 1
305         #      ShibRequireSession On
306         #      ShibUseHeaders On
307         #      require valid-user
308         #    </FILES>
309         #    ***Only one Shibboleth setting is permitted in conf***
310
311         #### TYPE 7 (Http Basic) ####
312         <AuthServer>
313                 <Protocol>httpbasic</Protocol>
314                 [<MailDomain>-mail-address-after-@-</MailDomain>]
315         </AuthServer>
316         #   Auth by http-basic
317         #   Set 'opengatemXXX.cgi' as 'Basic' in .htaccess
318         #    <FILES opengateXXX.cgi>
319         #      AuthType Basic
320         #      AuthServerFile /tmp/passwd.dat
321         #      AuthName "User"
322         #      require valid-user
323         #    </FILES>
324         #   environment variable REMOTE_USER is used for userid
325         #   ***Only one Httpbasic setting is permitted in conf***
326
327         #### TYPE 8 (Splash Page Only) ####
328         <AuthServer>
329                 <Protocol>splash</Protocol>
330         </AuthServer>
331         #   No authentication. Splash page only management.
332         #   Use this when you don't want to identify user,
333         #   but only want to show an agreement or usage policy page.
334         #   The message should be described in macfwd.html.
335         #   If accept response is required, remove the Refresh setting.
336
337 -->     
338
339 <!--    ######## Examples of Auth Server Setting ##############
340         <AuthServer>
341                 <Protocol>pop3s</Protocol>
342                 <Address>pop.saga-u.ac.jp</Address>
343                 <Timeout>30</Timeout>
344                 <MailDomain>og.saga-u.ac.jp</MailDomain>
345         </AuthServer>
346
347         <AuthServer>
348                 <Protocol>ldap</Protocol>
349                 <Uri>ldaps://ldap.saga-u.ac.jp</Uri>
350                 <BaseDN>ou=people,dc=saga-u,dc=ac,dc=jp</BaseDN>
351                 <Timeout>5</Timeout>
352                 <MailDomain>og.saga-u.ac.jp</MailDomain>
353         </AuthServer>
354
355         <AuthServer>
356                 <Address>192.168.0.1</Address>
357                 <Protocol>ftpsi</Protocol>
358                 <Timeout>15</Timeout>
359                 <MailDomain>og.saga-u.ac.jp</MailDomain>
360         </AuthServer>
361
362         <AuthServer>
363                 <Protocol>radius</Protocol>
364                 <MailDomain>og.saga-u.ac.jp</MailDomain>
365         </AuthServer>
366
367         <AuthServer>
368                 <Protocol>pam</Protocol>
369                 <MailDomain>og.saga-u.ac.jp</MailDomain>
370         </AuthServer>
371
372         <AuthServer>
373                 <Protocol>shibboleth</Protocol>
374                 <UidAttribute>uid</UidAttribute>
375                 <OrgAttribute>o</OrgAttribute>
376                 <EppnAttribute>eppn</EppnAttribute>
377                 <MailAttribute>mail</MailAttribute>
378         </AuthServer>
379
380         <AuthServer>
381                 <Protocol>httpbasic</Protocol>
382                 <MailDomain>og.saga-u.ac.jp</MailDomain>
383         </AuthServer>
384
385 -->
386
387 <!--    ####### An Example of Multiple authentication servers ######
388         If multiple auth servers are set, check these servers sequentially.
389         When denied by first server, request is sent to the next one.
390         When accepted by a server, following servers are ignored.
391
392         <AuthServer>
393                 setting for first priority
394         </AuthServer>
395         <AuthServer>
396                 setting for second priority
397         </AuthServer>
398         <AuthServer>
399                 setting for third priority
400         </AuthServer>
401
402 -->
403 <!--    ######################################
404         #### Config for exceptional users ####
405  -->
406 <!--    ###### about ExtraSet #######
407
408      <ExtraSet> overwritten on default settings 
409
410         You can switch parameter values by userID and extraID 
411         entered as [userID@extraID] in userID field on auth page.
412         
413         Each <ExtraSet> has conditions such as <.. ExtraId="aaa"> or 
414         <.. UserIdPattern="bbb">, or etc.
415         The conditions is compared with the string entered in 
416         userID field.
417
418         When you set the condition as <.. ExtraId="aaa">, 
419          [extraId] equal to [aaa] is matched (eg, xx@aaa).
420                 
421         When you set the condition as <.. UserIdPattern="bbb">,
422          [userId] including [bbb] is matched (eg, xbbbx@xx).
423
424         When you set the condition as <.. UserExtraPattern="bbb">,
425          [userId@extraId] including [bbb] is matched (eg, xbbbx@xx, aa@xbbbx).
426
427         When you set the condition as <.. UserExtraPatternNot="bbb">,
428          string NOT including [bbb] is matched.
429
430         Pattern has the form of "POSIX Extended Regular Expression".
431         Matching is insensitive to upper/lower case.
432         
433         The <ExtraSet> having multi-conditions is used when both are true.
434         Omitted condition matched to every string. 
435
436         The first matched <ExtraSet> is used, at existing many matched set.
437
438         The paremeters in <ExtraSet> overwrite the default value.
439         When a parameter is not found in <ExtraSet>, the default is used.
440         
441         When userID is entered without extraID, ExtraId matchs to "default".
442         Thus if you want to find [user1] only in default server,
443         use as <ExtraSet ExtraId="default" UserIdPattern="^user1$">.
444
445         Example1 is used when user entered as [any_user@guest],
446         where "any_user" is any string.
447         It means that [xxx@guest] uses different auth server.
448
449         Example2 is used when [anyuser@admin].
450         It means that [xxx@adimin] can use many auth servers.
451
452         Example3 is used when [user1] or [user2].
453         It means that [user1] and [user2] emerge specific syslog(eg. mail).
454 -->
455 <!--    ## ExtraSet sample 1 ##
456         <ExtraSet ExtraId="guest">
457                 <AuthServer>
458                         <Address>192.168.0.1</Address>
459                         <Protocol>ftp</Protocol>
460                 </AuthServer>
461                 <IpfwTagNumber>999</IpfwTagNumber>
462
463         </ExtraSet>
464         ## End of sample 1 ##
465 -->
466 <!--    ## ExtraSet sample 2 ##
467         <ExtraSet ExtraId="admin">
468                 <AuthServer>
469                         <Protocol>pam</Protocol>
470                 </AuthServer>
471                 <AuthServer>
472                         <Address>192.168.0.1</Address>
473                         <Protocol>pop3s</Protocol>
474                         <Timeout>10</Timeout>
475                 </AuthServer>
476                 <AuthServer>
477                         <Address>192.168.0.2</Address>
478                         <Protocol>ftp</Protocol>
479                         <Timeout>10</Timeout>
480                 </AuthServer>
481         </ExtraSet>
482         ## End of sample 2 ##  
483 -->
484 <!--    ## ExtraSet sample 3 ##
485         <ExtraSet ExtraId="default" UserIdPattern="^user1$|^user2$">    
486                 <Syslog>
487                         <Enable>1</Enable>
488                         <Facility>local2</Facility>
489                 </Syslog>
490         </ExtraSet>
491         ## Caution: if no userid is entered, set as userid="?"  ##
492         ## End of sample 3 ##
493 -->