Solved

rsyslog - using reverse DNS instead of hostname

Posted on 2011-09-21
7
2,529 Views
Last Modified: 2012-06-21
I currently have a rsyslog server setup to accept logs from our internal cisco devices.  It is working well, but it seems to be doing a TON of reverse DNS lookups.  It seems that the rsyslog server is using reverse DNS to find where the message is coming from rather than the hostname in the message.

Example of one of the messages:
Aug 22 11:33:58 cisco-test 17: 000014: Aug 22 11:33:57.726 est: %SYS-5-CONFIG_I: Configured from console by johnd on vty0 (x.x.x.x)

So it seems are messages are formatted correctly.  Here is my rsyslong.conf file:

# cat /etc/rsyslog.conf
$ModLoad imuxsock.so      # provides support for local system logging (e.g. via logger command)
$ModLoad imklog.so      # provides kernel logging support (previously done by rklogd)

$ModLoad imudp.so
$UDPServerAddress X.X.X.X
$UDPServerRun 514
$ModLoad imtcp.so  
$InputTCPServerRun 514

$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat

$template DynaFile,"/var/log/rsyslog/%HOSTNAME%/%HOSTNAME%-%$MONTH%-%$DAY%-%$YEAR%.log"
*.* -?DynaFile
:HOSTNAME, !isequal, "rsyslogserver" ~
*.info;mail.none;authpriv.none;cron.none                /var/log/messages
authpriv.*                                              /var/log/secure
mail.*                                                  -/var/log/maillog
cron.*                                                  /var/log/cron
*.emerg                                                 *
uucp,news.crit                                          /var/log/spooler
local7.*                                                /var/log/boot.log
0
Comment
Question by:savone
  • 4
  • 3
7 Comments
 
LVL 12

Expert Comment

by:hfraser
Comment Utility
I expect the reverse DNS is happening because of the:

HOSTNAME, !isequal, "rsyslogserver" ~

filter which is based upon the actual hostname associated with the IP address of the system sending the message to your syslog server. Usually, this is done to implement different rules for different sources or messages. Is this something you need to do?
0
 
LVL 23

Author Comment

by:savone
Comment Utility
Yes,
I have multiple (about 25-30) cisco devices all logging to this server.  

I use this line to make sure they are in their own folders so we can find the logs when we need them:
$template DynaFile,"/var/log/rsyslog/%HOSTNAME%/%HOSTNAME%-%$MONTH%-%$DAY%-%$YEAR%.log"

0
 
LVL 12

Expert Comment

by:hfraser
Comment Utility
Understood. You can filter on parts of the message text, but the kind of flexibility you're looking for might be better suited to syslog-ng, which offers many more capabilities for routing messages to different files, including my IP address rather than hostname.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 23

Author Comment

by:savone
Comment Utility
It would take me months if not years to get new software approved for our network.  Is there no way to get this resolved with rsyslog?

It looks like a reverse DNS query for every single log entry, this seems excessive.  
0
 
LVL 12

Accepted Solution

by:
hfraser earned 500 total points
Comment Utility
I'm not aware of any way to create a filter by hostname, unless you want to maintain a list of filters by message content that look for hostnames in the message. That might mean a LOT of filters, and at the very least it's a maintenance nightmare.

If you're really concerned about the DNS traffic (the packets are small UDP messages, so it's not usually a lot of overhead), you could always suggest installing a caching slave DNS server on the syslog server itself. I've used this technique for high-volume DNS servers, more for pure performance than anything else. If your syslog server is a Unix box, you may already have bind installed on it and merely need to justify activating it and allowing it to be a slave to your main DNS servers, then add it as the DNS server in /etc/resolve.conf.
0
 
LVL 23

Author Comment

by:savone
Comment Utility
That is a good idea.  I will look into that.  Thanks for the help.

0
 
LVL 23

Author Closing Comment

by:savone
Comment Utility
Still considering this.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

#Citrix #Citrix Netscaler #HTTP Compression #Load Balance
When it comes to security, there are always trade-offs between security and convenience/ease of administration. This article examines some of the main pros and cons of using key authentication vs password authentication for hosting an SFTP server.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now