]>
git.ipfire.org Git - ipfire-2.x.git/blob - html/cgi-bin/tripwire.cgi
2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2007 Michael Tremer & Christian Schmidt #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
20 ###############################################################################
23 # enable only the following on debugging purpose
25 #use CGI::Carp 'fatalsToBrowser';
27 require '/var/ipfire/general-functions.pl';
28 require "${General::swroot}/lang.pl";
29 require "${General::swroot}/header.pl";
31 my %tripwiresettings = ();
35 my $errormessage = "";
36 my @Logs = `ls -r /var/ipfire/tripwire/report/ 2>/dev/null`;
37 my $file = `ls -tr /var/ipfire/tripwire/report/ | tail -1 2>/dev/null`;
38 my @cronjobs = `ls /etc/fcron.daily/tripwire* 2>/dev/null`;
39 my $Log =$Lang::tr
{'no log selected'};
42 my %mainsettings = ();
43 &General
::readhash
("${General::swroot}/main/settings", \
%mainsettings);
44 &General
::readhash
("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \
%color);
46 ############################################################################################################################
47 ################################################# Tripwire Default Variablen ################################################
49 $tripwiresettings{'ROOT'} = '/usr/sbin';
50 $tripwiresettings{'POLFILE'} = '/var/ipfire/tripwire/tw.pol';
51 $tripwiresettings{'DBFILE'} = '/var/ipfire/tripwire/$(HOSTNAME).twd';
52 $tripwiresettings{'REPORTFILE'} = '/var/ipfire/tripwire/report/$(DATE).twr';
53 $tripwiresettings{'SITEKEYFILE'} = '/var/ipfire/tripwire/site.key';
54 $tripwiresettings{'LOCALKEYFILE'} = '/var/ipfire/tripwire/local.key';
55 $tripwiresettings{'EDITOR'} = '/usr/bin/vi';
56 $tripwiresettings{'LATEPROMPTING'} = 'false';
57 $tripwiresettings{'LOOSEDIRECTORYCHECKING'} = 'false';
58 $tripwiresettings{'MAILNOVIOLATIONS'} = 'false';
59 $tripwiresettings{'EMAILREPORTLEVEL'} = '3';
60 $tripwiresettings{'REPORTLEVEL'} = '3';
61 $tripwiresettings{'MAILMETHOD'} = 'SENDMAIL';
62 $tripwiresettings{'SMTPHOST'} = 'ipfire.myipfire.de';
63 $tripwiresettings{'SMTPPORT'} = '25';
64 $tripwiresettings{'SYSLOGREPORTING'} = 'false';
65 $tripwiresettings{'MAILPROGRAM'} = '/usr/sbin/sendmail -oi -t';
66 $tripwiresettings{'SITEKEY'} = 'ipfire';
67 $tripwiresettings{'LOCALKEY'} = 'ipfire';
68 $tripwiresettings{'ACTION'} = '';
70 &General
::readhash
("${General::swroot}/tripwire/settings", \
%tripwiresettings);
72 ############################################################################################################################
73 ######################################################### Tripwire HTML Part ###############################################
75 &Header
::showhttpheaders
();
77 &Header
::getcgihash
(\
%tripwiresettings);
78 &Header
::openpage
('Tripwire', 1,);
79 &Header
::openbigbox
('100%', 'left', '', $errormessage);
81 ############################################################################################################################
82 ############################################### Tripwire Config Datei erstellen ############################################
84 if ($tripwiresettings{'ACTION'} eq $Lang::tr
{'save'})
86 system("/usr/local/bin/tripwirectrl readconfig >/dev/null 2>&1");
87 open (FILE
, ">${General::swroot}/tripwire/twcfg.txt") or die "Can't save tripwire config: $!";
92 ROOT =$tripwiresettings{'ROOT'}
93 POLFILE =$tripwiresettings{'POLFILE'}
94 DBFILE =$tripwiresettings{'DBFILE'}
95 REPORTFILE =$tripwiresettings{'REPORTFILE'}
96 SITEKEYFILE =$tripwiresettings{'SITEKEYFILE'}
97 LOCALKEYFILE =$tripwiresettings{'LOCALKEYFILE'}
98 EDITOR =$tripwiresettings{'EDITOR'}
99 LATEPROMPTING =$tripwiresettings{'LATEPROMPTING'}
100 LOOSEDIRECTORYCHECKING =$tripwiresettings{'LOOSEDIRECTORYCHECKING'}
101 MAILNOVIOLATIONS =$tripwiresettings{'MAILNOVIOLATIONS'}
102 EMAILREPORTLEVEL =$tripwiresettings{'EMAILREPORTLEVEL'}
103 REPORTLEVEL =$tripwiresettings{'REPORTLEVEL'}
104 MAILMETHOD =$tripwiresettings{'MAILMETHOD'}
105 SMTPHOST =$tripwiresettings{'SMTPHOST'}
106 SMTPPORT =$tripwiresettings{'SMTPPORT'}
107 SYSLOGREPORTING =$tripwiresettings{'SYSLOGREPORTING'}
108 MAILPROGRAM =$tripwiresettings{'MAILPROGRAM'}
114 &General
::writehash
("${General::swroot}/tripwire/settings", \
%tripwiresettings);
115 system("/usr/local/bin/tripwirectrl lockconfig >/dev/null 2>&1");
118 ############################################################################################################################
119 ################################################## Sicherheitsabfrage für CGI ##############################################
121 if ($tripwiresettings{'ACTION'} eq 'addcron')
125 <table width='95%' cellspacing='0'>
126 <tr><td bgcolor='$color{'color20'}' colspan='2' align='center'><b>$Lang::tr{'add cron'}</b>
127 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
128 <tr><td align='center' colspan='2'>HH<input type='text' size='2' name='HOUR' value='08'/>MM<input type='text' size='2' name='MINUTE' value='00'/><br /><br /></td></tr>
129 <tr><td align='right' width='50%'>
130 $Lang::tr{'ok'} <input type='image' alt='$Lang::tr{'ok'}' title='$Lang::tr{'ok'}' src='/images/edit-redo.png' />
131 <input type='hidden' name='ACTION' value='addcronyes' /></form></td>
132 <td align='left' width='50%'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
133 <input type='image' alt='$Lang::tr{'cancel'}' title='$Lang::tr{'cancel'}' src='/images/dialog-error.png' /> $Lang::tr{'cancel'}
134 <input type='hidden' name='ACTION' value='cancel' /></form></td>
141 if ($tripwiresettings{'ACTION'} eq 'globalreset')
145 <table width='95%' cellspacing='0'>
146 <tr><td bgcolor='$color{'color20'}' colspan='2' align='center'><b>$Lang::tr{'resetglobals'}</b>
147 <tr><td colspan='2' align='center'><font color=red>$Lang::tr{'defaultwarning'}<br /><br /></font></td></tr>
148 <tr><td align='right' width='50%'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
149 $Lang::tr{'ok'} <input type='image' alt='$Lang::tr{'ok'}' title='$Lang::tr{'ok'}' src='/images/edit-redo.png' />
150 <input type='hidden' name='ACTION' value='globalresetyes' /></form></td>
151 <td align='left' width='50%'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
152 <input type='image' alt='$Lang::tr{'cancel'}' title='$Lang::tr{'cancel'}' src='/images/dialog-error.png' /> $Lang::tr{'cancel'}
153 <input type='hidden' name='ACTION' value='cancel' /></form></td>
160 if ($tripwiresettings{'ACTION'} eq 'generatepolicypw')
164 <table width='95%' cellspacing='0'>
165 <tr><td bgcolor='$color{'color20'}' colspan='2' align='center'><b>$Lang::tr{'generatepolicy'}</b>
166 <tr><td colspan='2' align='center'><font color=red>$Lang::tr{'tripwirewarningpolicy'}<br /><br /></font></td></tr>
167 <tr><td align='left' width='40%'><form method='post' action='$ENV{'SCRIPT_NAME'}'>$Lang::tr{'sitekey'}</td><td align='left'><input type='password' name='SITEKEY' value='$tripwiresettings{'SITEKEY'}' size="30" /></td></tr>
168 <tr><td align='left' width='40%'><form method='post' action='$ENV{'SCRIPT_NAME'}'>$Lang::tr{'localkey'}</td><td align='left'><input type='password' name='LOCALKEY' value='$tripwiresettings{'LOCALKEY'}' size="30" /><br /><br /></td></tr>
169 <tr><td align='right' width='50%'>
170 $Lang::tr{'ok'} <input type='image' alt='$Lang::tr{'ok'}' title='$Lang::tr{'ok'}' src='/images/edit-redo.png' />
171 <input type='hidden' name='ACTION' value='generatepolicyyes' /></form></td>
172 <td align='left' width='50%'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
173 <input type='image' alt='$Lang::tr{'cancel'}' title='$Lang::tr{'cancel'}' src='/images/dialog-error.png' /> $Lang::tr{'cancel'}
174 <input type='hidden' name='ACTION' value='cancel' /></form></td>
181 if ($tripwiresettings{'ACTION'} eq 'policyresetpw')
185 <table width='95%' cellspacing='0'>
186 <tr><td bgcolor='$color{'color20'}' colspan='2' align='center'><b>$Lang::tr{'resetpolicy'}</b>
187 <tr><td colspan='2' align='center'><font color=red>$Lang::tr{'tripwirewarningpolicy'}<br /><br /></font></td></tr>
188 <tr><td align='left' width='40%'><form method='post' action='$ENV{'SCRIPT_NAME'}'>$Lang::tr{'sitekey'}</td><td align='left'><input type='password' name='SITEKEY' value='$tripwiresettings{'SITEKEY'}' size="30" /></td></tr>
189 <tr><td align='left' width='40%'><form method='post' action='$ENV{'SCRIPT_NAME'}'>$Lang::tr{'localkey'}</td><td align='left'><input type='password' name='LOCALKEY' value='$tripwiresettings{'LOCALKEY'}' size="30" /><br /><br /></td></tr>
190 <tr><td align='right' width='50%'>
191 $Lang::tr{'ok'} <input type='image' alt='$Lang::tr{'ok'}' title='$Lang::tr{'ok'}' src='/images/edit-redo.png' />
192 <input type='hidden' name='ACTION' value='resetpolicyyes' /></form></td>
193 <td align='left' width='50%'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
194 <input type='image' alt='$Lang::tr{'cancel'}' title='$Lang::tr{'cancel'}' src='/images/dialog-error.png' /> $Lang::tr{'cancel'}
195 <input type='hidden' name='ACTION' value='cancel' /></form></td>
202 if ($tripwiresettings{'ACTION'} eq 'updatedatabasepw')
206 <table width='95%' cellspacing='0'>
207 <tr><td bgcolor='$color{'color20'}' colspan='2' align='center'><b>$Lang::tr{'updatedatabase'}</b>
208 <tr><td colspan='2' align='center'><font color=red>$Lang::tr{'tripwirewarningdatabase'}<br /><br /></font></td></tr>
209 <tr><td align='left' width='40%'><form method='post' action='$ENV{'SCRIPT_NAME'}'>$Lang::tr{'localkey'}</td><td align='left'><input type='password' name='LOCALKEY' value='$tripwiresettings{'LOCALKEY'}' size="30" /><br /><br /></td></tr>
210 <tr><td align='right' width='50%'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
211 $Lang::tr{'ok'} <input type='image' alt='$Lang::tr{'ok'}' title='$Lang::tr{'ok'}' src='/images/edit-redo.png' />
212 <input type='hidden' name='ACTION' value='updatedatabaseyes' /></form></td>
213 <td align='left' width='50%'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
214 <input type='image' alt='$Lang::tr{'cancel'}' title='$Lang::tr{'cancel'}' src='/images/dialog-error.png' /> $Lang::tr{'cancel'}
215 <input type='hidden' name='ACTION' value='cancel' /></form></td>
221 if ($tripwiresettings{'ACTION'} eq 'keyreset')
225 <table width='95%' cellspacing='0'>
226 <tr><td bgcolor='$color{'color20'}' colspan='2' align='center'><b>$Lang::tr{'keyreset'}</b>
227 <tr><td colspan='2' align='center'><font color=red>$Lang::tr{'tripwirewarningkeys'}<br /><br /></font></td></tr>
228 <tr><td align='right' width='50%'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
229 $Lang::tr{'ok'} <input type='image' alt='$Lang::tr{'ok'}' title='$Lang::tr{'ok'}' src='/images/edit-redo.png' />
230 <input type='hidden' name='ACTION' value='keyresetyes' /></form></td>
231 <td align='left' width='50%'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
232 <input type='image' alt='$Lang::tr{'cancel'}' title='$Lang::tr{'cancel'}' src='/images/dialog-error.png' /> $Lang::tr{'cancel'}
233 <input type='hidden' name='ACTION' value='cancel' /></form></td>
240 if ($tripwiresettings{'ACTION'} eq 'generatekeys')
244 <table width='95%' cellspacing='0'>
245 <tr><td bgcolor='$color{'color20'}' colspan='2' align='center'><b>$Lang::tr{'generatekeys'}</b>
246 <tr><td colspan='2' align='center'><font color=red>$Lang::tr{'tripwirewarningkeys'}<br /><br /></font></td></tr>
247 <tr><td align='right' width='50%'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
248 $Lang::tr{'ok'} <input type='image' alt='$Lang::tr{'ok'}' title='$Lang::tr{'ok'}' src='/images/edit-redo.png' />
249 <input type='hidden' name='ACTION' value='generatekeysyes' /></form></td>
250 <td align='left' width='50%'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
251 <input type='image' alt='$Lang::tr{'cancel'}' title='$Lang::tr{'cancel'}' src='/images/dialog-error.png' /> $Lang::tr{'cancel'}
252 <input type='hidden' name='ACTION' value='cancel' /></form></td>
259 ############################################################################################################################
260 ######################################################## Tripwire Funktionen ###############################################
262 if ($tripwiresettings{'ACTION'} eq 'globalresetyes')
264 &Header
::openbox
( 'Waiting', 1, "<meta http-equiv='refresh' content='1;'>" );print "<center><img src='/images/clock.gif' alt='' /><br/><font color='red'>$Lang::tr{'tripwireoperating'}</font></center>";&Header
::closebox
();
265 $tripwiresettings{'ROOT'} = '/usr/sbin';
266 $tripwiresettings{'POLFILE'} = '/var/ipfire/tripwire/tw.pol';
267 $tripwiresettings{'DBFILE'} = '/var/ipfire/tripwire/$(HOSTNAME).twd';
268 $tripwiresettings{'REPORTFILE'} = '/var/ipfire/tripwire/report/$(DATE).twr';
269 $tripwiresettings{'SITEKEYFILE'} = '/var/ipfire/tripwire/site.key';
270 $tripwiresettings{'LOCALKEYFILE'} = '/var/ipfire/tripwire/local.key';
271 $tripwiresettings{'EDITOR'} = '/usr/bin/vi';
272 $tripwiresettings{'LATEPROMPTING'} = 'false';
273 $tripwiresettings{'LOOSEDIRECTORYCHECKING'} = 'false';
274 $tripwiresettings{'MAILNOVIOLATIONS'} = 'false';
275 $tripwiresettings{'EMAILREPORTLEVEL'} = '3';
276 $tripwiresettings{'REPORTLEVEL'} = '3';
277 $tripwiresettings{'MAILMETHOD'} = 'SENDMAIL';
278 $tripwiresettings{'SMTPHOST'} = 'ipfire.myipfire.de';
279 $tripwiresettings{'SMTPPORT'} = '25';
280 $tripwiresettings{'SYSLOGREPORTING'} = 'false';
281 $tripwiresettings{'MAILPROGRAM'} = '/usr/sbin/sendmail -oi -t';
282 $tripwiresettings{'SITEKEY'} = 'ipfire';
283 $tripwiresettings{'LOCALKEY'} = 'ipfire';
284 $tripwiresettings{'ACTION'} = '';
285 system("/usr/local/bin/tripwirectrl readconfig >/dev/null 2>&1");
286 open (FILE
, ">${General::swroot}/tripwire/twcfg.txt") or die "Can't save tripwire config: $!";
290 ROOT =$tripwiresettings{'ROOT'}
291 POLFILE =$tripwiresettings{'POLFILE'}
292 DBFILE =$tripwiresettings{'DBFILE'}
293 REPORTFILE =$tripwiresettings{'REPORTFILE'}
294 SITEKEYFILE =$tripwiresettings{'SITEKEYFILE'}
295 LOCALKEYFILE =$tripwiresettings{'LOCALKEYFILE'}
296 EDITOR =$tripwiresettings{'EDITOR'}
297 LATEPROMPTING =$tripwiresettings{'LATEPROMPTING'}
298 LOOSEDIRECTORYCHECKING =$tripwiresettings{'LOOSEDIRECTORYCHECKING'}
299 MAILNOVIOLATIONS =$tripwiresettings{'MAILNOVIOLATIONS'}
300 EMAILREPORTLEVEL =$tripwiresettings{'EMAILREPORTLEVEL'}
301 REPORTLEVEL =$tripwiresettings{'REPORTLEVEL'}
302 MAILMETHOD =$tripwiresettings{'MAILMETHOD'}
303 SMTPHOST =$tripwiresettings{'SMTPHOST'}
304 SMTPPORT =$tripwiresettings{'SMTPPORT'}
305 SYSLOGREPORTING =$tripwiresettings{'SYSLOGREPORTING'}
306 MAILPROGRAM =$tripwiresettings{'MAILPROGRAM'}
311 &General
::writehash
("${General::swroot}/tripwire/settings", \
%tripwiresettings);
312 system("/usr/local/bin/tripwirectrl lockconfig >/dev/null 2>&1l");
313 system("/usr/local/bin/tripwirectrl keys ipfire ipfire >/dev/null 2>&1");$tripwiresettings{'SITEKEY'} = 'ipfire';$tripwiresettings{'LOCALKEY'} = 'ipfire';
315 if ($tripwiresettings{'ACTION'} eq 'generatekeysyes'){&Header
::openbox
( 'Waiting', 1, "<meta http-equiv='refresh' content='1;'>" );print "<center><img src='/images/clock.gif' alt='' /><br/><font color='red'>$Lang::tr{'tripwireoperating'}</font></center>";system("/usr/local/bin/tripwirectrl keys $tripwiresettings{'SITEKEY'} $tripwiresettings{'LOCALKEY'} >/dev/null 2>&1");$tripwiresettings{'SITEKEY'} = 'ipfire';$tripwiresettings{'LOCALKEY'} = 'ipfire';}
316 if ($tripwiresettings{'ACTION'} eq 'keyresetyes'){&Header
::openbox
( 'Waiting', 1, "<meta http-equiv='refresh' content='1;'>" );print "<center><img src='/images/clock.gif' alt='' /><br/><font color='red'>$Lang::tr{'tripwireoperating'}</font></center>";system("/usr/local/bin/tripwirectrl keys ipfire ipfire >/dev/null 2>&1");$tripwiresettings{'SITEKEY'} = 'ipfire';$tripwiresettings{'LOCALKEY'} = 'ipfire';}
317 if ($tripwiresettings{'ACTION'} eq 'resetpolicyyes'){&Header
::openbox
( 'Waiting', 1, "<meta http-equiv='refresh' content='1;'>" );print "<center><img src='/images/clock.gif' alt='' /><br/><font color='red'>$Lang::tr{'tripwireoperating'}</font></center>";system("/usr/local/bin/tripwirectrl resetpolicy tripwiresettings{'SITEKEY'} $tripwiresettings{'LOCALKEY'} >/dev/null 2>&1");$tripwiresettings{'SITEKEY'} = 'ipfire';$tripwiresettings{'LOCALKEY'} = 'ipfire';}
318 if ($tripwiresettings{'ACTION'} eq 'generatepolicyyes'){&Header
::openbox
( 'Waiting', 1, "<meta http-equiv='refresh' content='1;'>" );print "<center><img src='/images/clock.gif' alt='' /><br/><font color='red'>$Lang::tr{'tripwireoperating'}</font></center>";system("/usr/local/bin/tripwirectrl generatepolicy $tripwiresettings{'SITEKEY'} $tripwiresettings{'LOCALKEY'} >/dev/null 2>&1");$tripwiresettings{'SITEKEY'} = 'ipfire';$tripwiresettings{'LOCALKEY'} = 'ipfire';}
319 if ($tripwiresettings{'ACTION'} eq 'updatedatabaseyes'){&Header
::openbox
( 'Waiting', 1, "<meta http-equiv='refresh' content='1;'>" );print "<center><img src='/images/clock.gif' alt='' /><br/><font color='red'>$Lang::tr{'tripwireoperating'}</font></center>";system("/usr/local/bin/tripwirectrl updatedatabase $tripwiresettings{'LOCALKEY'} /var/ipfire/tripwire/report/$file >/dev/null 2>&1");$tripwiresettings{'LOCALKEY'} = 'ipfire';}
320 if ($tripwiresettings{'ACTION'} eq 'generatereport'){&Header
::openbox
( 'Waiting', 1, "<meta http-equiv='refresh' content='1;'>" );print "<center><img src='/images/clock.gif' alt='' /><br/><font color='red'>$Lang::tr{'tripwireoperating'}</font></center>";system("/usr/local/bin/tripwirectrl generatereport >/dev/null 2>&1");}
321 if ($tripwiresettings{'ACTION'} eq 'addcronyes'){system("/usr/local/bin/tripwirectrl addcron $tripwiresettings{'HOUR'} $tripwiresettings{'MINUTE'} >/dev/null 2>&1");}
322 if ($tripwiresettings{'ACTION'} eq 'deletecron'){system("/usr/local/bin/tripwirectrl disablecron $tripwiresettings{'CRON'} >/dev/null 2>&1");@cronjobs = `ls /etc/fcron.daily/tripwire* 2>/dev/null`;}
324 ############################################################################################################################
325 ##################################################### Tripwire globale Optionen ############################################
327 &Header
::openbox
('100%', 'center', 'Tripwire');
331 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
332 <table width='95%' cellspacing='0'>
333 <tr bgcolor='$color{'color20'}'><td colspan='2' align='left'><b>$Lang::tr{'basic options'}</b></td></tr>
334 <tr><td align='left' width='40%'>$Lang::tr{'emailreportlevel'}</td><td align='left'><input type='text' name='EMAILREPORTLEVEL' value='$tripwiresettings{'EMAILREPORTLEVEL'}' size="30" /></td></tr>
335 <tr><td align='left' width='40%'>$Lang::tr{'reportlevel'}</td><td align='left'><input type='text' name='REPORTLEVEL' value='$tripwiresettings{'REPORTLEVEL'}' size="30" /></td></tr>
336 <tr><td align='left' width='40%'>$Lang::tr{'mailmethod'}</td><td align='left'><input type='text' name='MAILMETHOD' value='$tripwiresettings{'MAILMETHOD'}' size="30" /></td></tr>
337 <tr><td align='left' width='40%'>$Lang::tr{'smtphost'}</td><td align='left'><input type='text' name='SMTPHOST' value='$tripwiresettings{'SMTPHOST'}' size="30" /></td></tr>
338 <tr><td align='left' width='40%'>$Lang::tr{'smtpport'}</td><td align='left'><input type='text' name='SMTPPORT' value='$tripwiresettings{'SMTPPORT'}' size="30" /></td></tr>
339 <tr><td align='left' width='40%'>$Lang::tr{'mailprogramm'}</td><td align='left'><input type='text' name='MAILPROGRAM' value='$tripwiresettings{'MAILPROGRAM'}' size="30" /></td></tr>
342 <table width='10%' cellspacing='0'>
343 <tr><td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
344 <input type='hidden' name='ACTION' value=$Lang::tr{'save'} />
345 <input type='image' alt='$Lang::tr{'save'}' title='$Lang::tr{'save'}' src='/images/media-floppy.png' /></form></td>
346 <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
347 <input type='hidden' name='ACTION' value='globalreset' />
348 <input type='image' alt='$Lang::tr{'reset'}' title='$Lang::tr{'reset'}' src='/images/reload.gif' /></form></td>
349 <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
350 <input type='hidden' name='ACTION' value='globalcaption' />
351 <input type='image' alt='$Lang::tr{'caption'}' title='$Lang::tr{'caption'}' src='/images/help-browser.png' /></form></td></tr>
356 if ($tripwiresettings{'ACTION'} eq 'globalcaption')
360 <table width='95%' cellspacing='0'>
361 <tr><td align='center' colspan='2'><b>$Lang::tr{'caption'}</b></td></tr>
362 <tr><td align='right' width='33%'><img src='/images/media-floppy.png' alt='$Lang::tr{'save settings'}' /></td><td align='left'>$Lang::tr{'save settings'}</td></tr>
363 <tr><td align='right' width='33%'><img src='/images/reload.gif' alt='$Lang::tr{'restore settings'}' /></td><td align='left'>$Lang::tr{'restore settings'}</td></tr>
372 ############################################################################################################################
373 ################################################### Tripwire Init Policy and keygen ########################################
375 &Header
::openbox
('100%', 'center', $Lang::tr
{'generate tripwire keys and init'});
379 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
380 <table width='95%' cellspacing='0'>
381 <tr bgcolor='$color{'color20'}'><td colspan='2' align='left'><b>$Lang::tr{'keys'}</b></td></tr>
382 <tr><td align='left' width='40%'>$Lang::tr{'sitekey'}</td><td align='left'><input type='password' name='SITEKEY' value='$tripwiresettings{'SITEKEY'}' size="30" /></td></tr>
383 <tr><td align='left' width='40%'>$Lang::tr{'localkey'}</td><td align='left'><input type='password' name='LOCALKEY' value='$tripwiresettings{'LOCALKEY'}' size="30" /></td></tr>
386 <table width='10%' cellspacing='0'>
387 <tr><td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
388 <input type='hidden' name='ACTION' value='generatekeys'/>
389 <input type='image' alt='$Lang::tr{'generatekeys'}' title='$Lang::tr{'generatekeys'}' src='/images/system-lock-screen.png' /></form></td>
390 <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
391 <input type='hidden' name='ACTION' value='keyreset' />
392 <input type='image' alt='$Lang::tr{'reset'}' title='$Lang::tr{'reset'}' src='/images/reload.gif' /></form></td>
393 <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
394 <input type='hidden' name='ACTION' value='keycaption' />
395 <input type='image' alt='$Lang::tr{'caption'}' title='$Lang::tr{'caption'}' src='/images/help-browser.png' /></form></td></tr>
400 if ($tripwiresettings{'ACTION'} eq 'keycaption')
404 <table width='95%' cellspacing='0'>
405 <tr><td align='center' colspan='2'><b>$Lang::tr{'caption'}</b></td></tr>
406 <tr><td align='right' width='33%'><img src='/images/system-lock-screen.png' alt='$Lang::tr{'generatekeys'}' /></td><td align='left'>$Lang::tr{'generatekeys'}</td></tr>
407 <tr><td align='right' width='33%'><img src='/images/reload.gif' alt='$Lang::tr{'keyreset'}' /></td><td align='left'>$Lang::tr{'keyreset'}</td></tr>
416 ############################################################################################################################
417 ################################################# Tripwire general functions ###############################################
419 &Header
::openbox
('100%', 'center', $Lang::tr
{'tripwire functions'});
423 <table width='95%' cellspacing='0'>
424 <tr><td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
425 <input type='hidden' name='ACTION' value='generatepolicypw'/>
426 <input type='image' alt='$Lang::tr{'generatepolicy'}' title='$Lang::tr{'generatepolicy'}' src='/images/document-new.png' /></form></td>
427 <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
428 <input type='hidden' name='ACTION' value='policyresetpw' />
429 <input type='image' alt='$Lang::tr{'resetpolicy'}' title='$Lang::tr{'resetpolicy'}' src='/images/reload.gif' /></form></td>
430 <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
431 <input type='hidden' name='ACTION' value='generatereport' />
432 <input type='image' alt='$Lang::tr{'generatereport'}' title='$Lang::tr{'generatereport'}' src='/images/document-properties.png' /></form></td>
433 <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
434 <input type='hidden' name='ACTION' value='updatedatabasepw' />
435 <input type='image' alt='$Lang::tr{'updatedatabase'}' title='$Lang::tr{'updatedatabase'}' src='/images/network-server.png' /></form></td>
436 <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
437 <input type='hidden' name='ACTION' value='policycaption' />
438 <input type='image' alt='$Lang::tr{'caption'}' title='$Lang::tr{'caption'}' src='/images/help-browser.png' /></form></td></tr>
442 if ($tripwiresettings{'ACTION'} eq 'policycaption')
446 <table width='95%' cellspacing='0'>
447 <tr><td align='center' colspan='2'><b>$Lang::tr{'caption'}</b></td></tr>
448 <tr><td align='right' width='33%'><img src='/images/document-new.png' alt='$Lang::tr{'generatepolicy'}' /></td><td align='left'>$Lang::tr{'generatepolicy'}</td></tr>
449 <tr><td align='right' width='33%'><img src='/images/reload.gif' alt='$Lang::tr{'resetpolicy'}' /></td><td align='left'>$Lang::tr{'resetpolicy'}</td></tr>
450 <tr><td align='right' width='33%'><img src='/images/document-properties.png' alt='$Lang::tr{'generatereport'}' /></td><td align='left'>$Lang::tr{'generatereport'}</td></tr>
451 <tr><td align='right' width='33%'><img src='/images/network-server.png' alt='$Lang::tr{'updatedatabase'}' /></td><td align='left'>$Lang::tr{'updatedatabase'}</td></tr>
459 ############################################################################################################################
460 ####################################################### Tripwire Log View ##################################################
462 &Header
::openbox
('100%', 'center', $Lang::tr
{'tripwire reports'});
464 <a name="$Lang::tr{'log view'}"</a>
466 <form method='post' action='$ENV{'SCRIPT_NAME'}#$Lang::tr{'log view'}'>
467 <table width='95%' cellspacing='0'>
468 <tr><td bgcolor='$color{'color20'}' colspan='3' align='left'><b>$Lang::tr{'log view'}</b></td></tr>
469 <tr><td colspan='3' align='left'><br /></td></tr>
470 <tr><td align='left'><select name='LOG' style="width: 500px">
473 foreach my $log (@Logs) {chomp $log;print"<option value='$log'>$log</option>";}
476 </select></td><td align='left'><input type='hidden' name='ACTION' value='showlog' /><input type='image' alt='view Log' title='view log' src='/images/format-justify-fill.png' /></td></tr>
481 if ($tripwiresettings{'ACTION'} eq 'showlog')
483 $Log = qx(/usr/local/bin/tripwirectrl tripwirelog
$tripwiresettings{'LOG'});
484 $Log=~s/--cfgfile \/var\/ipfire\
/tripwire\/tw
.cfg
--polfile \
/var\/ipfire\
/tripwire\/tw
.pol
//g;
486 <table width='95%' cellspacing='0'>
487 <tr><td><br /></td></tr>
488 <tr><td><pre>$Log</pre></td></tr>
489 <tr><td><br /></td></tr>
490 <tr><td align='center'>$tripwiresettings{'LOG'}</td></tr>
499 ############################################################################################################################
500 ####################################################### Tripwire Cronjob ##################################################
502 #&Header::openbox('100%', 'center', $Lang::tr{'tripwire cronjob'});
505 #<table width='95%' cellspacing='0'>
506 #<tr><td colspan='3' align='left'><br /></td></tr>
509 #foreach my $cronjob (@cronjobs) {chomp $cronjob;my $time=$cronjob; $time=~s/\/etc\/fcron.daily\/tripwire//g;print"<form method='post' action='$ENV{'SCRIPT_NAME'}'><tr><td align='left' colspan='2'>$cronjob at $time daily</td><td><input type='hidden' name='ACTION' value='deletecron' /><input type='hidden' name='CRON' value='$time' /><input type='image' alt='delete cron' title='delete cron' src='/images/user-trash.png' /></td></tr></form>";}
513 #<table width='10%' cellspacing='0'>
514 #<tr><td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
515 # <input type='hidden' name='ACTION' value='addcron'/>
516 # <input type='image' alt='$Lang::tr{'add cron'}' title='$Lang::tr{'add cron'}' src='/images/appointment-new.png' /></form></td>
517 #<td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
518 # <input type='hidden' name='ACTION' value='croncaption' />
519 # <input type='image' alt='$Lang::tr{'caption'}' title='$Lang::tr{'caption'}' src='/images/help-browser.png' /></form></td></tr>
524 #if ($tripwiresettings{'ACTION'} eq 'croncaption')
528 #<table width='95%' cellspacing='0'>
529 #<tr><td align='center' colspan='2'><b>$Lang::tr{'caption'}</b></td></tr>
530 #<tr><td align='right' width='33%'><img src='/images/appointment-new.png' /></td><td align='left'>$Lang::tr{'add cron'}</td></tr>
531 #<tr><td align='right' width='33%'><img src='/images/user-trash.png' /></td><td align='left'>$Lang::tr{'delete cron'}</td></tr>
537 #&Header::closebox();
539 &Header
::closebigbox
();
540 &Header
::closepage
();