<?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: Does this app support fetching data via proxy? in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Does-this-app-support-fetching-data-via-proxy/m-p/341349#M41185</link>
    <description>&lt;P&gt;hey guys,&lt;/P&gt;

&lt;P&gt;I deployed the TA on our Splunk deployment and it is behind a firewall. So I edited both input_module_MS_AAD_audit.py and input_module_MS_AAD_signins.py  as such:&lt;/P&gt;

&lt;P&gt;proxies = {&lt;BR /&gt;
     'http': '&lt;A href="http://my-proxy-server:3128" target="_blank"&gt;http://my-proxy-server:3128&lt;/A&gt;',&lt;BR /&gt;
     'https':'&lt;A href="http://my-proxy-server:3128" target="_blank"&gt;http://my-proxy-server:3128&lt;/A&gt;',&lt;BR /&gt;
    }&lt;BR /&gt;
    r = requests.get(url,proxies=proxies,headers=header)&lt;BR /&gt;
    ### r = requests.get(url, headers=header)&lt;/P&gt;

&lt;P&gt;But I am seeing this error:&lt;/P&gt;

&lt;P&gt;12-10-2018 16:37:11.737 -0500 ERROR ExecProcessor - message from "python /splunk/app/splunk/etc/apps/TA-MS-AAD/bin/MS_AAD_audit.py" ERRORcannot concatenate 'str' and 'exceptions.KeyError' objects&lt;/P&gt;

&lt;P&gt;12-10-2018 16:37:11.714 -0500 ERROR ExecProcessor - message from "python /splunk/app/splunk/etc/apps/TA-MS-AAD/bin/MS_AAD_audit.py" TypeError: cannot concatenate 'str' and 'exceptions.KeyError' objects&lt;/P&gt;

&lt;P&gt;12-10-2018 16:37:11.714 -0500 ERROR ExecProcessor - message from "python /splunk/app/splunk/etc/apps/TA-MS-AAD/bin/MS_AAD_audit.py"     header = {'Accept':'application/json', 'Authorization':'Bearer ' + access_token}&lt;/P&gt;

&lt;P&gt;12-10-2018 16:37:11.714 -0500 ERROR ExecProcessor - message from "python /splunk/app/splunk/etc/apps/TA-MS-AAD/bin/MS_AAD_audit.py"   File "/splunk/app/splunk/etc/apps/TA-MS-AAD/bin/input_module_MS_AAD_audit.py", line 90, in get_audit_events&lt;/P&gt;

&lt;P&gt;12-10-2018 16:37:11.714 -0500 ERROR ExecProcessor - message from "python /splunk/app/splunk/etc/apps/TA-MS-AAD/bin/MS_AAD_audit.py"     audit_events = get_audit_events(helper, access_token, url, max_records)&lt;/P&gt;

&lt;P&gt;12-10-2018 16:37:11.714 -0500 ERROR ExecProcessor - message from "python /splunk/app/splunk/etc/apps/TA-MS-AAD/bin/MS_AAD_audit.py"   File "/splunk/app/splunk/etc/apps/TA-MS-AAD/bin/input_module_MS_AAD_audit.py", line 129, in collect_events&lt;/P&gt;

&lt;P&gt;12-10-2018 16:37:11.714 -0500 ERROR ExecProcessor - message from "python /splunk/app/splunk/etc/apps/TA-MS-AAD/bin/MS_AAD_audit.py"     input_module.collect_events(self, ew)&lt;/P&gt;

&lt;P&gt;12-10-2018 16:37:11.714 -0500 ERROR ExecProcessor - message from "python /splunk/app/splunk/etc/apps/TA-MS-AAD/bin/MS_AAD_audit.py"   File "/splunk/app/splunk/etc/apps/TA-MS-AAD/bin/MS_AAD_audit.py", line 72, in collect_events&lt;/P&gt;

&lt;P&gt;I've plugged the Azure clientID and secretKey in the TA's config screen. What am I missing?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 22:19:52 GMT</pubDate>
    <dc:creator>hatalla</dc:creator>
    <dc:date>2020-09-29T22:19:52Z</dc:date>
    <item>
      <title>Does this app support fetching data via proxy?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Does-this-app-support-fetching-data-via-proxy/m-p/341345#M41181</link>
      <description>&lt;P&gt;I can not find any information on Splunkbase or in the .conf-files regarding support for using proxy for fetching data.&lt;/P&gt;

&lt;P&gt;I notice there is a function "remove_http_proxy_env_vars" in the python code, so I assume if the environment variable http_proxy is set, it is specifically removed when fetching data?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;def remove_http_proxy_env_vars():
    for k in ("http_proxy", "https_proxy"):
        if k in os.environ:
            del os.environ[k]
        elif k.upper() in os.environ:
            del os.environ[k.upper()]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there a way around this? Is support for proxy in the works for the next version? We have strict rules, forcing us to use proxy when connecting to the Internet. &lt;/P&gt;

