Re: SELinux Context for web server data files in another part of filesystem?

Thomas Mueller via selinux <[email protected]> Wed, 20 Nov 2024 13:11:04 +0100
Newsgroups gmane.linux.redhat.fedora.selinux
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============4146781086268460607==
Content-Type: multipart/alternative;
 boundary="------------TFILKoJo2huicbhVMErLE2oW"
Content-Language: en-US

This is a multi-part message in MIME format.
--------------TFILKoJo2huicbhVMErLE2oW
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit


Am 20.11.24 um 13:06 schrieb Trevor Hemsley via selinux:
> On 20/11/2024 12:03, Sam Morris via selinux wrote:
>> There's also a soft symlink at /var/www/html/ftc-data that points to
>> /var/ftc-data
>
> Why not just bind mount /var/ftc-data on /var/www/html/ftc-data?
>
one might also use the equal option of fcontext:


semanage fcontext --add --equal /var/www/html/ /var/ftc-data/
restorecon -rv /var/ftc-data

To have the same selinux fcontext for /var/ftc-data as /var/www/html


--------------TFILKoJo2huicbhVMErLE2oW
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit

<!DOCTYPE html>
<html data-lt-installed="true">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body style="padding-bottom: 1px;">
    <p><br>
    </p>
    <div class="moz-cite-prefix">Am 20.11.24 um 13:06 schrieb Trevor
      Hemsley via selinux:<br>
    </div>
    <blockquote type="cite"
      cite="mid:[email protected]">On
      20/11/2024 12:03, Sam Morris via selinux wrote:
      <br>
      <blockquote type="cite">There's also a soft symlink at
        /var/www/html/ftc-data that points to
        <br>
        /var/ftc-data
        <br>
      </blockquote>
      <br>
      Why not just bind mount /var/ftc-data on /var/www/html/ftc-data?
      <br>
      <br>
    </blockquote>
    <p>one might also use the equal option of fcontext:</p>
    <p><br>
    </p>
    <p>semanage fcontext --add --equal /var/www/html/ /var/ftc-data/<br>
      restorecon -rv /var/ftc-data <br>
    </p>
    <p>To have the same selinux fcontext for /var/ftc-data as
      /var/www/html</p>
    <p><br>
    </p>
  </body>
  <lt-container></lt-container>
</html>

--------------TFILKoJo2huicbhVMErLE2oW--

--===============4146781086268460607==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

LS0gCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCnNlbGlu
dXggbWFpbGluZyBsaXN0IC0tIHNlbGludXhAbGlzdHMuZmVkb3JhcHJvamVjdC5vcmcKVG8gdW5z
dWJzY3JpYmUgc2VuZCBhbiBlbWFpbCB0byBzZWxpbnV4LWxlYXZlQGxpc3RzLmZlZG9yYXByb2pl
Y3Qub3JnCkZlZG9yYSBDb2RlIG9mIENvbmR1Y3Q6IGh0dHBzOi8vZG9jcy5mZWRvcmFwcm9qZWN0
Lm9yZy9lbi1VUy9wcm9qZWN0L2NvZGUtb2YtY29uZHVjdC8KTGlzdCBHdWlkZWxpbmVzOiBodHRw
czovL2ZlZG9yYXByb2plY3Qub3JnL3dpa2kvTWFpbGluZ19saXN0X2d1aWRlbGluZXMKTGlzdCBB
cmNoaXZlczogaHR0cHM6Ly9saXN0cy5mZWRvcmFwcm9qZWN0Lm9yZy9hcmNoaXZlcy9saXN0L3Nl
bGludXhAbGlzdHMuZmVkb3JhcHJvamVjdC5vcmcKRG8gbm90IHJlcGx5IHRvIHNwYW0sIHJlcG9y
dCBpdDogaHR0cHM6Ly9wYWd1cmUuaW8vZmVkb3JhLWluZnJhc3RydWN0dXJlL25ld19pc3N1ZQo=

--===============4146781086268460607==--