<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:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@SimSun";
        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;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@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-NZ link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Hi everyone,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I am new here, so I am not exactly sure if this is the right place to ask this. I apologise in advance if this is not the right place. <o:p></o:p></p><p class=MsoNormal>I would like to ask if anyone has encountered the issue below. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I am trying to track a set of file accesses system calls in a Linux system (for experimental purposes) and used the following subset of rules with the audit.rules file.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><b>-a exit,always -F arch=b64 -S creat -S read -S write -S rename -S open -S close<o:p></o:p></b></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>What I noticed was that for the open system call, when opening <b>an existing file </b>for writing purpose, the file name would result in a ‘null’ value like shown:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>type=SYSCALL msg=audit(1423018198.026:20826531): arch=c000003e <b>syscall=2</b> success=yes exit=4 a0=400865 a1=241 a2=1b6 a3=0 items=2 ppid=9093 pid=9169 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=3805 comm="readfile" exe="/root/prov_project/script/readfile" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null)<o:p></o:p></p><p class=MsoNormal>type=CWD msg=audit(1423018198.026:20826531):  cwd="/root/prov_project/script"<o:p></o:p></p><p class=MsoNormal>type=PATH msg=audit(1423018198.026:20826531): item=0 name="/root/prov_project/script" inode=311564 dev=fd:01 mode=040755 ouid=0 ogid=0 rdev=00:00 obj=unconfined_u:object_r:admin_home_t:s0 nametype=PARENT<o:p></o:p></p><p class=MsoNormal>type=PATH msg=audit(1423018198.026:20826531): item=1 name=<b>(null) </b>inode=269089 dev=fd:01 mode=0100644 ouid=0 ogid=0 rdev=00:00 obj=unconfined_u:object_r:admin_home_t:s0 nametype=NORMAL<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>However, opening the same file with read only mode or opening a non-existing file (which in that case the open system call would create the file) would result in the file name being captured as shown:  <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>type=SYSCALL msg=audit(1423018196.556:20826486): arch=c000003e syscall=2 success=yes exit=4 a0=400865 a1=241 a2=1b6 a3=0 items=2 ppid=9093 pid=9168 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=3805 comm="readfile" exe="/root/prov_project/script/readfile" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null)<o:p></o:p></p><p class=MsoNormal>type=CWD msg=audit(1423018196.556:20826486):  cwd="/root/prov_project/script"<o:p></o:p></p><p class=MsoNormal>type=PATH msg=audit(1423018196.556:20826486): item=0 name="/root/prov_project/script" inode=311564 dev=fd:01 mode=040755 ouid=0 ogid=0 rdev=00:00 obj=unconfined_u:object_r:admin_home_t:s0 nametype=PARENT<o:p></o:p></p><p class=MsoNormal>type=PATH msg=audit(1423018196.556:20826486): item=1 name="<b>sample_text.txt</b>" inode=269089 dev=fd:01 mode=0100644 ouid=0 ogid=0 rdev=00:00 obj=unconfined_u:object_r:admin_home_t:s0 nametype=CREATE<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Hence the question: Is this an intended feature or a bug? <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Appreciate if anyone can shed some light on this.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>To reproduce:  write to a non-existing file first, close it and then open and write to the same file again.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I am running version 2.3.7-5 of the audit framework and on CentOS 6.4 (kernel version 2.6.32-431) <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thank you.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Cheers,<o:p></o:p></p><p class=MsoNormal>Alan<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>