&lt;P&gt;Cheers&lt;BR /&gt;
Rolf&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:23:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Does-this-app-support-fetching-data-via-proxy/m-p/341345#M41181</guid>
      <dc:creator>rvaglid</dc:creator>
      <dc:date>2020-09-29T18:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: Does this app support fetching data via proxy?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Does-this-app-support-fetching-data-via-proxy/m-p/341346#M41182</link>
      <description>&lt;P&gt;Not yet.  But, in the meantime, you can edit the input_module_MS_AAD_audit.py and input_module_MS_AAD_signins.py files.  These files do the work for the different inputs.  The &lt;A href="http://docs.python-requests.org/en/master/" target="_blank"&gt;Python requests&lt;/A&gt; library is utilized to make calls to the Microsoft APIs, and this library does support proxy severs.  Look for the following lines of code in the files:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;header = {'Authorization':'Bearer ' + access_token}
r = requests.get(url,headers=header)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Change it to:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;header = {'Authorization':'Bearer ' + access_token}
proxies = {
    'http': 'http://proxy_server_address:proxy_server_port',
    'https': 'http://proxy_server_address:proxy_server_port',
}
r = requests.get(url,proxies=proxies,headers=header)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:51:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Does-this-app-support-fetching-data-via-proxy/m-p/341346#M41182</guid>
      <dc:creator>jconger</dc:creator>
      <dc:date>2020-09-29T18:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Does this app support fetching data via proxy?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Does-this-app-support-fetching-data-via-proxy/m-p/341347#M41183</link>
      <description>&lt;P&gt;Thanks Jason, seems to work fine. We're running SSL-inspection on the proxies so I received the following, even tho the CA certificates are present in the OS cert store (RedHat 7.4):&lt;BR /&gt;
2018-04-06 12:20:58,356 ERROR pid=8322 tid=MainThread file=base_modinput.py:log_error:307 | Get error when collecting events.&lt;BR /&gt;
Traceback (most recent call last):&lt;BR /&gt;
  File "/opt/splunk/etc/apps/TA-MS-AAD/bin/ta_ms_aad/modinput_wrapper/base_modinput.py", line 127, in stream_events&lt;BR /&gt;
    self.collect_events(ew)&lt;BR /&gt;
  File "/opt/splunk/etc/apps/TA-MS-AAD/bin/MS_AAD_audit.py", line 68, in collect_events&lt;BR /&gt;
    input_module.collect_events(self, ew)&lt;BR /&gt;
  File "/opt/splunk/etc/apps/TA-MS-AAD/bin/input_module_MS_AAD_audit.py", line 75, in collect_events&lt;BR /&gt;
    r = requests.get(url,proxies=proxies,headers=header)&lt;BR /&gt;
  File "/opt/splunk/etc/apps/TA-MS-AAD/bin/ta_ms_aad/requests/api.py", line 70, in get&lt;BR /&gt;
    return request('get', url, params=params, **kwargs)&lt;BR /&gt;
  File "/opt/splunk/etc/apps/TA-MS-AAD/bin/ta_ms_aad/requests/api.py", line 56, in request&lt;BR /&gt;
    return session.request(method=method, url=url, **kwargs)&lt;BR /&gt;
  File "/opt/splunk/etc/apps/TA-MS-AAD/bin/ta_ms_aad/requests/sessions.py", line 488, in request&lt;BR /&gt;
    resp = self.send(prep, **send_kwargs)&lt;BR /&gt;
  File "/opt/splunk/etc/apps/TA-MS-AAD/bin/ta_ms_aad/requests/sessions.py", line 609, in send&lt;BR /&gt;
    r = adapter.send(request, **kwargs)&lt;BR /&gt;
  File "/opt/splunk/etc/apps/TA-MS-AAD/bin/ta_ms_aad/requests/adapters.py", line 497, in send&lt;BR /&gt;
    raise SSLError(e, request=request)&lt;BR /&gt;
SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:676)&lt;/P&gt;

