<div dir="ltr"><div dir="ltr">Hello Sumanta!<div><br></div><div>Your config looks good.</div><div>The log about the statistics show that there are no incoming messages on 514 UDP and nothing is written to the files defined in the d_splunk destination.<br></div><div><br></div><div>I think you could try to narrow down the scope of the problem with the following ideas.</div><div><br></div><div>Try to send a message locally to 514 with:</div><div><font face="monospace"> echo "foo bar" | nc -u -w0 localhost 514</font></div><div><br></div></div><div>If it does not work, I would suggest to change the receiving port of the network() source to something larger, like <font face="monospace">port(12345)</font>, and trying again with the following, just to see if the problem only occurs for the 514 port:</div><div><span style="font-family:monospace"> echo "foo bar" | nc -u -w0 localhost 12345</span><br></div><div><br></div><div>You should see these kind of logs:</div><div><font face="monospace">[2024-01-15T15:58:46.037255] Incoming log entry; input='foo bar\x0a', msg='0x7f9bb0003020', rcptid='297'<br></font></div><div><font face="monospace">...</font></div><div><font face="monospace">[2024-01-15T15:58:46.037655] Initializing destination file writer; template='......', filename='......', symlink_as='(null)'<br></font></div><div><font face="monospace">...</font></div><div><font face="monospace">[2024-01-15T15:58:46.037872] Outgoing message; message='bar'</font><br></div><div><br></div><div>My hunch is that this probably has something to do with SELinux, but unfortunately my knowledge of it is very limited.</div><div><br></div><div>Regards,</div><div>Attila</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jan 14, 2024 at 9:50 PM Sumanta Banerjee <<a href="mailto:sumanta.banerjee@aviva.com">sumanta.banerjee@aviva.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg6595656038882812122">
<div lang="EN-GB" style="overflow-wrap: break-word;">
<div class="m_6595656038882812122WordSection1">
<p class="MsoNormal"><b>Hi Team,<u></u><u></u></b></p>
<p class="MsoNormal"><b><u></u> <u></u></b></p>
<p class="MsoNormal"><b><u></u> <u></u></b></p>
<p class="MsoNormal"><b>I am trying to configure syslog-ng in one our linux instance to get NGIPS/FMC data via udp connection on its default port (514). I have configured syslog-ng.conf under /etc/syslog-ng and then we have set SE Linux as Permissive. I am
using RHEL 8.7 and syslog version 4.0. Apparently all looked good to me however while checking in the destination path that is mentioned I don’t see any directory or logfile from for the said udp connection got created.
<u></u><u></u></b></p>
<p class="MsoNormal"><b>Below is our observation and steps that we executed, can any of you please help me telling where I went wrong or if I am missing something, there is another testing in pipeline that is stalled for this –
<u></u><u></u></b></p>
<p class="MsoNormal"><u></u> <u></u></p>
<ol style="margin-top:0in" start="1" type="1">
<li class="m_6595656038882812122MsoListParagraph" style="margin-left:0in">Define source, destination and log_file in syslog-ng.conf (file attached).<u></u><u></u></li><li class="m_6595656038882812122MsoListParagraph" style="margin-left:0in">Run the below SELinux command –<u></u><u></u></li></ol>
<p class="m_6595656038882812122MsoListParagraph"># ausearch -c 'syslog-ng' --raw | audit2allow -M my-syslogng<br>
# semodule -X 300 -i my-syslogng.pp<u></u><u></u></p>
<ol style="margin-top:0in" start="3" type="1">
<li class="m_6595656038882812122MsoListParagraph" style="margin-left:0in">Restart syslog-ng service –<u></u><u></u></li></ol>
<p class="m_6595656038882812122MsoListParagraph"># systemctl restart syslog-ng.service (no error message received)<u></u><u></u></p>
<ol style="margin-top:0in" start="4" type="1">
<li class="m_6595656038882812122MsoListParagraph" style="margin-left:0in">Check if the service is running –
<u></u><u></u></li></ol>
<p class="m_6595656038882812122MsoListParagraph"><u></u> <u></u></p>
<p class="m_6595656038882812122MsoListParagraph"><img width="778" height="247" style="width: 8.1041in; height: 2.5729in;" id="m_6595656038882812122Picture_x0020_1" src="cid:ii_18d0d92dc715b16b22"><u></u><u></u></p>
<p class="m_6595656038882812122MsoListParagraph"><u></u> <u></u></p>
<ol style="margin-top:0in" start="5" type="1">
<li class="m_6595656038882812122MsoListParagraph" style="margin-left:0in">Check if syslog-ng is listening to udp port 514 –
<u></u><u></u></li></ol>
<p class="m_6595656038882812122MsoListParagraph"><img width="799" height="57" style="width: 8.3229in; height: 0.5937in;" id="m_6595656038882812122Picture_x0020_3" src="cid:ii_18d0d92dc71692e333"><u></u><u></u></p>
<p class="m_6595656038882812122MsoListParagraph"><u></u> <u></u></p>
<ol style="margin-top:0in" start="6" type="1">
<li class="m_6595656038882812122MsoListParagraph" style="margin-left:0in">Checked and we have incoming data stream from source using the below command –
<u></u><u></u></li></ol>
<p class="m_6595656038882812122MsoListParagraph"><b>tcpdump -i any -c10 -nn -A port 514<u></u><u></u></b></p>
<p class="m_6595656038882812122MsoListParagraph"><b><u></u> <u></u></b></p>
<ol style="margin-top:0in" start="7" type="1">
<li class="m_6595656038882812122MsoListParagraph" style="margin-left:0in">I have went through the syslog-ng troubleshooting steps mentioned in the link –
<u></u><u></u></li></ol>
<p class="m_6595656038882812122MsoListParagraph"><a href="https://www.syslog-ng.com/technical-documents/doc/syslog-ng-open-source-edition/3.37/administration-guide/105#TOPIC-1829320" target="_blank">https://www.syslog-ng.com/technical-documents/doc/syslog-ng-open-source-edition/3.37/administration-guide/105#TOPIC-1829320</a><u></u><u></u></p>
<p class="m_6595656038882812122MsoListParagraph"><u></u> <u></u></p>
<p class="m_6595656038882812122MsoListParagraph"><img border="0" width="561" height="37" style="width: 5.8437in; height: 0.3854in;" id="m_6595656038882812122Picture_x0020_4" src="cid:ii_18d0d92dc717745b44"><u></u><u></u></p>
<p class="m_6595656038882812122MsoListParagraph"><u></u> <u></u></p>
<p class="m_6595656038882812122MsoListParagraph"><b>syslog-ng -Fdev command output is also attached.<u></u><u></u></b></p>
<p class="m_6595656038882812122MsoListParagraph"><u></u> <u></u></p>
<ol style="margin-top:0in" start="8" type="1">
<li class="m_6595656038882812122MsoListParagraph" style="margin-left:0in">While running the following command got the below output -
<b># watch '/usr/sbin/syslog-ng-ctl stats | grep "^center"'<u></u><u></u></b></li></ol>
<p class="m_6595656038882812122MsoListParagraph"><img border="0" width="1364" height="138" style="width: 14.2083in; height: 1.4375in;" id="m_6595656038882812122Picture_x0020_5" src="cid:ii_18d0d92dc71855d355"><b><u></u><u></u></b></p>
<p class="m_6595656038882812122MsoListParagraph"><b><u></u> <u></u></b></p>
<ol style="margin-top:0in" start="9" type="1">
<li class="m_6595656038882812122MsoListParagraph" style="margin-left:0in"><b># journaltctl command output (first 500 lines) attached<u></u><u></u></b></li></ol>
<p class="m_6595656038882812122MsoListParagraph"><b><u></u> <u></u></b></p>
<ol style="margin-top:0in" start="10" type="1">
<li class="m_6595656038882812122MsoListParagraph" style="margin-left:0in">Current SE Linux status :<b><u></u><u></u></b></li></ol>
<p class="MsoNormal" style="margin-left:0.5in"><img border="0" width="389" height="183" style="width: 4.052in; height: 1.9062in;" id="m_6595656038882812122Picture_x0020_6" src="cid:ii_18d0d92dc719374b66"><b><u></u><u></u></b></p>
<p class="MsoNormal" style="margin-left:0.5in"><b><u></u> <u></u></b></p>
<ol style="margin-top:0in" start="11" type="1">
<li class="m_6595656038882812122MsoListParagraph" style="margin-left:0in">Our syslog-ng is logging to /var/log/messages and we are getting this message in /var/log/messages –
<b><u></u><u></u></b></li></ol>
<p class="m_6595656038882812122MsoListParagraph"><u></u> <u></u></p>
<p class="m_6595656038882812122MsoListParagraph"><img border="0" width="1362" height="558" style="width: 14.1875in; height: 5.8125in;" id="m_6595656038882812122Picture_x0020_7" src="cid:ii_18d0d92dc71a18c377"><b><u></u><u></u></b></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span>Thanks & Regards,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:12pt">Sumanta Banerjee<u></u><u></u></span></p>
<p class="MsoNormal"><span>Splunk Admin | CISO | Aviva Group<u></u><u></u></span></p>
<p class="MsoNormal"><span>Tel: +91-8420892593<u></u><u></u></span></p>
<p class="MsoNormal"><span>24x7x365: +44 1603 208 582<u></u><u></u></span></p>
<p class="MsoNormal"><span><a href="mailto:sumanta.banerjee@aviva.com" target="_blank">sumanta.banerjee@aviva.com</a><u></u><u></u></span></p>
<p class="MsoNormal"><span><a href="mailto:GlobalCyberSecurityEngineeringTeam@aviva.com" target="_blank">GlobalCyberSecurityEngineeringTeam@aviva.com</a><u></u><u></u></span></p>
<p class="MsoNormal"><span><a href="http://www.aviva.com" target="_blank">www.aviva.com</a><u></u><u></u></span></p>
<p class="MsoNormal"><span>Wipro Technologies - SJP2, Bangalore, India<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"><img border="0" width="201" height="54" style="width: 2.0937in; height: 0.5625in;" id="m_6595656038882812122Picture_x0020_2" src="cid:ii_18d0d92dc714cdccc1"></span><span><u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="m_6595656038882812122msipfooterd9b5198" style="margin:0in"><span style="font-size:8pt;color:blue">Aviva: Internal</span><u></u><u></u></p>
</div>
<br clear="both">
Aviva plc, registered Office: St. Helen's, 1 Undershaft, London EC3P 3DQ. Registered in England No. 02468686. <a href="http://www.aviva.com" target="_blank">www.aviva.com</a><br>
<br>
This message and any attachments may be confidential or legally privileged. If you are not the intended recipient, please telephone or e-mail the sender and delete this message and any attachments from your system. Also, if you are not the intended recipient you must not copy this message or attachments or disclose the contents to any other person. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Aviva.<br>
</div>
______________________________________________________________________________<br>
Member info: <a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng" rel="noreferrer" target="_blank">https://lists.balabit.hu/mailman/listinfo/syslog-ng</a><br>
Documentation: <a href="http://www.balabit.com/support/documentation/?product=syslog-ng" rel="noreferrer" target="_blank">http://www.balabit.com/support/documentation/?product=syslog-ng</a><br>
FAQ: <a href="http://www.balabit.com/wiki/syslog-ng-faq" rel="noreferrer" target="_blank">http://www.balabit.com/wiki/syslog-ng-faq</a><br>
<br>
</div></blockquote></div></div>