ACID: Installation and Configuration
   -  Package:      MySQL
      Version:      3.23.x+
      Description:  Open Source RDBMS
      Reason:       Back-end database
      Homepage:     http://www.mysql.com/
   -  Package:      PostgreSQL
      Version:      7.1+
      Description:  Open Source RDBMS
      Reason:       Back-end database
      Homepage:     http://www.postgresql.org/
   -  Package:      Microsoft SQL Server
      Version:      7.0+
      Description:  RDBMS
      Reason:       Back-end database
      Homepage:     http://www.microsoft.com/
   
 
   -  Package:      Snort
      Version:      1.7+
      Description:  Network Intrusion Detection System
      Reason:       Detects security events
      Homepage:     http://www.snort.org/
   -  Package:      logsnorter
      Version:      0.2+
      Description:  PERL script which parses firewall logs
      Reason:       Detects security events
      Homepage:     http://www.snort.org/downloads/logsnorter-0.2.tar.gz
   - any home-grown script that understands the underlying DB format
   
 
    Package:      PHP
    Version:      4.0.4+
    Description:  Web scripting language
    Reason:       Implementation language of ACID
    Homepage:     http://www.php.net/
                  (Windows builds) http://www.php4win.com/builds/latest-build.php
    
 
   -  Package:      Apache Server
      Version:      1.3.*+
      Description:  HTTP server
      Reason:       Web server for PHP
      Homepage:     http://www.apache.org/
   - PHP supports a number of other web servers (e.g. Netscape, Roxen); any
     of these should also be compatible (although untested).
   
 
    Package:      ADODB  (for ACID v. 0.9.6b2+)
    Version:      1.2+
    Description:  PHP database abstraction library
    Reason:       PHP provides no clean database API
    Homepage:     http://php.weblogs.com/adodb/
    
 
    Package:      PHPlot  (for ACID v. [0.9.6b9 - 0.9.6b21] )
    Version:      4.4.6+
    Description:  PHP chart library
    Reason:       Set of PHP classes over GD to generate charts
    Homepage:     http://www.phplot.com
    Type:         optional
    
 
    Package:      JPGraph (for ACID v. >= 0.9.6b22)
    Version:      1.8+
    Description:  PHP chart library
    Reason:       PHP4 graphing library
    Homepage:     http://www.aditus.nu/jpgraph/
    Type:         optional
    
 
    Package:      GD  (for ACID v. 0.9.6b9+)
    Version:      1.8.*
    Description:  Image manipulation library
    Reason:       Raw JPEG/PNG/GIF support for creating charts
    Homepage:     http://www.boutell.com/gd/
    Type:         optional
    
    
    The following are GD dependencies:
    
      o  Package:      libpng
         Description:  PNG library
         Reason:       PNG format support for GD
         Homepage:     http://www.libpng.org/pub/png/
      o  Package:      libjpeg-6b
         Description:  JPEG library
         Reason:       JPEG format support for GD
         Homepage:     http://www.ijg.org/
      o  Package:      zlib
         Version:      1.8.*
         Description:  compression library
         Reason:       Compression support for GD
         Homepage:     http://www.gzip.org/zlib/
      
 
--with-mysql or --with-postgresql)
    --enable-bcmath)
    --with-gd) and for native whois query
       support socket functionality must be enabled (--enable-sockets)
    
     [for MySQL]
       $ echo "SELECT count(*) FROM event" | mysql snort_db -u root -p
       (Note: the connection parameters used with mysql may vary with your
              configuration. In this case, the mysql client will connect to
              the 'snort_db' database as the 'root' user prompting for a
              password)
       This command should return output similar to the following.
        count(*)
        1
     [for PostgreSQL]
       $ echo "SELECT count(*) FROM event" | psql -d snort_db -U root -W
       (Note: the connection parameters used with psql may vary with your
              configuration. In this case, the PostgreSQL client will connect to
              the 'snort_db' database as the 'root' user prompting for a
              password)
       This command should return output similar to the following.
        count
       -------
       (1 rows) 
    In this example, both the MySQL and PostgreSQL database contained 1 alert.
    If no alerts are found in the database (i.e. a 0 is returned), then (obviously)
    nothing has been successfully logged.
| Database Permission | |||||
| A B L E | SELECT | INSERT | UPDATE | DELETE | |
| acid_ag | X | X | X | ||
| acid_ag_alert | X | X | X | ||
| acid_event | X | X | X | X | |
| acid_ip_cache | X | X | X | X | |
| data | X | X | X | ||
| detail | X | ||||
| encoding | X | ||||
| event | X | X | X | ||
| icmphdr | X | X | X | ||
| iphdr | X | X | X | ||
| opt | X | X | X | ||
| reference | X | X | X | X | |
| reference_system | X | X | X | X | |
| schema | X | ||||
| sensor | X | X | |||
| sig_class | X | X | X | X | |
| sig_reference | X | X | X | X | |
| signature | X | X | X | X | |
| tcphdr | X | X | X | ||
| udphdr | X | X | X | ||
| Database (sequence) Permission | |||||
| A B L E | SELECT | INSERT | UPDATE | DELETE | |
| acid_ag_ag_id_seq | X | X | |||
| reference_ref_id_seq | X | X | |||
| reference_sys_ref_system_id_seq | X | X | |||
| sensor_sid_seq | X | X | |||
| sig_class_sig_class_id_seq | X | X | |||
| signature_sig_id_seq | X | X | |||
The following SQL statement is an example of assigning permissions to database entities (tables).
    [MySQL and PostgreSQL] : GRANT select ON schema TO acid_user
    (Gives the SELECT privilege to the 'schema' table to user 'acid_user')
    
