<html 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=Windows-1252">
<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:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Got it.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thank you.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Richard Guy Briggs <rgb@redhat.com><br>
<b>Date: </b>Thursday, May 19, 2022 at 1:43 PM<br>
<b>To: </b>Alex Triantafillidis (DESIGN LABORATORY INC) <v-alextri@microsoft.com><br>
<b>Cc: </b>Paul Moore <paul@paul-moore.com>, linux-audit@redhat.com <linux-audit@redhat.com><br>
<b>Subject: </b>Re: [EXTERNAL] Re: Help setxattr,lsetxattr,fsetxattr,removexattr,lremovexattr<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:11.0pt">[You don't often get email from rgb@redhat.com. Learn why this is important at
<a href="https://aka.ms/LearnAboutSenderIdentification.%5d">https://aka.ms/LearnAboutSenderIdentification.]</a><br>
<br>
On 2022-05-19 20:19, Alex Triantafillidis (DESIGN LABORATORY INC) wrote:<br>
> HI Paul,<br>
> Thank you for the quick response.<br>
> I am rusty on linux and I might be confused.<br>
> The question is, can I directly call any of those (setxattr,lsetxattr,fsetxattr,removexattr,lremovexattr,fremovexattr) directly from the command line, or they need to be a part of a script.<br>
<br>
Not generally.  Scripts can be built to call these syscalls depending on<br>
the scripting environment.<br>
<br>
> Is it possible that those are not installed in cbl-mariner? I would say so but I cannot find a package available in mariner github. The only thing I found similar is “attr”, but using it as a rule instead of lets say setxattr it wont even register as a rule.<br>
<br>
I doubt it.<br>
<br>
> Any attempt to run the setxattr,lsetxattr,fsetxattr,removexattr,lremovexattr,fremovexattr) returns “command not found”<br>
<br>
This is a list of linux kernel (unix? posix?) syscalls.  There are a few<br>
syscalls that have commands named for them, but generally syscalls are<br>
used by applications to manipulate system resources (memory, disk,<br>
networks, cpus, etc...)<br>
<br>
> How can I repro those rules without being able to use the commands to modify a file/directory?<br>
<br>
Use an existing test suite, write a script or application to exercise<br>
these rules.<br>
<br>
> Regards.<br>
> AlexT<br>
><br>
> From: Paul Moore <paul@paul-moore.com><br>
> Date: Thursday, May 19, 2022 at 12:46 PM<br>
> To: Alex Triantafillidis (DESIGN LABORATORY INC) <v-alextri@microsoft.com><br>
> Cc: linux-audit@redhat.com <linux-audit@redhat.com><br>
> Subject: [EXTERNAL] Re: Help setxattr,lsetxattr,fsetxattr,removexattr,lremovexattr<br>
> [You don't often get email from paul@paul-moore.com. Learn why this is important at
<a href="https://aka.ms/LearnAboutSenderIdentification.%5d%3chttps:/nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Faka.ms%2FLearnAboutSenderIdentification.%255d&amp;data=05%7C01%7Cv-alextri%40microsoft.com%7Ca4dcf39a08044134eccd08da39d83526%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637885898022465349%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=N6lDrX1jPrhvSr%2BE4eUzSJi1Ajo13B36m3Dd3MisuZQ%3D&amp;reserved=0%3e">
https://aka.ms/LearnAboutSenderIdentification.]<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Faka.ms%2FLearnAboutSenderIdentification.%255d&amp;data=05%7C01%7Cv-alextri%40microsoft.com%7Ca4dcf39a08044134eccd08da39d83526%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637885898022465349%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=N6lDrX1jPrhvSr%2BE4eUzSJi1Ajo13B36m3Dd3MisuZQ%3D&amp;reserved=0></a><br>
><br>
> On Thu, May 19, 2022 at 12:45 PM Alex Triantafillidis (DESIGN<br>
> LABORATORY INC) <v-alextri@microsoft.com> wrote:<br>
> ><br>
> > Hello Audit,<br>
> ><br>
> > I am trying to implement a set of rules related to “xattrs” on a MS CBL-Mariner 1.0.<br>
> ><br>
> > I am following  this guide.<br>
> ><br>
> > Record Events that Modify the System's Discretionary Access Controls   Group contains 13 rules<br>
> ><br>
> > [ref]   At a minimum, the audit system should collect file permission changes for all users and root. Note that the "-F arch=b32" lines should be present even on a 64 bit system. These commands identify system calls for auditing. Even if the system is 64
 bit it can still execute 32 bit system calls. Additionally, these rules can be configured in a number of ways while still achieving the desired effect. An example of this is that the "-S" calls could be split up and placed on separate lines, however, this
 is less efficient. Add the following to /etc/audit/audit.rules:<br>
> ><br>
> > -a always,exit -F arch=b32 -S chmod,fchmod,fchmodat -F auid>=1000 -F auid!=unset -F key=perm_mod<br>
> ><br>
> >     -a always,exit -F arch=b32 -S chown,fchown,fchownat,lchown -F auid>=1000 -F auid!=unset -F key=perm_mod<br>
> ><br>
> >     -a always,exit -F arch=b32 -S setxattr,lsetxattr,fsetxattr,removexattr,lremovexattr,fremovexattr -F auid>=1000 -F auid!=unset -F key=perm_mod<br>
> ><br>
> > If your system is 64 bit then these lines should be duplicated and the arch=b32 replaced with arch=b64 as follows:<br>
> ><br>
> > -a always,exit -F arch=b64 -S chmod,fchmod,fchmodat -F auid>=1000 -F auid!=unset -F key=perm_mod<br>
> ><br>
> >     -a always,exit -F arch=b64 -S chown,fchown,fchownat,lchown -F auid>=1000 -F auid!=unset -F key=perm_mod<br>
> ><br>
> >     -a always,exit -F arch=b64 -S setxattr,lsetxattr,fsetxattr,removexattr,lremovexattr,fremovexattr -F auid>=1000 -F auid!=unset -F key=perm_mod<br>
> ><br>
> ><br>
> ><br>
> > Thing is I get error to any of setxattr,lsetxattr,fsetxattr,removexattr,lremovexattr,fremovexattr.<br>
> ><br>
> > bash: setxattr: command not found<br>
><br>
> Hi Alex,<br>
><br>
> Are you trying to execute the /etc/audit/audit.rules file directly<br>
> (like it was a bash script)?  I'm asking because the error you are<br>
> getting makes it look like bash is trying to execute a program named<br>
> "setxattr" which isn't going to work; the lines in audit.rules are<br>
> intended to be passed as command line arguments to auditctl.  Look at<br>
> the augenrules script (repo link below) and the auditctl '-R' option.<br>
><br>
> * <a href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Flinux-audit%2Faudit-userspace%2Fblob%2Fmaster%2Finit.d%2Faugenrules&amp;data=05%7C01%7Cv-alextri%40microsoft.com%7Ca4dcf39a08044134eccd08da39d83526%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637885898022465349%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=P3tbNr6DbnSR57e85sxUzuw3elYVB%2Fi8q%2BGgAWO7eEA%3D&amp;reserved=0">
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Flinux-audit%2Faudit-userspace%2Fblob%2Fmaster%2Finit.d%2Faugenrules&amp;data=05%7C01%7Cv-alextri%40microsoft.com%7Ca4dcf39a08044134eccd08da39d83526%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637885898022465349%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=P3tbNr6DbnSR57e85sxUzuw3elYVB%2Fi8q%2BGgAWO7eEA%3D&amp;reserved=0</a><br>
><br>
> --<br>
> paul-moore.com<br>
<br>
- RGB<br>
<br>
--<br>
Richard Guy Briggs <rgb@redhat.com><br>
Sr. S/W Engineer, Kernel Security, Base Operating Systems<br>
Remote, Ottawa, Red Hat Canada<br>
IRC: rgb, SunRaycer<br>
Voice: +1.647.777.2635, Internal: (81) 32635<o:p></o:p></span></p>
</div>
</div>
</body>
</html>