&lt;P&gt;I did a bit of digging and changed the following in ta_ms_aad/modinput_wrapper/base_modinput.py to point to the correct CA store:&lt;BR /&gt;
return self.rest_helper.send_http_request(url=url, method=method, parameters=parameters, payload=payload,&lt;BR /&gt;
  headers=headers, cookies=cookies, verify='/etc/pki/tls/certs/ca-bundle.crt', cert=cert,&lt;BR /&gt;
  timeout=timeout,  proxy_uri=self._get_proxy_uri() if use_proxy else None)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:53:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Does-this-app-support-fetching-data-via-proxy/m-p/341347#M41183</guid>
      <dc:creator>rvaglid</dc:creator>
      <dc:date>2020-09-29T18:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: Does this app support fetching data via proxy?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Does-this-app-support-fetching-data-via-proxy/m-p/341348#M41184</link>
      <description>&lt;P&gt;Is there an ETA of this proxy functionality being added to this TA?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 06:26:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Does-this-app-support-fetching-data-via-proxy/m-p/341348#M41184</guid>
      <dc:creator>pclemo_bw</dc:creator>
      <dc:date>2018-06-01T06:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: Does this app support fetching data via proxy?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Does-this-app-support-fetching-data-via-proxy/m-p/341349#M41185</link>
      <description>&lt;P&gt;hey guys,&lt;/P&gt;

&lt;P&gt;I deployed the TA on our Splunk deployment and it is behind a firewall. So I edited both input_module_MS_AAD_audit.py and input_module_MS_AAD_signins.py  as such:&lt;/P&gt;

&lt;P&gt;proxies = {&lt;BR /&gt;
     'http': '&lt;A href="http://my-proxy-server:3128" target="_blank"&gt;http://my-proxy-server:3128&lt;/A&gt;',&lt;BR /&gt;
     'https':'&lt;A href="http://my-proxy-server:3128" target="_blank"&gt;http://my-proxy-server:3128&lt;/A&gt;',&lt;BR /&gt;
    }&lt;BR /&gt;
    r = requests.get(url,proxies=proxies,headers=header)&lt;BR /&gt;
    ### r = requests.get(url, headers=header)&lt;/P&gt;

&lt;P&gt;But I am seeing this error:&lt;/P&gt;

&lt;P&gt;12-10-2018 16:37:11.737 -0500 ERROR ExecProcessor - message from "python /splunk/app/splunk/etc/apps/TA-MS-AAD/bin/MS_AAD_audit.py" ERRORcannot concatenate 'str' and 'exceptions.KeyError' objects&lt;/P&gt;

&lt;P&gt;12-10-2018 16:37:11.714 -0500 ERROR ExecProcessor - message from "python /splunk/app/splunk/etc/apps/TA-MS-AAD/bin/MS_AAD_audit.py" TypeError: cannot concatenate 'str' and 'exceptions.KeyError' objects&lt;/P&gt;

&lt;P&gt;12-10-2018 16:37:11.714 -0500 ERROR ExecProcessor - message from "python /splunk/app/splunk/etc/apps/TA-MS-AAD/bin/MS_AAD_audit.py"     header = {'Accept':'application/json', 'Authorization':'Bearer ' + access_token}&lt;/P&gt;

&lt;P&gt;12-10-2018 16:37:11.714 -0500 ERROR ExecProcessor - message from "python /splunk/app/splunk/etc/apps/TA-MS-AAD/bin/MS_AAD_audit.py"   File "/splunk/app/splunk/etc/apps/TA-MS-AAD/bin/input_module_MS_AAD_audit.py", line 90, in get_audit_events&lt;/P&gt;

&lt;P&gt;12-10-2018 16:37:11.714 -0500 ERROR ExecProcessor - message from "python /splunk/app/splunk/etc/apps/TA-MS-AAD/bin/MS_AAD_audit.py"     audit_events = get_audit_events(helper, access_token, url, max_records)&lt;/P&gt;

&lt;P&gt;12-10-2018 16:37:11.714 -0500 ERROR ExecProcessor - message from "python /splunk/app/splunk/etc/apps/TA-MS-AAD/bin/MS_AAD_audit.py"   File "/splunk/app/splunk/etc/apps/TA-MS-AAD/bin/input_module_MS_AAD_audit.py", line 129, in collect_events&lt;/P&gt;

&lt;P&gt;12-10-2018 16:37:11.714 -0500 ERROR ExecProcessor - message from "python /splunk/app/splunk/etc/apps/TA-MS-AAD/bin/MS_AAD_audit.py"     input_module.collect_events(self, ew)&lt;/P&gt;

&lt;P&gt;12-10-2018 16:37:11.714 -0500 ERROR ExecProcessor - message from "python /splunk/app/splunk/etc/apps/TA-MS-AAD/bin/MS_AAD_audit.py"   File "/splunk/app/splunk/etc/apps/TA-MS-AAD/bin/MS_AAD_audit.py", line 72, in collect_events&lt;/P&gt;

&lt;P&gt;I've plugged the Azure clientID and secretKey in the TA's config screen. What am I missing?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:19:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Does-this-app-support-fetching-data-via-proxy/m-p/341349#M41185</guid>
      <dc:creator>hatalla</dc:creator>
      <dc:date>2020-09-29T22:19:52Z</dc:date>
    </item>
  </channel>
</rss>