The following is an example of the necessary options to the ./configure script when building from source.
       ./configure [your config options] --with-mysql --with-gd --enable-sockets
       (MySQL support)
       ./configure [your config options] --with-pgsql --with-gd --enable-sockets
       (PostgreSQL support)
 
      In the case where building PHP from source is undesirable or inconvenient (e.g. Windows) binary distributions can be used. However, most do not provide some of the required functionality (e.g. GD or PostgreSQL support). To add this functionality, PHP dynamic module loading (extensions) can be used. Examine the following PHP document for the installation of extensions under Windows, http://www.php.net/manual/en/install-windows.php.
[All OSes]
- Set the 'display_errors' variable to 'off' (display_errors = off) for production deployments of ACID. This setting will prevent debugging messages from being included inline to the HTML. If it is desired to to have some debugging messages sent inline, then it is recommended to at least set the 'error_reporting' variable to 'E_ALL & ~E_NOTICE' (error_reporting = E_ALL & ~E_NOTICE).
- (for ACID <= v0.9.6b21) Set the 'register_globals' variable to 'on' (
register_globals=On)[Windows]
- Set the 'SMTP' variable to refer to your SMTP server.
- Set the 'session.save_path' variable to a temporary directory writable by the web server (e.g. c:\temp).
[UNIX]
- Set the 'sendmail_path' variable to the full path to your mail transfer agent (MTA) such as sendmail.
    [UNIX]
      $ cp adodb112.tgz /home/httpd/html
      $ cd /home/httpd/html
      $ tar xvfz adodb112.tgz
      $ cd ..
    
    [UNIX]
      $ cp phplot-4.4.6.tar.gz /home/httpd/html
      $ cd /home/httpd/html
      $ tar xvfz phplot-4.4.6.tar.gz
      $ cd ..
    
    JPGraph 1.8+
    (for ACID v.0.9.6b22+)
    Uncompress and install JPGraph 1.8+.  This installation should
    involve copying the files into a directory viewable by the web
    server and PHP.
    
    [UNIX]
      $ cp jpgraph1.8.tar.gz /home/httpd/html
      $ cd /home/httpd/html
      $ tar xvfz jpgraph.1.8.tar.gz
      $ cd ..
    
    See the JPGraph README file for additional documentation.
The figure below (Figure 1), shows PHP with GD configured for PNG support (but not GIF).
    
    Figure 1: PHPlot Diagnostic Page 
 
     
    [UNIX]
      $ cp acid-0.9.6.tar.gz /home/httpd/html
      $ cd /home/httpd/html
      $ tar xvfz acid-0.9.6.tar.gz
      $ cd acid
    
[Netscape 4.*]
[Mozilla 0.9.3]
[IE 5.*]
Note: 'acid_conf.php' is PHP code which will be included in each ACID page request. As such, it is imperative that the opening '<?php' and closing '?>' tags not be removed from the file. Likewise, no extra lines can be found before or after these '<?php' '?>' delimiters.The general format of each configuration entry is:All conventions of the PHP language (e.g. comments) apply to the 'acid_conf.php' file. For example, the comment characters are either a '//' or '/* ... */'.
// comment #1 /* multi-line comment #1 multi-line comment #2 */
       $<variable name> = <value>;
    
    Variable names are case sensitive.
    The following options will need to be set with site specific information in order for ACID to function properly. Aside from this minimal configuration, there are a number of other settings which can be tweaked. Please see http://acidlab.sourceforge.net/acid_params.html for an exhaustive list.
       o $DBlib_path     : full path to the ADODB installation
                           (Note: do not include a trailing '\' character)
       o $DBtype         : type of the database used ("mysql", "postgres")
       o $alert_dbname   : alert database name
       o $alert_host     : alert database server
       o $alert_port     : port where the database is stored
       o $alert_user     : username for the alert database
       o $alert_password : password for the username
       [OPTIONAL for alert archiving support]
       o $archive_dbname   : archive/backup database name
       o $archive_host     : archive database server
       o $archive_port     :
       o $archive_user     : "root";
       o $archive_password : "mypassword";
       [OPTIONAL for chart support]
       o $ChartLib_path     : full path to the PHPlot install
                              (Note: do not include a trailing '\' character)
       o $chart_file_format : graphic format to use for generated charts
                              ("png", "jpeg", "gif").  The selected format should
                              have displayed correctly with the PHPlot diagnostic
                              page (see Step 8)
       [OPTIONAL for Snort portscan pre-processor support]
       o $portscan_file  : full path to a Snort portscan log file
    
     
    
Click on the "Setup page" link to be brought to the DB configuration page (acid_db_setup.php). This next page will facilitate the creation of the necessary tables. Click on the "Create ACID AG" buttons as seen below.
     
    
After the tables are created, ACID will return status indicating success.
     
Authorization can also be provided through per-file or per-directory access control methods specific to the web server (e.g. through .htaccess files in Apache). Furthermore, the specific actions which can be performed on the individuals alerts in the database can be controlled to a certain degree through the privileges assigned to the underlying database user configured in ACID. For example, the ability to delete alerts can be easily controlled by granting or revoking the DELETE SQL privilege from the ACID database user. Thus, by create two separate users each set in two different instances of ACID, a read-only and a full-access configuration can be established.