<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 10 Feb 2023 at 13:52, Simon Burke via Wolves <<a href="mailto:wolves@mailman.lug.org.uk">wolves@mailman.lug.org.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>So this is work related. Today, I'm slowly getting myself into a form of hell with SELinux.policies and semi-complex ksh scripts.</div><div><br></div><div>The bool 'domain_can_mmap_files' currently defaults to off. </div><div><br></div><div>It is my understanding that the intention of this bool is to force validation every time a process accesses a particular file. Which is only useful if we expect context changes. </div><div><br></div><div>Would that mean if we did not expect context changes, then it would be relatively safe to enable this bool? Considering this server will be providing an internet facing service. </div><div><br></div><div>I assume as the initial access of the file is still validated, then we don't have too much to worry about. Unless something malicious is somehow executed that changes the context of a file while it's mapped. </div><div><br></div><div>Other mitigations are in-place like clamd (but that only scans input from end users), and rkhunter periodically runs. There is also inspection done to traffic inbound to the server via network based IDS/IPS.</div><div><br></div><br></div></blockquote><div><br></div><div>I think it would be ok to change it to on.</div><div>Search for "mmap" on this page:</div><div><a href="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/7.6_release_notes/new_features_security">https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/7.6_release_notes/new_features_security</a></div><div>I would probably go with its description of the feature.</div><div><br></div><div>I believe there is a way to enable/disable mmap on/off particular files, but I don't remember the method.</div><div><br></div><div>selinux has a "learning/permissive" mode that can tell you all the rules if you want everything that is accessed by a particular application to be listed.</div><div>I then go through the list of rules, and only leave the ones I specifically wish to permit and delete the rest.<br></div><div></div><div><br></div><div>Kind Regards</div><div><br></div><div>James</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div> <br></div></div></div>