<?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: External Auth remote IP in NSO Developer Hub Discussions</title>
    <link>https://community.cisco.com/t5/nso-developer-hub-discussions/external-auth-remote-ip/m-p/3958752#M4516</link>
    <description>&lt;P&gt;Thank you /Ram.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That did the trick. After changing the ncs.conf&lt;/P&gt;&lt;PRE&gt; &amp;lt;aaa&amp;gt;
    &amp;lt;ssh-server-key-dir&amp;gt;${NCS_CONFIG_DIR}/ssh&amp;lt;/ssh-server-key-dir&amp;gt;

    &amp;lt;!-- Depending on OS - and also depending on user requirements --&amp;gt;
    &amp;lt;!-- the pam service value value must be tuned. --&amp;gt;

    &amp;lt;pam&amp;gt;
      &amp;lt;enabled&amp;gt;true&amp;lt;/enabled&amp;gt;
      &amp;lt;service&amp;gt;common-auth&amp;lt;/service&amp;gt;
    &amp;lt;/pam&amp;gt;
    &amp;lt;external-authentication&amp;gt;
      &amp;lt;enabled&amp;gt;true&amp;lt;/enabled&amp;gt;
      &amp;lt;include-extra&amp;gt;true&amp;lt;/include-extra&amp;gt;
      &amp;lt;executable&amp;gt;python /sbin/tacacs_test.py&amp;lt;/executable&amp;gt;
    &amp;lt;/external-authentication&amp;gt;

    &amp;lt;local-authentication&amp;gt;
      &amp;lt;enabled&amp;gt;false&amp;lt;/enabled&amp;gt;
    &amp;lt;/local-authentication&amp;gt;

    &amp;lt;expiration-warning&amp;gt;prompt&amp;lt;/expiration-warning&amp;gt;
  &amp;lt;/aaa&amp;gt;&lt;/PRE&gt;&lt;P&gt;I can now filter and send the rem ip and port.&lt;/P&gt;&lt;PRE&gt;tail: /var/log/nso_external_auth.log: file truncated
11-14 11:26 root INFO username: BAD_User, authen response: False, HOST: 192.168.99.10, PORT: 50850&lt;/PRE&gt;</description>
    <pubDate>Thu, 14 Nov 2019 17:30:02 GMT</pubDate>
    <dc:creator>tsiemers1</dc:creator>
    <dc:date>2019-11-14T17:30:02Z</dc:date>
    <item>
      <title>External Auth remote IP</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/external-auth-remote-ip/m-p/3958738#M4514</link>
      <description>&lt;P&gt;Trying to implement fail2ban onto the NSO service fro external auth.&amp;nbsp; According to the docs NSO sends via stdin username and password. See the picture below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to add other fields to this? More specifically the remote IP of the auth request. This way we can implement fail2ban. Currently, the audit.log shows the from &amp;lt;HOST&amp;gt; but using a custom script for auth only sends via stdin (username, password).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So something like this:&lt;BR /&gt;#logging.info("userpass info: {}".format(user_pass_split))&lt;BR /&gt;username = user_pass_split[0]&lt;BR /&gt;password = user_pass_split[1]&lt;/P&gt;&lt;P&gt;remote_ip = user_pass_split[2]&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 760px;"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/49409i7EE6154AD05839AF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2019 17:08:11 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/external-auth-remote-ip/m-p/3958738#M4514</guid>
      <dc:creator>tsiemers1</dc:creator>
      <dc:date>2019-11-14T17:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: External Auth remote IP</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/external-auth-remote-ip/m-p/3958743#M4515</link>
      <description>&lt;P&gt;You can configure "/ncs-config/aaa/external-authentication/include-extra" to "true" in ncs.conf.&lt;/P&gt;
&lt;P&gt;From the man page for ncs.conf:&lt;/P&gt;
&lt;PRE&gt;       /ncs-config/aaa/external-authentication/include-extra (boolean) [false]
           When set to 'true', additional information items will be provided to the executable: &lt;BR /&gt;           source IP address and port, context, and protocol. I.e. the complete format
           will be '[${USER};${PASS};${IP};${PORT};${CONTEXT};${PROTO};]\n'. &lt;BR /&gt;           Example: '[bob;secret;192.168.1.1;12345;cli;ssh;]\n'.
&lt;/PRE&gt;
&lt;P&gt;/Ram&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2019 17:19:11 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/external-auth-remote-ip/m-p/3958743#M4515</guid>
      <dc:creator>ramkraja</dc:creator>
      <dc:date>2019-11-14T17:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: External Auth remote IP</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/external-auth-remote-ip/m-p/3958752#M4516</link>
      <description>&lt;P&gt;Thank you /Ram.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That did the trick. After changing the ncs.conf&lt;/P&gt;&lt;PRE&gt; &amp;lt;aaa&amp;gt;
    &amp;lt;ssh-server-key-dir&amp;gt;${NCS_CONFIG_DIR}/ssh&amp;lt;/ssh-server-key-dir&amp;gt;

    &amp;lt;!-- Depending on OS - and also depending on user requirements --&amp;gt;
    &amp;lt;!-- the pam service value value must be tuned. --&amp;gt;

    &amp;lt;pam&amp;gt;
      &amp;lt;enabled&amp;gt;true&amp;lt;/enabled&amp;gt;
      &amp;lt;service&amp;gt;common-auth&amp;lt;/service&amp;gt;
    &amp;lt;/pam&amp;gt;
    &amp;lt;external-authentication&amp;gt;
      &amp;lt;enabled&amp;gt;true&amp;lt;/enabled&amp;gt;
      &amp;lt;include-extra&amp;gt;true&amp;lt;/include-extra&amp;gt;
      &amp;lt;executable&amp;gt;python /sbin/tacacs_test.py&amp;lt;/executable&amp;gt;
    &amp;lt;/external-authentication&amp;gt;

    &amp;lt;local-authentication&amp;gt;
      &amp;lt;enabled&amp;gt;false&amp;lt;/enabled&amp;gt;
    &amp;lt;/local-authentication&amp;gt;

    &amp;lt;expiration-warning&amp;gt;prompt&amp;lt;/expiration-warning&amp;gt;
  &amp;lt;/aaa&amp;gt;&lt;/PRE&gt;&lt;P&gt;I can now filter and send the rem ip and port.&lt;/P&gt;&lt;PRE&gt;tail: /var/log/nso_external_auth.log: file truncated
11-14 11:26 root INFO username: BAD_User, authen response: False, HOST: 192.168.99.10, PORT: 50850&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Nov 2019 17:30:02 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/external-auth-remote-ip/m-p/3958752#M4516</guid>
      <dc:creator>tsiemers1</dc:creator>
      <dc:date>2019-11-14T17:30:02Z</dc:date>
    </item>
  </channel>
</rss>

