<?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 Developing Splunk app in Add-On Builder using pyopenssl in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Developing-Splunk-app-in-Add-On-Builder-using-pyopenssl/m-p/569626#M10104</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to build a new app using the Add-On Builder and am having problems getting OpenSSL functioning with my input. Has anyone successfully accomplished this and has the commands they can share?&lt;/P&gt;&lt;P&gt;This is the command I am using to import the module to "myapp/bin/lib"&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;/Applications/Splunk/bin/splunk cmd pip3 install pyopenssl --target /Applications/Splunk/etc/apps/myapp/bin/lib --trusted-host pypi.org --trusted-host files.pythonhosted.org&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I then use this in myapp's code:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;from lib.OpenSSL import SSL&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;This is the error I get when testing:&lt;BR /&gt;&lt;BR /&gt;File "/Applications/Splunk/etc/apps/myapp/bin/lib/OpenSSL/__init__.py", line 8, in &amp;lt;module&amp;gt;&lt;BR /&gt;from OpenSSL import crypto, SSL&lt;BR /&gt;ModuleNotFoundError: No module named 'OpenSSL'&lt;/P&gt;</description>
    <pubDate>Mon, 04 Oct 2021 23:02:28 GMT</pubDate>
    <dc:creator>ohbuckeyeio</dc:creator>
    <dc:date>2021-10-04T23:02:28Z</dc:date>
    <item>
      <title>Developing Splunk app in Add-On Builder using pyopenssl</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Developing-Splunk-app-in-Add-On-Builder-using-pyopenssl/m-p/569626#M10104</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to build a new app using the Add-On Builder and am having problems getting OpenSSL functioning with my input. Has anyone successfully accomplished this and has the commands they can share?&lt;/P&gt;&lt;P&gt;This is the command I am using to import the module to "myapp/bin/lib"&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;/Applications/Splunk/bin/splunk cmd pip3 install pyopenssl --target /Applications/Splunk/etc/apps/myapp/bin/lib --trusted-host pypi.org --trusted-host files.pythonhosted.org&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I then use this in myapp's code:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;from lib.OpenSSL import SSL&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;This is the error I get when testing:&lt;BR /&gt;&lt;BR /&gt;File "/Applications/Splunk/etc/apps/myapp/bin/lib/OpenSSL/__init__.py", line 8, in &amp;lt;module&amp;gt;&lt;BR /&gt;from OpenSSL import crypto, SSL&lt;BR /&gt;ModuleNotFoundError: No module named 'OpenSSL'&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 23:02:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Developing-Splunk-app-in-Add-On-Builder-using-pyopenssl/m-p/569626#M10104</guid>
      <dc:creator>ohbuckeyeio</dc:creator>
      <dc:date>2021-10-04T23:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: Developing Splunk app in Add-On Builder using pyopenssl</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Developing-Splunk-app-in-Add-On-Builder-using-pyopenssl/m-p/571189#M10105</link>
      <description>&lt;P&gt;It looks like the cryptography module, when installed, becomes specific to your OS's security considerations. In addition, I was unable to get OpenSSL to install on my Mac without having issues with the cryptography module's trust. This would have caused problems trying to package this up for migration to other machines, so I pivoted to using popen and the OS's version of pyOpenSSL.&lt;/P&gt;&lt;P&gt;Here is the code from the modular input:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;ta_home = os.path.dirname(os.path.dirname(__file__))
cert_crawler=ta_home+"/bin/certificate_crawler.py"
python_path="/usr/bin/python3"

openssl_reply = Popen([helper.get_arg('python_path'), cert_crawler]+host_args, stdin=PIPE, stdout=PIPE, stderr=PIPE)
                
output,error = openssl_reply.communicate()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;certificate_crawler.py&lt;/P&gt;&lt;P&gt;Then accepts the arguments, passing them to a readCerts() function to perform the socket.do_handshake()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from optparse import OptionParser

#Parse options passed by the calling modular input
parser = OptionParser()
(options, args) = parser.parse_args()

host = args[0]
ip = args[1]
port = args[2]
timeout_seconds = args[3]

result = readCerts(host,ip,port,timeout_seconds)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 22:34:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Developing-Splunk-app-in-Add-On-Builder-using-pyopenssl/m-p/571189#M10105</guid>
      <dc:creator>ohbuckeyeio</dc:creator>
      <dc:date>2021-10-15T22:34:51Z</dc:date>
    </item>
  </channel>
</rss>

