#!/usr/local/bin/php -q
<?php
/*
** Copyright (C) 2000 Carnegie Mellon University
**
** Author: Roman Danyliw <rdd@cert.org>, <roman@danyliw.com>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

/*  
 * Analysis Console for Incident Databases (ACID) by Roman Danyliw
 *
 * This application was developed at the CERT Coordination Center as a part 
 * of the AIRCERT project.
 *
 * See http://www.cert.org/kb/acid for the most up to date 
 * information and documentation about this application.
 *
 * Purpose:
 *
 *   ACID is an PHP-based analysis engine to search and process 
 *   a database of security incidents generated by the NIDS Snort.
 *
 * Configuration:
 *
 *   See the 'README' file, and 'acid.conf'
 *
 */
?>
<?php
  $start = time();

  include("acid_conf.php");
  include("acid_include.inc");
  # include_once("acid_common.php");
  include_once("acid_db_common.php");


?>

Analysis Console for Incident Databases (ACID) <?php echo $ACID_VERSION ?>

<?php

  /* Check that PHP was built correctly */
  $tmp_str = verify_php_build($DBtype);
  if ( $tmp_str != "")
  {
     echo $tmp_str;
     die();
  }

  /* Connect to the Alert database */
  $db = NewACIDDBConnection($DBlib_path, $DBtype);
  $db->acidDBConnect($db_connect_method,
                     $alert_dbname, $alert_host, $alert_port, $alert_user, $alert_password);

  /* Check that the DB schema is recent */
  $tmp_str = verify_db($db, $alert_dbname, $alert_host);
  if ( $tmp_str != "")
  {
     echo $tmp_str;
     die();
  }

  if ( $event_cache_auto_update == 1 )  UpdateAlertCache($db);
?>


