User Tools

Site Tools


user:ryoung12:portfolio:rsyslog:server

RSyslog Server Configuration

<html><p>It will be assumed that you have already upgraded your RSyslog via the </html> upgrade instructions<html>.</p> <br /></html>

Installing MySQL

<html><p>Install the MySQL Server.</p></html>

sudo aptitude install mysql-server

<html><p>During installation, you will be asked to create a password for the administrative “root” user for the MySQL server.</p></html>

Installing the RSyslog-MySQL plugin

<html><p>You need to install the MySQL plugin module for RSyslog so that it can communicate with the MySQL server.</p></html>

sudo aptitude -t lenny-backports install -y rsyslog-mysql

<html><p>Once the RSyslog-MySQL package has been installed, you will be asked a series of questions to create the MySQL database that will be used by RSyslog to store the log files.<p></html>

rsyslog-mysql must have a database installed and configured before it can be used.
If you like, this can be handled with dbconfig-common.

If you are an advanced database administrator and know that you want to perform this
configuration manually, or if your database has already been installed and configured,
you should refuse this option. Details /usr/share/doc/rsyslog-mysql.

Otherwise, you should probably choose this option.

Configure database for rsyslog-mysql with dbconfig-common?
<Yes>   <No>

<html><p>I selected yes.</p> <br /> <p>You will then be prompted to enter the password for the “root” user of MySQL as configured during our install of MySQL-server.</p></html>

What is the password for the administrative account with which this package should
create its MySQL database and user?

Password of your database's administrative user:

<html><p>Next you will be asked to provide, and then confirm a password for the user “rsyslog”, which will be user RSyslog uses to connect to the MySQL database.</p></html>

Please provide a password for rsyslog-mysql to register with the database server.
If left blank, a random password will be generated for you.

MySQL application password for

<html><p>the RSyslog-MySQL plugin should now be installed and configured.</p></html>

Installing the RSyslog-GnuTLS plugin

<html><p>You need to install the GnuTLS plugin to configure the syslog server to accept incoming TLS connections from the syslog clients.</p></html>

sudo aptitude -t lenny-backports install -y rsyslog-gnutls


Generate Machine Certificate

<html><p>On your CA, you need to generate a machine certificate for the RSyslog server machine.</p> <br /> <p style=“font-weight:bold;”>On the Certificate Authority:</p> <br /> <p>Create the private machine key.</p></html>

sudo certtool --generate-privkey --outfile key.pem --bits 2048


<html><p>Generate the public machine certificate request. You will be asked to enter several pieces of pertinent information. You can just press enter to skip over any field.</p></html>

sudo certtool --generate-request --load-privkey key.pem --outfile request.pem

<html><p>I answered:</p></html>

Country name (2 chars): US
Organization name: Lab46
Organizational unit name: Student.Lab
Locality name: Corning
State or province name: NY
Common name: vm30.student.lab
UID: 
Enter a challenge password: 


<html><p>Once you have the request file for the public certificate, you can generate the public machine certificate. Again you will be asked to enter some information.</p></html>

sudo certtool --generate-certificate --load-request request.pem --outfile cert.pem --load-ca-certificate ca.pem --load-ca-privkey ca-key.pem

<html><p>I entered:</p></html>

Enter the certificate's serial number (decimal): 

Activation/Expiration time.
The certificate will expire in (days): 1000

Extensions.
Does the certificate belong to an authority? (Y/N): n
Is this a TLS web client certificate? (Y/N): y
Is this also a TLS web server certificate? (Y/N): y
Enter the dnsName of the subject of the certificate: vm30.student.lab
Will the certificate be used for signing (DHE and RSA-EXPORT ciphersuites)? (Y/N): 
Will the certificate be used for encryption (RSA ciphersuites)? (Y/N):

<html><p> You will then be shown the resultant certificate file and asked if the information is correct. I entered 'y'.</p> <br /> <p>Delete the request.pem file, rename the key.pem and cert.pem files, and change their access permissions.</p></html>

sudo rm -f request.pem
sudo mv key.pem machine-key.pem
sudo mv cert.pem machine-cert.pem
chown root:root machine-key.pem machine-cert.pem
chmod 400 machine-key.pem machine-cert.pem


<html><p>Now you need to copy ca.pem, key.pem, and cert.pem to the RSyslog server.<p> <br /> <p style=“font-weight:bold;”>Back on the RSyslog Server:</p> <br /> <p>You need to put ca.pem, key.pem, and cert.pem in the /rsyslog/protected/ directory. You may need to create these directories first.</p> </html>

sudo sh -c "mkdir /rsyslog && mkdir /rsyslog/protected && mv *.pem /rsyslog/protected"


RSyslog Configuration File

<html><p>Now we need to update our /etc/rsyslog.conf file.</p></html>

$ModLoad imuxsock # local messages
$ModLoad imtcp # TCP listener
$ModLoad ommysql # MySQL plugin
 
# make gtls driver the default
$DefaultNetstreamDriver gtls
 
# certificate files
$DefaultNetstreamDriverCAFile /rsyslog/protected/ca.pem
$DefaultNetstreamDriverCertFile /rsyslog/protected/machine-cert.pem
$DefaultNetstreamDriverKeyFile /rsyslog/protected/machine-key.pem
 
# server authentication settings
$InputTCPServerStreamDriverAuthMode x509/name
$InputTCPServerStreamDriverPermittedPeer *.student.lab
$InputTCPServerStreamDriverMode 1 # run driver in TLS-only mode
$InputTCPServerRun 10514 # start up listener at port 10514
 
# MySQL database login settings 
*.*     :ommysql:127.0.0.1,Syslog,rsyslog,mSySs4qPl

Restart the RSyslog Service

<html><p>Now we need to restart the RSyslog service to apply the changes.</p></html>

sudo /etc/init.d/rsyslog restart

<html><p>That's it. Our syslog server is configured. Later we'll come back and install LogAnalyzer, a PHP-powered graphical front end for viewing and searching the log files stored in the syslog database.</p></html>

user/ryoung12/portfolio/rsyslog/server.txt · Last modified: 2010/05/22 03:46 by ryoung12