<?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 Scripted PAM authentication in 8.1.2 in Security</title>
    <link>https://community.splunk.com/t5/Security/Scripted-PAM-authentication-in-8-1-2/m-p/540868#M12100</link>
    <description>&lt;P&gt;We have setup a distributed sandbox system with release 8.1.2.&lt;/P&gt;&lt;P&gt;We have configured scripted authentication on our search head based on the PAM scripts located in $SPLUNK_HOME/share/splunk/authScriptSamples. We are using the userMapping.py, pamScripted.py and a compiled version of pamauth.c in our setup. We have made some minor modifications to pamScripted.py to make sure that the script only returns users that are in userMapping.py instead of everyone in /etc/passwd, otherwise we have just followed the configuration guidelines in Securing the Splunk Platform manual.&lt;BR /&gt;When a user tries to login we get errors in splunkd.log like these&lt;/P&gt;&lt;P&gt;TypeError: memoryview: a bytes-like object is required, not 'str'&lt;/P&gt;&lt;P&gt;The full sequence of error messages are&lt;BR /&gt;ERROR ScriptRunner - stderr from '/opt/splunk/bin/python3.7 /opt/splunk/pamscripts/pamScripted.py userLogin': usage: Traceback (most recent call last):&lt;BR /&gt;ERROR ScriptRunner - stderr from '/opt/splunk/bin/python3.7 /opt/splunk/pamscripts/pamScripted.py userLogin': File "/opt/splunk/pamscripts/pamScripted.py", line 177, in &amp;lt;module&amp;gt;&lt;BR /&gt;ERROR ScriptRunner - stderr from '/opt/splunk/bin/python3.7 /opt/splunk/pamscripts/pamScripted.py userLogin': userLogin( dictIn )&lt;BR /&gt;ERROR ScriptRunner - stderr from '/opt/splunk/bin/python3.7 /opt/splunk/pamscripts/pamScripted.py userLogin': File "/opt/splunk/pamscripts/pamScripted.py", line 60, in userLogin&lt;BR /&gt;ERROR ScriptRunner - stderr from '/opt/splunk/bin/python3.7 /opt/splunk/pamscripts/pamScripted.py userLogin': output = proc.communicate( infoIn['password'] )&lt;BR /&gt;ERROR ScriptRunner - stderr from '/opt/splunk/bin/python3.7 /opt/splunk/pamscripts/pamScripted.py userLogin': File "/opt/splunk/lib/python3.7/subprocess.py", line 964, in communicate&lt;BR /&gt;ERROR ScriptRunner - stderr from '/opt/splunk/bin/python3.7 /opt/splunk/pamscripts/pamScripted.py userLogin': stdout, stderr = self._communicate(input, endtime, timeout)&lt;BR /&gt;ERROR ScriptRunner - stderr from '/opt/splunk/bin/python3.7 /opt/splunk/pamscripts/pamScripted.py userLogin': File "/opt/splunk/lib/python3.7/subprocess.py", line 1695, in _communicate&lt;BR /&gt;ERROR ScriptRunner - stderr from '/opt/splunk/bin/python3.7 /opt/splunk/pamscripts/pamScripted.py userLogin': input_view = memoryview(self._input)&lt;BR /&gt;ERROR ScriptRunner - stderr from '/opt/splunk/bin/python3.7 /opt/splunk/pamscripts/pamScripted.py userLogin': TypeError: memoryview: a bytes-like object is required, not 'str'&lt;/P&gt;&lt;P&gt;Seems to me that the pamScripted.py script has not been changed to work under python 3.7.&lt;/P&gt;&lt;P&gt;Did anyone manage to make it work in earlier versions of release 8?&lt;/P&gt;</description>
    <pubDate>Mon, 22 Feb 2021 16:35:30 GMT</pubDate>
    <dc:creator>Marlan</dc:creator>
    <dc:date>2021-02-22T16:35:30Z</dc:date>
    <item>
      <title>Scripted PAM authentication in 8.1.2</title>
      <link>https://community.splunk.com/t5/Security/Scripted-PAM-authentication-in-8-1-2/m-p/540868#M12100</link>
      <description>&lt;P&gt;We have setup a distributed sandbox system with release 8.1.2.&lt;/P&gt;&lt;P&gt;We have configured scripted authentication on our search head based on the PAM scripts located in $SPLUNK_HOME/share/splunk/authScriptSamples. We are using the userMapping.py, pamScripted.py and a compiled version of pamauth.c in our setup. We have made some minor modifications to pamScripted.py to make sure that the script only returns users that are in userMapping.py instead of everyone in /etc/passwd, otherwise we have just followed the configuration guidelines in Securing the Splunk Platform manual.&lt;BR /&gt;When a user tries to login we get errors in splunkd.log like these&lt;/P&gt;&lt;P&gt;TypeError: memoryview: a bytes-like object is required, not 'str'&lt;/P&gt;&lt;P&gt;The full sequence of error messages are&lt;BR /&gt;ERROR ScriptRunner - stderr from '/opt/splunk/bin/python3.7 /opt/splunk/pamscripts/pamScripted.py userLogin': usage: Traceback (most recent call last):&lt;BR /&gt;ERROR ScriptRunner - stderr from '/opt/splunk/bin/python3.7 /opt/splunk/pamscripts/pamScripted.py userLogin': File "/opt/splunk/pamscripts/pamScripted.py", line 177, in &amp;lt;module&amp;gt;&lt;BR /&gt;ERROR ScriptRunner - stderr from '/opt/splunk/bin/python3.7 /opt/splunk/pamscripts/pamScripted.py userLogin': userLogin( dictIn )&lt;BR /&gt;ERROR ScriptRunner - stderr from '/opt/splunk/bin/python3.7 /opt/splunk/pamscripts/pamScripted.py userLogin': File "/opt/splunk/pamscripts/pamScripted.py", line 60, in userLogin&lt;BR /&gt;ERROR ScriptRunner - stderr from '/opt/splunk/bin/python3.7 /opt/splunk/pamscripts/pamScripted.py userLogin': output = proc.communicate( infoIn['password'] )&lt;BR /&gt;ERROR ScriptRunner - stderr from '/opt/splunk/bin/python3.7 /opt/splunk/pamscripts/pamScripted.py userLogin': File "/opt/splunk/lib/python3.7/subprocess.py", line 964, in communicate&lt;BR /&gt;ERROR ScriptRunner - stderr from '/opt/splunk/bin/python3.7 /opt/splunk/pamscripts/pamScripted.py userLogin': stdout, stderr = self._communicate(input, endtime, timeout)&lt;BR /&gt;ERROR ScriptRunner - stderr from '/opt/splunk/bin/python3.7 /opt/splunk/pamscripts/pamScripted.py userLogin': File "/opt/splunk/lib/python3.7/subprocess.py", line 1695, in _communicate&lt;BR /&gt;ERROR ScriptRunner - stderr from '/opt/splunk/bin/python3.7 /opt/splunk/pamscripts/pamScripted.py userLogin': input_view = memoryview(self._input)&lt;BR /&gt;ERROR ScriptRunner - stderr from '/opt/splunk/bin/python3.7 /opt/splunk/pamscripts/pamScripted.py userLogin': TypeError: memoryview: a bytes-like object is required, not 'str'&lt;/P&gt;&lt;P&gt;Seems to me that the pamScripted.py script has not been changed to work under python 3.7.&lt;/P&gt;&lt;P&gt;Did anyone manage to make it work in earlier versions of release 8?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 16:35:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Scripted-PAM-authentication-in-8-1-2/m-p/540868#M12100</guid>
      <dc:creator>Marlan</dc:creator>
      <dc:date>2021-02-22T16:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted PAM authentication in 8.1.2</title>
      <link>https://community.splunk.com/t5/Security/Scripted-PAM-authentication-in-8-1-2/m-p/541035#M12101</link>
      <description>&lt;P&gt;The solution was to modify this line in pamScripted.py&lt;/P&gt;&lt;P&gt;Replace in line 60&lt;BR /&gt;output = proc.communicate( infoIn['password'] )&lt;BR /&gt;with&lt;BR /&gt;output = proc.communicate( bytes(infoIn['password'],'utf8') )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 15:50:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Scripted-PAM-authentication-in-8-1-2/m-p/541035#M12101</guid>
      <dc:creator>Marlan</dc:creator>
      <dc:date>2021-02-23T15:50:19Z</dc:date>
    </item>
  </channel>
</rss>

