cgi-bin: HTML cleanup, add quotes for attribute values
[people/teissler/ipfire-2.x.git] / html / cgi-bin / tripwire.cgi
Content-type: text/html git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - html/cgi-bin/tripwire.cgi


500 - Internal Server Error

Malformed UTF-8 character (fatal) at (eval 8) line 1, <$fd> line 314.
CommitLineData
92004c61 1#!/usr/bin/perl
70df8302
MT
2###############################################################################
3# #
4# IPFire.org - A linux based firewall #
5# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
6# #
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. #
11# #
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. #
16# #
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/>. #
19# #
20###############################################################################
92004c61
CS
21
22use strict;
23# enable only the following on debugging purpose
cb5e9c6c
CS
24#use warnings;
25#use CGI::Carp 'fatalsToBrowser';
92004c61
CS
26
27require '/var/ipfire/general-functions.pl';
28require "${General::swroot}/lang.pl";
29require "${General::swroot}/header.pl";
30
31my %tripwiresettings = ();
32my %checked = ();
33my %netsettings = ();
34my $message = "";
35my $errormessage = "";
91a08eac
CS
36my @Logs = `ls -r /var/ipfire/tripwire/report/ 2>/dev/null`;
37my $file = `ls -tr /var/ipfire/tripwire/report/ | tail -1 2>/dev/null`;
38my @cronjobs = `ls /etc/fcron.daily/tripwire* 2>/dev/null`;
92004c61
CS
39my $Log =$Lang::tr{'no log selected'};
40
f2fdd0c1
CS
41my %color = ();
42my %mainsettings = ();
43&General::readhash("${General::swroot}/main/settings", \%mainsettings);
44&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
45
92004c61
CS
46############################################################################################################################
47################################################# Tripwire Default Variablen ################################################
48
49$tripwiresettings{'ROOT'} = '/usr/sbin';
50$tripwiresettings{'POLFILE'} = '/var/ipfire/tripwire/tw.pol';
51$tripwiresettings{'DBFILE'} = '/var/ipfire/tripwire/$(HOSTNAME).twd';
71dfc4b7 52$tripwiresettings{'REPORTFILE'} = '/var/ipfire/tripwire/report/$(DATE).twr';
92004c61 53$tripwiresettings{'SITEKEYFILE'} = '/var/ipfire/tripwire/site.key';
71dfc4b7 54$tripwiresettings{'LOCALKEYFILE'} = '/var/ipfire/tripwire/local.key';
92004c61
CS
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';
71dfc4b7
CS
66$tripwiresettings{'SITEKEY'} = 'ipfire';
67$tripwiresettings{'LOCALKEY'} = 'ipfire';
92004c61
CS
68$tripwiresettings{'ACTION'} = '';
69
71dfc4b7
CS
70&General::readhash("${General::swroot}/tripwire/settings", \%tripwiresettings);
71
92004c61
CS
72############################################################################################################################
73######################################################### Tripwire HTML Part ###############################################
74
75&Header::showhttpheaders();
88932936 76
92004c61 77&Header::getcgihash(\%tripwiresettings);
88932936 78&Header::openpage('Tripwire', 1,);
92004c61
CS
79&Header::openbigbox('100%', 'left', '', $errormessage);
80
81############################################################################################################################
82############################################### Tripwire Config Datei erstellen ############################################
83
84if ($tripwiresettings{'ACTION'} eq $Lang::tr{'save'})
85{
91a08eac 86system("/usr/local/bin/tripwirectrl readconfig >/dev/null 2>&1");
71dfc4b7 87open (FILE, ">${General::swroot}/tripwire/twcfg.txt") or die "Can't save tripwire config: $!";
92004c61
CS
88flock (FILE, 2);
89
90print FILE <<END
91
92ROOT =$tripwiresettings{'ROOT'}
93POLFILE =$tripwiresettings{'POLFILE'}
94DBFILE =$tripwiresettings{'DBFILE'}
95REPORTFILE =$tripwiresettings{'REPORTFILE'}
96SITEKEYFILE =$tripwiresettings{'SITEKEYFILE'}
97LOCALKEYFILE =$tripwiresettings{'LOCALKEYFILE'}
98EDITOR =$tripwiresettings{'EDITOR'}
99LATEPROMPTING =$tripwiresettings{'LATEPROMPTING'}
100LOOSEDIRECTORYCHECKING =$tripwiresettings{'LOOSEDIRECTORYCHECKING'}
101MAILNOVIOLATIONS =$tripwiresettings{'MAILNOVIOLATIONS'}
102EMAILREPORTLEVEL =$tripwiresettings{'EMAILREPORTLEVEL'}
103REPORTLEVEL =$tripwiresettings{'REPORTLEVEL'}
104MAILMETHOD =$tripwiresettings{'MAILMETHOD'}
105SMTPHOST =$tripwiresettings{'SMTPHOST'}
106SMTPPORT =$tripwiresettings{'SMTPPORT'}
107SYSLOGREPORTING =$tripwiresettings{'SYSLOGREPORTING'}
108MAILPROGRAM =$tripwiresettings{'MAILPROGRAM'}
109
110END
111;
112close FILE;
113
114&General::writehash("${General::swroot}/tripwire/settings", \%tripwiresettings);
91a08eac 115system("/usr/local/bin/tripwirectrl lockconfig >/dev/null 2>&1");
92004c61
CS
116}
117
118############################################################################################################################
119