<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif">Hi, <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif">I have found a weird behavior in auditd.
</span><span lang="EN-IN" style="font-family:"Arial",sans-serif">File “/abc” does not exist.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-IN" style="font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><u><span style="font-family:"Arial",sans-serif">audit.rules:<o:p></o:p></span></u></p>
<p style="margin:0cm;margin-bottom:.0001pt"><span lang="EN-IN" style="font-size:11.0pt;font-family:"Arial",sans-serif;color:black">-a always,exit -F arch=b32 -S open -S openat<o:p></o:p></span></p>
<p style="margin:0cm;margin-bottom:.0001pt"><span lang="EN-IN" style="font-size:11.0pt;font-family:"Arial",sans-serif;color:black">-a always,exit -F arch=b64 -S open -S openat<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-IN" style="font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-IN" style="font-family:"Arial",sans-serif">A non-root user executes “echo > /abc”, it doesn’t get logged in audit.log. Same with “echo > /etc/abc”<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-IN" style="font-family:"Arial",sans-serif">A non-root user executes “cat /abc”, it gets logged in audit.log<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-IN" style="font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-IN" style="font-family:"Arial",sans-serif">Since auditd is monitoring all the open and openat syscalls, ideally both the cases (i.e. read and write) should have be logged.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-IN" style="font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif">After I execute “chmod a+w /” then “chmod a-w /”,
</span><span lang="EN-IN" style="font-family:"Arial",sans-serif">if a non-root user executes “echo > /abc”, then it gets logged in audit.log.</span><span style="font-family:"Arial",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-IN" style="font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-IN" style="font-family:"Arial",sans-serif">This looks like a bug to me. Kindly let me know if it’s a bug or an intended feature.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-IN" style="font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-IN" style="font-family:"Arial",sans-serif">System used to test:
</span><span style="font-family:"Arial",sans-serif">Linux 5.4.0-56-generic #62-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-IN" style="font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-IN" style="font-family:"Arial",sans-serif">Regards,<o:p></o:p></span></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse">
<tbody>
<tr>
<td width="708" style="width:894.5pt;padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" style="line-height:11.25pt"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#000001">Shourya Jaiswal</span><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black"><o:p></o:p></span></p>
</td>
</tr>
<tr>
<td width="708" style="width:894.5pt;padding:0cm 0cm 0cm 0cm"></td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>