<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(32,18,77)">Continued...from previous mail of mine..</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(32,18,77)"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(32,18,77)">While I am reading and exploring much on auditd & on how I can have a proper central system where logs are stored and daily reports get generated, you might want to look at my config file on server and suggest/recommend if anything - would appreciate if any pointers.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(32,18,77)"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(32,18,77)">I am using default config which came with Ubuntu 16.04 and only change was<i> "-F auid!=4294967295"</i> on line where root_action is defined .</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(32,18,77)"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(32,18,77)">Thanks!</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(32,18,77)"><br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><table cellpadding="0" cellspacing="0" border="0" style="background:none;border-collapse:collapse;color:rgb(85,85,85);font-family:proxima-nova,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:16px;border:0px;margin:0px;padding:0px"><tbody><tr><td colspan="2" style="font-family:Arial,Helvetica,sans-serif;padding-bottom:5px"><font size="2" color="#0b5394">Best Regards,<br>Rituraj B</font></td></tr><tr><td colspan="2" style="font-family:Arial,Helvetica,sans-serif;color:rgb(38,56,119);font-size:12px"><br></td></tr></tbody></table></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Sat, Sep 23, 2017 at 7:30 PM, Rituraj Buddhisagar <span dir="ltr"><<a href="mailto:rituraj@vayana.com" target="_blank">rituraj@vayana.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-family:verdana,sans-serif;font-size:small;color:rgb(32,18,77)">Hi Steve, </div><div style="font-family:verdana,sans-serif;font-size:small;color:rgb(32,18,77)"><br></div><div style="font-family:verdana,sans-serif;font-size:small;color:rgb(32,18,77)">Thanks for the response. </div><div style="font-family:verdana,sans-serif;font-size:small;color:rgb(32,18,77)"><br></div><div><span style="font-size:12.8px">Suppressing the events with -F </span><span style="font-size:12.8px">auid!=4294967295 worked.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">I am seeing the events like "vi" "chmod" etc are getting audited by the system - even as a root account.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">I am yet to understand fully though on various rule sets and also on components like audisp / audisp-remote. So reading more ..</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div class="gmail_extra"><div><div class="m_8417900761904495030gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><table cellpadding="0" cellspacing="0" border="0" style="background:none;border-collapse:collapse;color:rgb(85,85,85);font-family:proxima-nova,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:16px;border:0px;margin:0px;padding:0px"><tbody><tr><td colspan="2" style="font-family:Arial,Helvetica,sans-serif;padding-bottom:5px"><font size="2" color="#0b5394">Best Regards,<br>Rituraj B</font></td></tr><tr><td colspan="2" style="font-family:Arial,Helvetica,sans-serif;color:rgb(38,56,119);font-size:12px"><br></td></tr></tbody></table></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><div><div class="h5">
<br><div class="gmail_quote">On Fri, Sep 22, 2017 at 10:17 PM, Steve Grubb <span dir="ltr"><<a href="mailto:sgrubb@redhat.com" target="_blank">sgrubb@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<span class="m_8417900761904495030gmail-"><br>
On Friday, September 22, 2017 1:09:19 AM EDT Rituraj Buddhisagar wrote:<br>
> I have a DNS server for which the auditd was generating lot of system calls<br>
> and flooding the logs.<br>
> Due to this  the server was under heavy memory usage as audisp-remote was<br>
> hogging the memory.  The log output for audisp-remote showed that the<br>
> syscall was 49. Then I got to know from ausyscall command that the call<br>
</span>> number 49 corresponds to bind. Hence I have *excluded* the call to "bind".<br>
<span class="m_8417900761904495030gmail-">><br>
> I have put in below line in the /etc/audit/audit.rules<br>
><br>
</span>> *-a exclude,always -S 49*<br>
<span class="m_8417900761904495030gmail-">><br>
> I have put the above line before section 10.2.2 which says "Feel free to<br>
> add below this line" (please note I am running Ubuntu 14.04 but I suppose<br>
> auditd implementation is same across board) .<br>
<br>
</span>Also know that the rules are looked at from top to bottom with the first match<br>
winning. So, you would want this rule above whatever is causing events.<br>
<span class="m_8417900761904495030gmail-"><br>
<br>
> After the exclusion - I no more see the syscall=49 line in<br>
</span>> /var/log/audit/audit.rules. So thats a success of sorts!<br>
><br>
> *Probem/Issue/Query now*: After the exclusion, I do see audit events for<br>
<span class="m_8417900761904495030gmail-">> cron , sudo etc. But I do not see a call for "vi" file open mode etc.<br>
<br>
</span>I'd need to see the rules to figure out what's wrong, but I have some hints<br>
below...<br>
<br>
> *Background:*<br>
><br>
> log output earlier which was flooding the logs and giving message " *dns1<br>
<span class="m_8417900761904495030gmail-">> audisp-remote: message repeated 6613 times: [ queue is full - dropping<br>
</span>> event"*<br>
><br>
> *log:*<br>
> *type=SYSCALL msg=audit(1506025977.586:46629<wbr>194): arch=c000003e syscall=49<br>
<span class="m_8417900761904495030gmail-">> success=yes exit=0 a0=3 a1=7ffe540ecf20 a2=c a3=0 items=0 ppid=22337<br>
> pid=22338 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0<br>
> fsgid=0 tty=(none) ses=4294967295 comm="audisp-remote"<br>
</span>> exe="/sbin/audisp-remote" key="root_action"*<br>
<br>
The main question is what is the root_action rule(s)? Normally we add a<br>
auid!=4294967295 to prevent daemons from causing events. Typically when it's<br>
desired to get root events, its means that you want to target _people_ running<br>
as root rather than normal system activity.<br>
<br>
<br>
> root@dns1:/tmp# ausyscall 49<br>
> *bind*<br>
<span class="m_8417900761904495030gmail-">><br>
> I do see audit events for cron , sudo etc. But I do not see a call for "vi"<br>
> file open mode etc.<br>
><br>
> Observation: I open file /etc/audit/audit.rules in vi editor and then close<br>
> it. Audit log does not show syscall=2<br>
<br>
</span>If you were wanting to record writes to that, you would use a rule like this:<br>
<br>
-w /etc/audit/ -p wa<br>
<span class="m_8417900761904495030gmail-"><br>
<br>
> Earlier I used to see below output in logs, but I am not sure that was for<br>
> which file opened in vi editor.<br>
><br>
</span>> *type=SYSCALL msg=audit(1506025995.825:46633<wbr>170): arch=c000003e syscall=2<br>
<span class="m_8417900761904495030gmail-">> success=yes exit=3 a0=5598f609a210 a1=200c1 a2=81a0 a3=0 items=2 ppid=21957<br>
> pid=22355 auid=1006 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0<br>
</span>> tty=pts0 ses=361 comm="vi" exe="/usr/bin/vim.basic" key="root_action"*<br>
<br>
Typically, its expected to look at events through ausearch. It groups the<br>
records into events. You can also use aureport to see summary information.<br>
<br>
> I did read a bit on auditd from below links. *Please let me know if I am<br>
> missing something or are the calls getting audited in an expected way.*<br>
<br>
><br>
> I went through below links; *would appreciate if someone can help with any<br>
> references which are more lucid with example*s:<br>
><br>
> <a href="https://linux-audit.com/configuring-and-auditing-linux-systems-with-audit-da" rel="noreferrer" target="_blank">https://linux-audit.com/config<wbr>uring-and-auditing-linux-<wbr>systems-with-audit-da</a><br>
> emon/<br>
<br>
I was not aware of that site. But some of the information appears to be dated.<br>
For example, telling people to use pam_tally2 when they should be using<br>
pam_faillock.<br>
<br>
> <a href="https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/ht" rel="noreferrer" target="_blank">https://access.redhat.com/docu<wbr>mentation/en-US/Red_Hat_Enterp<wbr>rise_Linux/6/ht</a><br>
<span class="m_8417900761904495030gmail-">> ml/Security_Guide/chap-system_<wbr>auditing.html<br>
><br>
> Furthermore, I would like to read much on audisp-remote to send all these<br>
> logs to a central server. I do not find any documentation on that. I see<br>
> discussion on net where people are using rsyslog instead for that. Please<br>
> help with references/links if any.<br>
<br>
</span>Admittedly there is not much written. It is on my list of topics to blog<br>
about. But I haven't had time for blogging lately.<br>
<span class="m_8417900761904495030gmail-HOEnZb"><font color="#888888"><br>
-Steve<br>
</font></span></blockquote></div><br></div></div></div></div>
</blockquote></div><br></div></div>