Subversion Repositories ALCASAR

Rev

Rev 2455 | Rev 2810 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2455 Rev 2527
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: security.php 2455 2017-12-09 19:14:05Z tom.houdayer $
2
# $Id: security.php 2527 2018-04-16 08:49:00Z fabien.rako $
3
 
3
 
4
//gestion de la langue
4
//gestion de la langue
5
require('../lib/langues.php');
5
require('../lib/langues.php');
6
 
6
 
7
$language = 'en';
7
$language = 'en';
Line 14... Line 14...
14
} else {
14
} else {
15
	$l_title = 'Security';
15
	$l_title = 'Security';
16
}
16
}
17
 
17
 
18
$tab = (isset($_GET['tab'])) ? intval($_GET['tab']) : 1;
18
$tab = (isset($_GET['tab'])) ? intval($_GET['tab']) : 1;
-
 
19
 
19
?>
20
?>
-
 
21
 
20
<!DOCTYPE html>
22
 
21
<html>
23
<html>
22
<head>
24
<head>
23
	<meta charset="UTF-8">
25
	<meta charset="UTF-8">
24
	<title><?= $l_title ?></title>
26
	<title><?= $l_title ?></title>
25
	<link rel="stylesheet" href="/css/bootstrap.min.css">
27
	<link rel="stylesheet" href="/css/bootstrap.min.css">
26
	<script src="/js/jquery.min.js"></script>
28
	<script src="/js/jquery.min.js"></script>
27
	<script src="/js/bootstrap.min.js"></script>
29
	<script src="/js/bootstrap.min.js"></script>
-
 
30
	<link rel="stylesheet" href="style.css">
28
	<style>
31
	<style>
29
		body {
32
		body {
30
			background-color: #EFEFEF;
33
			background-color: #EFEFEF;
31
		}
34
		}
32
	</style>
35
	</style>
33
</head>
36
</head>
-
 
37
 
34
<body>
38
<body>
-
 
39
<table  class="tableTop" border=0 cellspacing=0 cellpadding=0 >
-
 
40
	<tbody >	
35
<br>
41
		<tr>
-
 
42
			<th class="thBasicACC">
-
 
43
				<?echo "$l_title";?>
-
 
44
			</th>
-
 
45
		</tr>
-
 
46
		<tr bgcolor="#FFCC66" class="trSizeACC">
-
 
47
			<td class="tdSizeACC">
-
 
48
				<img src="/images/pix.gif" width=1 height=2>
-
 
49
			</td>
-
 
50
		</tr>
-
 
51
	</tbody>
-
 
52
</table>
-
 
53
 
-
 
54
<div class="frameBorderACC">
-
 
55
 
36
<div class="btn-group btn-group-justified" role="group" aria-label="Justified button group"> 
56
<div class="btn-group btn-group-justified" role="group" aria-label="Justified button group"> 
37
	<a href="security.php?tab=1" class="btn btn-default<?= (($tab === 1) ? ' active' : '') ?>" role="button"><?= $l_spoofing ?></a> 
57
	<a href="security.php?tab=1" class="btn btn-default<?= (($tab === 1) ? ' active' : '') ?>" role="button"><?= $l_spoofing ?></a> 
38
	<a href="security.php?tab=2" class="btn btn-default<?= (($tab === 2) ? ' active' : '') ?>" role="button"><?= $l_virus ?></a>
58
	<a href="security.php?tab=2" class="btn btn-default<?= (($tab === 2) ? ' active' : '') ?>" role="button"><?= $l_virus ?></a>
39
	<a href="security.php?tab=3" class="btn btn-default<?= (($tab === 3) ? ' active' : '') ?>" role="button"><?= $l_fail2ban ?></a>  
59
	<a href="security.php?tab=3" class="btn btn-default<?= (($tab === 3) ? ' active' : '') ?>" role="button"><?= $l_fail2ban ?></a>  
40
</div>
60
</div>
Line 65... Line 85...
65
		fclose($file);
85
		fclose($file);
66
	}
86
	}
67
 
87
 
68
	$spoofs = array_reverse($spoofs);
88
	$spoofs = array_reverse($spoofs);
69
?>
89
?>
70
	<h3 style="text-align: center;"><?= $l_spoofing ?></h3>
90
<h3 style="text-align: center;"><?= $l_spoofing ?></h3>
71
	<div class="container">
91
	<div class="container">
-
 
92
		<table style='font-family: "DejaVu Sans";font-size: small;color: #666650;' class="table table-striped  tableBis table-hover" border="1">		
-
 
93
				<tr>
72
		<table class="table table-striped table-hover">
94
					<th class="thSecurityBis" >
73
			<thead>
95
						Date
-
 
96
					</th>
-
 
97
					<th class="thSecurityBis">
74
				<tr><th>Date</th><th><?= $l_ipAddress ?></th><th>MAC</th><th><?= $l_user ?></th></tr>
98
						<?= $l_ipAddress ?>	
-
 
99
					</th>
-
 
100
					<th class="thSecurityBis">
-
 
101
						MAC
75
			</thead>
102
					</th>
-
 
103
					<th class="thSecurityBis">
-
 
104
						<?= $l_user ?>
-
 
105
					</th>
-
 
106
				</tr>
