Configuration file setup

Before running the data download and importer, you have to edit the configuration files that rule how the apps will run.

To locate all the configuration files, type the following:


bash$ rpm -qc cvebrowser-tools
/etc/cron.d/cvebrowser-cron-can.sh
/etc/cron.d/cvebrowser-cron-cve.sh
/etc/cvebrowser.conf
/opt/cvebrowser/etc/XMLImporter-can.main.properties
/opt/cvebrowser/etc/XMLImporter-cve.main.properties
/opt/cvebrowser/etc/create_tables.sql
/opt/cvebrowser/etc/cvebrowser.dtd
/opt/cvebrowser/etc/load_metadata.sql
/opt/cvebrowser/etc/sp.po

Each file has comments and some example values that probably you will need to adjust to fit your needs:

/etc/cvebrowser.conf


# CVEBrowser main shell script configuration file.
#
# This is a bash shell script.
# Some of this values comes from the RPM instalation. Please adjust them to reflect your environment.
# Author: Jose Vicente Nunez Zuleta (josevnz@users.sourceforge.net)
#
. /opt/cvebrowser/bin/functions.sh
if [ $? -ne 0 ]; then
        exit $?
fi
# Set this flag to enable the debug mode on the shell scripts. 1=Enable, 0=Disable
declare CVEBROWSER_DEBUG=0
# Classpath declaration
declare -a CLASSPATH_DIRS
CLASSPATH_DIRS[0]=/opt/cvebrowser/lib/cvebrowser-tools-0.3.jar
CLASSPATH_DIRS[1]=/opt/cvebrowser/lib/mysql-connector-java-3.0.6-stable-bin.jar
CLASSPATH_DIRS[2]=/opt/cvebrowser/lib/log4j-1.2.8.jar
CLASSPATH_DIRS[3]=/opt/cvebrowser/lib/java-getopt-1.0.9.jar
# Define the default languaje. Currently supported:
# - en
# - es
CVEBROWSER_DEFAULT_LANGUAJE=en
# Default country. Currently supported: US, VE
CVEBROWSER_DEFAULT_COUNTRY=US
# Set up JAVA_HOME
if [ -z "$JAVA_HOME" ] ; then
        JAVA_HOME="/usr/java/jdk1.5.0";
fi
# Define the CVEBrowser home
CVEBROWSER_HOME="/opt/cvebrowser"
# Set up the CLASSPATH
setClasspath ${CLASSPATH_DIRS[@]}
# Export system wide variables
export PATH JAVA_HOME CLASSPATH CVEBROWSER_HOME CVEBROWSER_DEFAULT_LANGUAJE
export CVEBROWSER_DEFAULT_COUNTRY CVEBROWSER_DEBUG
# Do not preload any library
unset LD_PRELOAD

This Shell script tells where are the Jars libraries, the JDK location, etc. Make sure you edit this variables so they reflect your environment.

/opt/cvebrowser/etc/XMLImporter-can.main.properties


#log4j.rootLogger=DEBUG, console, file
log4j.rootLogger=DEBUG, console
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console=org.apache.log4j.ConsoleAppender
cvebrowser.dictionary.data.persistence.util.XMLImporter.main.database.user=test_cvebrowser
log4j.appender.console.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
cvebrowser.dictionary.data.persistence.util.XMLImporter.main.database.url=jdbc:mysql://localhost.localdomain:3306/test_cvebrowser
cvebrowser.dictionary.data.persistence.util.XMLImporter.main.database.password=cv3br0ws3r
cvebrowser.dictionary.data.persistence.util.XMLImporter.main.database.driver=org.gjt.mm.mysql.Driver
#log4j.appender.file=org.apache.log4j.fileollingFileAppender
#log4j.appender.file.File=/opt/cvebrowser/log/XMLImporter-can.log
#log4j.appender.file.MaxFileSize=1000KB
# Keep one backup file
#log4j.appender.file.MaxBackupIndex=1
#log4j.appender.file.layout=org.apache.log4j.PatternLayout
#log4j.appender.file.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

Here you need to setup the user, password and database location so the XML importer can load the Mitre dictionary.

/opt/cvebrowser/etc/XMLImporter-cve.main.properties

The format is exactly as the previous file. This file is included so you can have two different log files (CVE / CAN).

Note

You can find more information about how to setup the Log4J properties here