<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">HI Paul,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thank you for the quick response.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I am rusty on linux and I might be confused.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">The question is, can I directly call any of those (</span><span style="font-size:11.0pt">setxattr,lsetxattr,fsetxattr,removexattr,lremovexattr,fremovexattr) directly from the command line, or they need to
 be a part of a script.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Any attempt to run the setxattr,lsetxattr,fsetxattr,removexattr,lremovexattr,fremovexattr) returns “command not found”<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">How can I repro those rules without being able to use the commands to modify a file/directory?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Regards.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">AlexT<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><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">Paul Moore <paul@paul-moore.com><br>
<b>Date: </b>Thursday, May 19, 2022 at 12:46 PM<br>
<b>To: </b>Alex Triantafillidis (DESIGN LABORATORY INC) <v-alextri@microsoft.com><br>
<b>Cc: </b>linux-audit@redhat.com <linux-audit@redhat.com><br>
<b>Subject: </b>[EXTERNAL] Re: Help setxattr,lsetxattr,fsetxattr,removexattr,lremovexattr<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">[You don't often get email from paul@paul-moore.com. Learn why this is important at
<a href="https://aka.ms/LearnAboutSenderIdentification.%5d">https://aka.ms/LearnAboutSenderIdentification.]</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%7C23e034c36d7044eee08b08da39d029cf%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637885864112921204%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=EkVjPds%2BN6A4F6R5wUo3q7qhZVkX4smEwwAO7srAjAg%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%7C23e034c36d7044eee08b08da39d029cf%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637885864112921204%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=EkVjPds%2BN6A4F6R5wUo3q7qhZVkX4smEwwAO7srAjAg%3D&amp;reserved=0</a><br>
<br>
--<br>
paul-moore.com<o:p></o:p></span></p>
</div>
</div>
</body>
</html>