<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re:SGX enclave attestation inside VM fails when apparmor enabled. in Intel® Software Guard Extensions (Intel® SGX)</title>
    <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/SGX-enclave-attestation-inside-VM-fails-when-apparmor-enabled/m-p/1460874#M5670</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the information.&lt;/P&gt;&lt;P&gt;We believe that you have tried to "Either disable your MAC or create an &lt;STRONG&gt;exception&lt;/STRONG&gt; or profile to allow access to /dev/sgx_virt_epc" as mentioned in (3).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We would suggest to check the &lt;STRONG&gt;Kernel&lt;/STRONG&gt; version. Error happens could be due to the kernel version is too old.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this is not the case, we suggest to check the &lt;STRONG&gt;accessibility&lt;/STRONG&gt; of QEMU to these devices:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/dev/sgx_enclave to launch enclaves&lt;/P&gt;&lt;P&gt;/dev/sgx_provision to launch the provisioning certification enclave (PCE)&lt;/P&gt;&lt;P&gt;/dev/sgx_vepc to assign EPC memory pages&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Access to these device files will be denied by libvirt’s cgroup controllers by default.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Edit&lt;/STRONG&gt; /etc/libvirt/qemu.conf and change the cgroup_device_acl via:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;cgroup_device_acl = [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;"/dev/null", "/dev/full", "/dev/zero",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;"/dev/random", "/dev/urandom",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;"/dev/ptmx", "/dev/kvm",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;"/dev/rtc","/dev/hpet",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;"/dev/sgx_enclave", "/dev/sgx_provision", "/dev/sgx_vepc"&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Configure&lt;/STRONG&gt; QEMU to run as root, set the user parameter in /etc/libvirt/qemu.conf:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;user = "root"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Set&lt;/STRONG&gt; the parameter to “apparmor”:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;security_driver = [ “apparmor” ]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Modify&lt;/STRONG&gt; /etc/apparmor.d/libvirt/TEMPLATE.qemu to read:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#include &amp;lt;tunables/global&amp;gt;&lt;/P&gt;&lt;P&gt;profile LIBVIRT_TEMPLATE flags=(attach_disconnected) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;#include &amp;lt;abstractions/libvirt-qemu&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;/usr/local/bin/* PUx,&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Restart&lt;/STRONG&gt; the libvirtd service:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sudo systemctl restart libvirtd&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that the information that I provided is useful for you. Please inform us if you have any questions.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ken&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 02 Mar 2023 02:13:50 GMT</pubDate>
    <dc:creator>KFPW_Intel</dc:creator>
    <dc:date>2023-03-02T02:13:50Z</dc:date>
    <item>
      <title>SGX enclave attestation inside VM fails when apparmor enabled.</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/SGX-enclave-attestation-inside-VM-fails-when-apparmor-enabled/m-p/1460522#M5667</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is observed that the&amp;nbsp;SGX enclave attestation inside VM fails when apparmor enabled. It works when the apparmor at the host is disabled. Set the qemu.conf as per the guideline here&amp;nbsp;&lt;A class="external-link" title="Follow link" href="https://www.intel.com/content/www/us/en/developer/articles/technical/virtualizing-intel-software-guard-extensions-with-kvm-and-qemu.html" target="_blank" rel="nofollow noopener"&gt;https://www.intel.com/content/www/us/en/developer/articles/technical/virtualizing-intel-software-guard-extensions-with-kvm-and-qemu.html. &lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, &amp;nbsp;we have added exception to /dev/sgx_vepc in &lt;STRONG&gt;/etc/apparmor.d/abstractions/libvirt-qemu&lt;/STRONG&gt;&amp;nbsp;. However these still don't work. It works only when the apparmor is enabled. Is there anything else can be tried?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 08:05:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/SGX-enclave-attestation-inside-VM-fails-when-apparmor-enabled/m-p/1460522#M5667</guid>
      <dc:creator>TFMat</dc:creator>
      <dc:date>2023-03-01T08:05:09Z</dc:date>
    </item>
    <item>
      <title>Re:SGX enclave attestation inside VM fails when apparmor enabled.</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/SGX-enclave-attestation-inside-VM-fails-when-apparmor-enabled/m-p/1460528#M5668</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your interest in Intel® SGX.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The reference that you have provided is very useful. Based on the reference provided, could you share your error messages so that we can gain insights to support your use cases.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We would like to understand the issue, if AppArmor enabled, the VM fails. And, if AppArmor is enabled with exception in sgx_vepc, the VM works?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We look forward to hearing from you. Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ken&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Mar 2023 08:37:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/SGX-enclave-attestation-inside-VM-fails-when-apparmor-enabled/m-p/1460528#M5668</guid>
      <dc:creator>KFPW_Intel</dc:creator>
      <dc:date>2023-03-01T08:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Re:SGX enclave attestation inside VM fails when apparmor enabled.</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/SGX-enclave-attestation-inside-VM-fails-when-apparmor-enabled/m-p/1460532#M5669</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We would like to get the SGX working in VM with Apparmor enabled. So we have given exceptions given to&amp;nbsp;&lt;SPAN class="sub_section_element_selectors"&gt;/dev/sgx_vepc in &lt;/SPAN&gt;&lt;STRONG class="sub_section_element_selectors"&gt;&lt;SPAN class="sub_section_element_selectors"&gt;/etc/apparmor.d/abstractions/libvirt-qemu&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;and also added root in qemu.conf together with the steps referred in the topic "Troubleshooting-&amp;gt;&lt;SPAN&gt;invalid object type: memory-backend-epc" of&amp;nbsp;&lt;/SPAN&gt;the site mentioned in my earlier post. However still it fails for same reason. But when we disable apparmor it works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 08:47:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/SGX-enclave-attestation-inside-VM-fails-when-apparmor-enabled/m-p/1460532#M5669</guid>
      <dc:creator>TFMat</dc:creator>
      <dc:date>2023-03-01T08:47:09Z</dc:date>
    </item>
    <item>
      <title>Re:SGX enclave attestation inside VM fails when apparmor enabled.</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/SGX-enclave-attestation-inside-VM-fails-when-apparmor-enabled/m-p/1460874#M5670</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the information.&lt;/P&gt;&lt;P&gt;We believe that you have tried to "Either disable your MAC or create an &lt;STRONG&gt;exception&lt;/STRONG&gt; or profile to allow access to /dev/sgx_virt_epc" as mentioned in (3).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We would suggest to check the &lt;STRONG&gt;Kernel&lt;/STRONG&gt; version. Error happens could be due to the kernel version is too old.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this is not the case, we suggest to check the &lt;STRONG&gt;accessibility&lt;/STRONG&gt; of QEMU to these devices:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/dev/sgx_enclave to launch enclaves&lt;/P&gt;&lt;P&gt;/dev/sgx_provision to launch the provisioning certification enclave (PCE)&lt;/P&gt;&lt;P&gt;/dev/sgx_vepc to assign EPC memory pages&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Access to these device files will be denied by libvirt’s cgroup controllers by default.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Edit&lt;/STRONG&gt; /etc/libvirt/qemu.conf and change the cgroup_device_acl via:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;cgroup_device_acl = [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;"/dev/null", "/dev/full", "/dev/zero",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;"/dev/random", "/dev/urandom",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;"/dev/ptmx", "/dev/kvm",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;"/dev/rtc","/dev/hpet",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;"/dev/sgx_enclave", "/dev/sgx_provision", "/dev/sgx_vepc"&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Configure&lt;/STRONG&gt; QEMU to run as root, set the user parameter in /etc/libvirt/qemu.conf:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;user = "root"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Set&lt;/STRONG&gt; the parameter to “apparmor”:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;security_driver = [ “apparmor” ]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Modify&lt;/STRONG&gt; /etc/apparmor.d/libvirt/TEMPLATE.qemu to read:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#include &amp;lt;tunables/global&amp;gt;&lt;/P&gt;&lt;P&gt;profile LIBVIRT_TEMPLATE flags=(attach_disconnected) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;#include &amp;lt;abstractions/libvirt-qemu&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;/usr/local/bin/* PUx,&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Restart&lt;/STRONG&gt; the libvirtd service:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sudo systemctl restart libvirtd&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that the information that I provided is useful for you. Please inform us if you have any questions.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ken&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 02 Mar 2023 02:13:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/SGX-enclave-attestation-inside-VM-fails-when-apparmor-enabled/m-p/1460874#M5670</guid>
      <dc:creator>KFPW_Intel</dc:creator>
      <dc:date>2023-03-02T02:13:50Z</dc:date>
    </item>
    <item>
      <title>Re:SGX enclave attestation inside VM fails when apparmor enabled.</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/SGX-enclave-attestation-inside-VM-fails-when-apparmor-enabled/m-p/1462464#M5677</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the accepted solution. Hope the information I provided was helpful to you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This thread has been marked as answered and Intel will no longer monitor this thread. If you want a response from Intel in a follow-up question, please open a new thread.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ken&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 07 Mar 2023 00:09:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/SGX-enclave-attestation-inside-VM-fails-when-apparmor-enabled/m-p/1462464#M5677</guid>
      <dc:creator>KFPW_Intel</dc:creator>
      <dc:date>2023-03-07T00:09:02Z</dc:date>
    </item>
  </channel>
</rss>

