-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbase_db_setup.php
82 lines (71 loc) · 2.72 KB
/
base_db_setup.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
/*******************************************************************************
** Basic Analysis and Security Engine (BASE)
** Copyright (C) 2004 BASE Project Team
** Copyright (C) 2000 Carnegie Mellon University
**
** (see the file 'base_main.php' for license details)
**
** Project Leads: Kevin Johnson <[email protected]>
** Sean Muller <[email protected]>
** Built upon work by Roman Danyliw <[email protected]>, <[email protected]>
**
** Purpose: Create the Database schema
********************************************************************************
** Authors:
********************************************************************************
** Kevin Johnson <[email protected]
**
********************************************************************************
*/
$sc = DIRECTORY_SEPARATOR;
require_once("includes$sc" . 'base_krnl.php');
include("$BASE_path/includes/base_include.inc.php");
include_once("$BASE_path/base_db_common.php");
include_once("$BASE_path/setup/setup_db.inc.php");
$page_title = "DB Setup";
PrintBASESubHeader($page_title, $page_title, _BACK, 1);
?>
<FORM METHOD="POST" ACTION="base_db_setup.php">
<?php
$submit = ImportHTTPVar("submit", VAR_ALPHA | VAR_SPACE);
/* Connect to the Alert database */
$db = NewBASEDBConnection($DBlib_path, $DBtype);
$db->baseDBConnect($db_connect_method,
$alert_dbname, $alert_host, $alert_port, $alert_user, $alert_password);
if ( $submit == "Create BASE AG" ) {
$result = CreateBASEAG($db);
echo '<HR><P>';
}else{
// Set a default on somthing unexpected.
$result = 0;
}
echo '
<TABLE WIDTH="100%">
<TR><TD CLASS="plfieldhdr">Operation</TD>
<TD CLASS="plfieldhdr">Description</TD>
<TD CLASS="plfieldhdr">Status</TD>
</TR>
<TR><TD VALIGN=TOP><B>BASE tables</B></TD>
<TD VALIGN=TOP>Adds tables to extend the Snort DB to support the BASE functionality</TD>
<TD VALIGN=TOP>';
if ($result == 1)
ErrorMessage(" DONE ");
else
echo '<INPUT TYPE="submit" NAME="submit" VALUE="Create BASE AG">';
echo '
</TABLE>';
if ($result == 1)
echo '<P>
The underlying Alert DB is configured for usage with BASE.
<P>
<B>Additional DB permissions</B><BR>
In order to support Alert purging (the selective ability to permanently delete
alerts from the database) and DNS/whois lookup caching,
the DB user "'.$alert_user.'" must have the DELETE and UPDATE privilege
on the database "'.$alert_dbname.'@'.$alert_host.'"
<P>
Goto the <A HREF="base_main.php">Main page</A> to use the application.';
NLIO('</form>',2);
PrintBASESubFooter();
?>