76
			<tbody>
107
			<tbody>
77
				<?php if (!empty($spoofs)): ?>
108
				<?php if (!empty($spoofs)): ?>
78
					<?php foreach ($spoofs as $spoof): ?>
109
					<?php foreach ($spoofs as $spoof): ?>
79
						<tr><td><?= $spoof->date ?></td><td><?= $spoof->ip ?></td><td><?= $spoof->mac ?></td><td><?= $spoof->user ?></td></tr>
110
						<tr><td><?= $spoof->date ?></td><td><?= $spoof->ip ?></td><td><?= $spoof->mac ?></td><td><?= $spoof->user ?></td></tr>
80
					<?php endforeach; ?>
111
					<?php endforeach; ?>
Line 82... Line 113...
82
					<tr><td colspan="4" style="text-align: center;"><?= $l_empty ?></td></tr>
113
					<tr><td colspan="4" style="text-align: center;"><?= $l_empty ?></td></tr>
83
				<?php endif; ?>
114
				<?php endif; ?>
84
			</tbody>
115
			</tbody>
85
		</table>
116
		</table>
86
	</div>
117
	</div>
-
 
118
</table>
87
<?php
119
<?php
88
} else if ($tab === 2) {
120
} else if ($tab === 2) {
89
	$filePath = '/var/log/havp/access.log';
121
	$filePath = '/var/log/havp/access.log';
90
	$lines = file($filePath);
122
	$lines = file($filePath);
91
	if ($lines === false) {
123
	if ($lines === false) {
Line 94... Line 126...
94
 
126
 
95
	$lines = array_reverse($lines);
127
	$lines = array_reverse($lines);
96
?>
128
?>
97
	<h3 style="text-align: center;"><?= $l_virus ?></h3>
129
	<h3 style="text-align: center;"><?= $l_virus ?></h3>
98
	<div class="container">
130
	<div class="container">
-
 
131
 
99
		<table class="table table-striped table-hover">
132
		<table class="table table-striped table-hover">
100
			<tbody>
133
			<tbody>
101
				<?php if (!empty($lines)): ?>
134
				<?php if (!empty($lines)): ?>
102
					<?php foreach ($lines as $line): ?>
135
					<?php foreach ($lines as $line): ?>
103
						<tr><td><?= $line ?></td></tr>
136
						<tr><td><?= $line ?></td></tr>
Line 139... Line 172...
139
	}
172
	}
140
 
173
 
141
	$bans = array_reverse($bans);
174
	$bans = array_reverse($bans);
142
?>
175
?>
143
	<h3 style="text-align: center;"><?= $l_fail2ban ?></h3>
176
	<h3 style="text-align: center;"><?= $l_fail2ban ?></h3>
144
	<div class="container">
177
	<div class="container" border="1">
145
		<table class="table table-striped table-hover">
178
		<table  class="table tableBis table-striped table-hover" border="1">
146
			<thead>
179
				<tr >
-
 
180
					<th class="thSecurityBis" >
-
 
181
						Date
-
 
182
					</th>
-
 
183
					<th class="thSecurityBis" >
-
 
184
						Date Unban
-
 
185
					</th>
-
 
186
					<th class="thSecurityBis" >
-
 
187
						<?= $l_rule ?>
-
 
188
					</th>
-
 
189
					<th class="thSecurityBis" >
147
				<tr><th>Date</th><th>Date Unban</th><th><?= $l_rule ?></th><th><?= $l_ipAddress ?></th></tr>
190
						<?= $l_ipAddress ?>
148
			</thead>
191
					</th>
149
			<tbody>
192
				</tr>
150
				<?php if (!empty($bans)): ?>
193
				<?php if (!empty($bans)): ?>
151
					<?php foreach ($bans as $ban): ?>
194
					<?php foreach ($bans as $ban): ?>
-
 
195
						<tr>
-
 
196
							<td>
-
 
197
								<?= $ban->date_ban ?>
-
 
198
							</td>
-
 
199
							<td>
152
						<tr><td><?= $ban->date_ban ?></td><td><?= $ban->date_unban ?></td><td><?= $ban->rule ?></td><td><?= $ban->ip ?></td></tr>
200
								<?= $ban->date_unban ?>
-
 
201
							</td>
-
 
202
							<td>
-
 
203
								<?= $ban->rule ?>
-
 
204
							</td>
-
 
205
							<td>
-
 
206
								<?= $ban->ip ?>
-
 
207
							</td>
-
 
208
						</tr>
153
					<?php endforeach; ?>
209
					<?php endforeach; ?>
154
				<?php else: ?>
210
				<?php else: ?>
155
					<tr><td colspan="4" style="text-align: center;"><?= $l_empty ?></td></tr>
211
					<tr><td colspan="4" style="text-align: center;"><?= $l_empty ?></td></tr>
156
				<?php endif; ?>
212
				<?php endif; ?>
157
			</tbody>
-
 
158
		</table>
213
		</table>
159
	</div>
214
	</div>
160
<?php
215
<?php
161
} else {
216
} else {
162
	echo 'Unknown tab';
217
	echo 'Unknown tab';
163
}
218
}
164
?>
219
?>
-
 
220
</div>
165
</body>
221
</body>
166
</html>
222
</html>