<?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 OSX - Unsigned library raises error for python3 modular input? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/OSX-Unsigned-library-raises-error-for-python3-modular-input/m-p/620344#M107290</link>
    <description>&lt;P&gt;Hi, I developed a modular input making use of Python Cryptodome library (&lt;A href="https://pycryptodome.readthedocs.io/en/latest/index.html" target="_blank" rel="noopener"&gt;https://pycryptodome.readthedocs.io&lt;/A&gt;). When executing it on a Mac OsX Ventura, it raises the error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;... _raw_ecb.abi3.so' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When executing the same code with a brew-installed python3.7, the code runs fine.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;H3&gt;Minimal example&lt;/H3&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;# create and activate a virtual environment:
python3.7 -m venv venv
source venv/bin/activate
# install necessary lib
python3.7 -m pip install pycryptodomex
# exit the virtual env
deactivate
# move to where the packages have been stored
cd venv/lib/python3.7/site-packages&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Test #1&lt;/H3&gt;
&lt;P&gt;Execute "python3.7", and then type:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; from Cryptodome.Cipher import AES&lt;/P&gt;
&lt;P&gt;---&amp;gt; no error is raised&lt;/P&gt;
&lt;H3&gt;Test #2&lt;/H3&gt;
&lt;P&gt;Start the python3 interpreter bundled in splunk&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; splunk cmd python3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;&amp;gt;&amp;gt;&amp;gt; from Cryptodome.Cipher import AES

OSError: Cannot load native module 'Cryptodome.Cipher._raw_ecb': Not found '_raw_ecb.cpython-37m-darwin.so', Cannot load '_raw_ecb.abi3.so'
...
.../_raw_ecb.abi3.so' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), Not found '_raw_ecb.so'&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I found this interesting article about similar problems on Inkscape: &lt;A href="https://gitlab.com/inkscape/inkscape/-/issues/2299" target="_blank" rel="noopener"&gt;https://gitlab.com/inkscape/inkscape/-/issues/2299&lt;/A&gt; and then I executed:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; codesign -d --entitlements - /Applications/Splunk/bin/python3.7m&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Executable=/Applications/Splunk/bin/python3.7m&lt;BR /&gt;&amp;nbsp;&amp;nbsp; [Dict]&lt;BR /&gt;&amp;nbsp;&amp;nbsp; [Key] com.apple.security.cs.disable-executable-page-protection&lt;BR /&gt;&amp;nbsp;&amp;nbsp; [Value] [Bool] true&lt;/P&gt;
&lt;P&gt;There is no allowance for unsigned libraries, apparently.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried this with Splunk v8.2.7 and v9.0.2 on an Intel-based Mac OSx Ventura.&lt;/P&gt;
&lt;P&gt;Do you have any suggestions?&lt;/P&gt;</description>
    <pubDate>Thu, 10 Nov 2022 15:26:32 GMT</pubDate>
    <dc:creator>paolo_prigione1</dc:creator>
    <dc:date>2022-11-10T15:26:32Z</dc:date>
    <item>
      <title>OSX - Unsigned library raises error for python3 modular input?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/OSX-Unsigned-library-raises-error-for-python3-modular-input/m-p/620344#M107290</link>
      <description>&lt;P&gt;Hi, I developed a modular input making use of Python Cryptodome library (&lt;A href="https://pycryptodome.readthedocs.io/en/latest/index.html" target="_blank" rel="noopener"&gt;https://pycryptodome.readthedocs.io&lt;/A&gt;). When executing it on a Mac OsX Ventura, it raises the error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;... _raw_ecb.abi3.so' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When executing the same code with a brew-installed python3.7, the code runs fine.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;H3&gt;Minimal example&lt;/H3&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;# create and activate a virtual environment:
python3.7 -m venv venv
source venv/bin/activate
# install necessary lib
python3.7 -m pip install pycryptodomex
# exit the virtual env
deactivate
# move to where the packages have been stored
cd venv/lib/python3.7/site-packages&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Test #1&lt;/H3&gt;
&lt;P&gt;Execute "python3.7", and then type:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; from Cryptodome.Cipher import AES&lt;/P&gt;
&lt;P&gt;---&amp;gt; no error is raised&lt;/P&gt;
&lt;H3&gt;Test #2&lt;/H3&gt;
&lt;P&gt;Start the python3 interpreter bundled in splunk&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; splunk cmd python3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;&amp;gt;&amp;gt;&amp;gt; from Cryptodome.Cipher import AES

OSError: Cannot load native module 'Cryptodome.Cipher._raw_ecb': Not found '_raw_ecb.cpython-37m-darwin.so', Cannot load '_raw_ecb.abi3.so'
...
.../_raw_ecb.abi3.so' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), Not found '_raw_ecb.so'&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I found this interesting article about similar problems on Inkscape: &lt;A href="https://gitlab.com/inkscape/inkscape/-/issues/2299" target="_blank" rel="noopener"&gt;https://gitlab.com/inkscape/inkscape/-/issues/2299&lt;/A&gt; and then I executed:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; codesign -d --entitlements - /Applications/Splunk/bin/python3.7m&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Executable=/Applications/Splunk/bin/python3.7m&lt;BR /&gt;&amp;nbsp;&amp;nbsp; [Dict]&lt;BR /&gt;&amp;nbsp;&amp;nbsp; [Key] com.apple.security.cs.disable-executable-page-protection&lt;BR /&gt;&amp;nbsp;&amp;nbsp; [Value] [Bool] true&lt;/P&gt;
&lt;P&gt;There is no allowance for unsigned libraries, apparently.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried this with Splunk v8.2.7 and v9.0.2 on an Intel-based Mac OSx Ventura.&lt;/P&gt;
&lt;P&gt;Do you have any suggestions?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 15:26:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/OSX-Unsigned-library-raises-error-for-python3-modular-input/m-p/620344#M107290</guid>
      <dc:creator>paolo_prigione1</dc:creator>
      <dc:date>2022-11-10T15:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: OSX - Unsigned library raises error for python3 modular input?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/OSX-Unsigned-library-raises-error-for-python3-modular-input/m-p/623605#M107291</link>
      <description>&lt;P&gt;Having roughly the same issue with the cryptography dependancy. Did you ever find a solution?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 16:07:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/OSX-Unsigned-library-raises-error-for-python3-modular-input/m-p/623605#M107291</guid>
      <dc:creator>harry26</dc:creator>
      <dc:date>2022-12-07T16:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: OSX - Unsigned library raises error for python3 modular input?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/OSX-Unsigned-library-raises-error-for-python3-modular-input/m-p/623617#M107293</link>
      <description>&lt;P&gt;Not sure if I have the answer to your question but I want to update you regarding one thing:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Splunk's Python built is not the same as what is published as Python build.&lt;/LI&gt;&lt;LI&gt;Splunk removes a lot of unused packages and adds more Splunk-related python packages.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps!!!&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 17:48:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/OSX-Unsigned-library-raises-error-for-python3-modular-input/m-p/623617#M107293</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2022-12-07T17:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: OSX - Unsigned library raises error for python3 modular input?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/OSX-Unsigned-library-raises-error-for-python3-modular-input/m-p/625634#M107529</link>
      <description>&lt;P&gt;&lt;SPAN&gt;not really, I have to try other packages, or re-implement the modular input using golang and&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/prigio/splunk-go-sdk" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/prigio/splunk-go-sdk&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2023 16:15:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/OSX-Unsigned-library-raises-error-for-python3-modular-input/m-p/625634#M107529</guid>
      <dc:creator>paolo_prigione1</dc:creator>
      <dc:date>2023-01-02T16:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: OSX - Unsigned library raises error for python3 modular input?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/OSX-Unsigned-library-raises-error-for-python3-modular-input/m-p/625635#M107530</link>
      <description>&lt;P&gt;Thanks for pointing that out. It is known to me, and this is the first time I encounter such an issue.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2023 16:16:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/OSX-Unsigned-library-raises-error-for-python3-modular-input/m-p/625635#M107530</guid>
      <dc:creator>paolo_prigione1</dc:creator>
      <dc:date>2023-01-02T16:16:33Z</dc:date>
    </item>
  </channel>
</rss>

