<?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: CSRF problem with a reverse proxy in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Any-clues-as-to-how-to-fix-the-header-setting-problem-or-how-to/m-p/434242#M2923</link>
    <description>&lt;P&gt;Hey, can you please guide, where is this code?&lt;BR /&gt;
Where have you commented?&lt;/P&gt;</description>
    <pubDate>Fri, 21 Feb 2020 08:42:38 GMT</pubDate>
    <dc:creator>sarvesh_11</dc:creator>
    <dc:date>2020-02-21T08:42:38Z</dc:date>
    <item>
      <title>Any clues as to how to fix the header setting problem, or how to disable CSRF?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Any-clues-as-to-how-to-fix-the-header-setting-problem-or-how-to/m-p/434235#M2916</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;I have a problem when accessing Splunk over a reverse proxy. It seems that the required HTTP Header&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;X-Splunk-Form-Key
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is not being set by the browser. This is despite the fact that the browser has the cookie&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;splunkweb_csrf_token_8443
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;from where (I guess) it copies the CSRF token. This results in error messages of the form&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;ERROR UiAuth - Request from 10.0.0.1 to "/splunk/en-GB/splunkd/__raw/servicesNS/userName/appName/search/jobs" failed CSRF validation -- expected "8617041906791058522", but instead cookie had "8617041906791058522" and header had ""
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;When accessing Splunk directly the HTTP header is set correctly and no errors occur.&lt;/P&gt;
&lt;P&gt;There would be two ways to fix this: 1) find out why the header is not set, or 2) disable CSRF (as a workaround). But I have had no success with either.&lt;/P&gt;
&lt;P&gt;Disabling CSRF should be possible using web.conf, but I have tried all combinations I can think of. For example, stanzas like this that try to cover all endpoints:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;[expose:all]
methods = GET,POST
pattern = **
skipCSRFProtection = 1
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or, more for more specific endpoints:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;[expose:search]
methods = GET,POST
pattern = search/**
skipCSRFProtection = 1
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But I continue to get the CSRF validation errors.&lt;/P&gt;
&lt;P&gt;Any clues as to how to fix the header setting problem, or how to disable CSRF?&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 13:51:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Any-clues-as-to-how-to-fix-the-header-setting-problem-or-how-to/m-p/434235#M2916</guid>
      <dc:creator>plaxosi</dc:creator>
      <dc:date>2022-11-29T13:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: CSRF problem with a reverse proxy</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Any-clues-as-to-how-to-fix-the-header-setting-problem-or-how-to/m-p/434236#M2917</link>
      <description>&lt;P&gt;Try increasing connection timeout between the browser and Splunk web as below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;server.socket_timeout = &amp;lt;integer&amp;gt;
* The timeout, in seconds, for accepted connections between the browser and  Splunk Web
* Default: 10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can you get the timeout increased to &lt;STRONG&gt;60&lt;/STRONG&gt; in &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Admin/Webconf"&gt;web.conf&lt;/A&gt; and restart the Splunk instance?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;server.socket_timeout = 60
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Aug 2019 04:34:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Any-clues-as-to-how-to-fix-the-header-setting-problem-or-how-to/m-p/434236#M2917</guid>
      <dc:creator>jawaharas</dc:creator>
      <dc:date>2019-08-26T04:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: CSRF problem with a reverse proxy</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Any-clues-as-to-how-to-fix-the-header-setting-problem-or-how-to/m-p/434237#M2918</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Were you able to fix this?&lt;BR /&gt;
I've got the exact same issue : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;failed CSRF validation -- expected "123456", but instead cookie had "123456" and header had ""
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've got Splunk 7.2.7 behind a Reverse proxy.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 08:16:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Any-clues-as-to-how-to-fix-the-header-setting-problem-or-how-to/m-p/434237#M2918</guid>
      <dc:creator>davietch</dc:creator>
      <dc:date>2019-09-06T08:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: CSRF problem with a reverse proxy</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Any-clues-as-to-how-to-fix-the-header-setting-problem-or-how-to/m-p/434238#M2919</link>
      <description>&lt;P&gt;@davietch &lt;BR /&gt;
Did you try to increase &lt;CODE&gt;server.socket_timeout&lt;/CODE&gt; parameter value as mentioned in the answer?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 09:20:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Any-clues-as-to-how-to-fix-the-header-setting-problem-or-how-to/m-p/434238#M2919</guid>
      <dc:creator>jawaharas</dc:creator>
      <dc:date>2019-09-06T09:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: CSRF problem with a reverse proxy</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Any-clues-as-to-how-to-fix-the-header-setting-problem-or-how-to/m-p/434239#M2920</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Yes, it does not work.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 09:30:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Any-clues-as-to-how-to-fix-the-header-setting-problem-or-how-to/m-p/434239#M2920</guid>
      <dc:creator>davietch</dc:creator>
      <dc:date>2019-09-06T09:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: CSRF problem with a reverse proxy</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Any-clues-as-to-how-to-fix-the-header-setting-problem-or-how-to/m-p/434240#M2921</link>
      <description>&lt;P&gt;I have the answer to my own question. It turned out that a reverse proxy before the searchhead was changing the flags on the cookies, specifically in this case it was setting the HTTPOnly flag. Once that security feature on the reverse proxy was disable it all worked fine.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Sep 2019 14:49:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Any-clues-as-to-how-to-fix-the-header-setting-problem-or-how-to/m-p/434240#M2921</guid>
      <dc:creator>plaxosi</dc:creator>
      <dc:date>2019-09-08T14:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: CSRF problem with a reverse proxy</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Any-clues-as-to-how-to-fix-the-header-setting-problem-or-how-to/m-p/434241#M2922</link>
      <description>&lt;P&gt;Thank you, it worked. I commented this line and the issue got away:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;# Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Although it worked, it'd be great to let this security feature enabled and make it work with Splunk....&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 09:13:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Any-clues-as-to-how-to-fix-the-header-setting-problem-or-how-to/m-p/434241#M2922</guid>
      <dc:creator>davietch</dc:creator>
      <dc:date>2019-09-09T09:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: CSRF problem with a reverse proxy</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Any-clues-as-to-how-to-fix-the-header-setting-problem-or-how-to/m-p/434242#M2923</link>
      <description>&lt;P&gt;Hey, can you please guide, where is this code?&lt;BR /&gt;
Where have you commented?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 08:42:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Any-clues-as-to-how-to-fix-the-header-setting-problem-or-how-to/m-p/434242#M2923</guid>
      <dc:creator>sarvesh_11</dc:creator>
      <dc:date>2020-02-21T08:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: CSRF problem with a reverse proxy</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Any-clues-as-to-how-to-fix-the-header-setting-problem-or-how-to/m-p/622409#M14643</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;PRE&gt;[expose:all]
methods = GET,POST
pattern = **
skipCSRFProtection = 1&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I'm trying to disable CSRF protection for other reasons and can confirm that this approach doesn't work for me.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 13:28:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Any-clues-as-to-how-to-fix-the-header-setting-problem-or-how-to/m-p/622409#M14643</guid>
      <dc:creator>spunk_enthusias</dc:creator>
      <dc:date>2022-11-29T13:28:31Z</dc:date>
    </item>
  </channel>
</rss>

