DNSMASQ DSM for QRadar
This DSM/Rsyslog config will support sending the following dnsmasq event types "query", "config", "reply", "cached", "forwarded", and "/etc/pihole/gravity.list". If you have any questions you can create an Issue for the github project or open a question/reply on the IBM QRadar CE forms located at: https://ibm.biz/qradarceforums
- Run the command "sed -i 's@log-facility=/var/log/pihole.log@log-facility=DAEMON@g' /etc/dnsmasq.d/01-pihole.conf"
- Copy the file "10-dnsmasq-pihole.conf" to the location "/etc/rsyslog.d"
- Uncomment and edit the line "@QRadar or @@QRadar" with the IP address of your QRCE instance. Depending on if you will utilize UDP (@) or TCP (@@).
- Create the logging file by running the command "touch /var/log/pihole/dnsmasq.pihole.query.log"
- Set the permissions to write to the log file "chmod 666 /var/log/pihole/dnsmasq.pihole.query.log"
- Restart the services dnsmasq and rsyslog "systemctl restart pihole-FTL && systemctl restart rsyslog"
- pihole -up
- Run the command "sed -i 's@log-facility=/var/log/pihole.log@log-facility=DAEMON@g' /etc/dnsmasq.d/01-pihole.conf"
- Restart the services dnsmasq and rsyslog "systemctl restart pihole-FTL && systemctl restart rsyslog"
- Create a new custom DSM called (dnsmasq or Pi-Hole) using the DSM editor option under the admin settings window.
- Once the custom DSM has been created close the window and click the Log Source Extensions option in the admin settings.
- Click Add near the top right corner
- Enter a name of "DnsmasqCustom_ext"
- Select your newly created log source (dnsmasq or Pi-Hole) that you created earlier.
- Click the upload button and select the file "DnsmasqCustom_ext.xml"
- Click done and procced to open the DSM menu and select your log source (dnsmasq or Pi-Hole) that you created earlier.
- You will need to select Event Mappings tab in the DSM editor and create the manual entries located in the file "Event Mappings.txt"
- Finally, you will need to create a new log source selecting the custom Log source type we just created.
- 02-16-2019 - Adjusted eventID parsing to support Pi-Hole (repeat message X times).
- 02-03-2019 - Fixed issue with the rsyslog config not writing to the correct log file.
- 01-26-2019 - Fixed log source time to reflect 2019.
- 12-31-2018 - Fixed event ID parsing as it seems that when the dnsmasq server was updated to the latest build the logging format changed.