Dashboards & Visualizations
Highlighted

iframes and views broken after Splunk 6 upgrade

Path Finder

One of our main features broke after upgrading to version 6:

Problem

We have some custom views that allow users to get information without login. In order to do that we use insecure login and iframes.

http://docs.splunk.com/Documentation/Splunk/6.0/AdvancedDev/3rdParty#x1._Enable_insecure_login

I tested the insecure login and the view is working fine. However, when is coming in the iframe we do not have any display. Please note that this was working just before we did the upgrade.

This is my HTML code


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">



Splunk Stuff


<!-- content starts here -->

Test for insecure login


This is my view code


sourcetype="tpharmaadmin" | timechart span="5m" avg(zCPUIDLE) by source
-24h

line
time
right
FAST Admin Idle_CPU
<!-- Set Y axis to 100 -->
100
<!-- Time Range Button -->

Last 24 hours
True

<!-- Define JSChart insteadn of FlashChart -->



<module name="HiddenSearch" autoRun="True" layoutPanel="panel_row2_col1">
            <param name="search">sourcetype="tpharma_admin" | timechart span="5m" avg(free_memory) by source</param>
            <param name="earliest">-24h</param>
            <module name="HiddenChartFormatter">
            <param name="chart">column</param>
                            <param name="primaryAxisTitle.text">time</param>
    <param name="legend.placement">right</param>
    <param name="chartTitle">FAST Admin free_mem</param>
    <!--  Time Range Button  -->
    <module name="TimeRangePicker">
                            <param name="selected">Last 24 hours</param>
                            <param name="searchWhenChanged">True</param>
    <module name="JobProgressIndicator"/>
    <!--  Define JSChart  -->
    <module name="JSChart"/>
</module>
 </module>
      </module>
</view>

Thanks,
Dan

Tags (2)
Highlighted

Re: iframes and views broken after Splunk 6 upgrade

Splunk Employee
Splunk Employee
0 Karma
Highlighted

Re: iframes and views broken after Splunk 6 upgrade

Splunk Employee
Splunk Employee

In 5.0.5 and 6.0, as part of a security-related fix (reference SPL-65987) we disabled the ability to insecurely embed content on a remote site by default.

To restore this capability, you now need to make an explicit change in web.conf to the x_frame_options_sameorigin parameter and set it to False:

x_frame_options_sameorigin = [True | False]
    * adds a X-Frame-Options header set to "SAMEORIGIN" to every response served by cherrypy
    * Defaults to True

View solution in original post

Highlighted

Re: iframes and views broken after Splunk 6 upgrade

Path Finder

Thank you for your answer problem solved.

0 Karma
Highlighted

Re: iframes and views broken after Splunk 6 upgrade

Champion

When using search-head pooling, which web.conf file would get updated for this issue?

0 Karma
Highlighted

Re: iframes and views broken after Splunk 6 upgrade

Communicator

hexx,

I was trying to embed iframe for "https://localhost:8089/services/" in my xml located in "http://localhost:8000".
But it throws an error as "Refused to display in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'"

So I have modified the above stanza in my web.conf as you stated above. However no luck.

Then I added the following stanza in my system/local server.conf. Then it works like a charm.

[httpServer]
xframeoptions_sameorigin = False

Is there any notable difference between these two stanzas in web.conf and server.conf? Why the error occured even-though i changed my web.conf?

Splunk Version : 6.3.0

Highlighted

Re: iframes and views broken after Splunk 6 upgrade

Path Finder

Hello all,

As a follow up.. Would there be a config available to keep the security, though allow ONLY a specific address?

IE: Keep the setting "xframeoptions_sameorigin = [True ]" with an exception set to allow x.x.x.x\16 OR x.x.x.x OR URL string

Thanks!!

0 Karma
Highlighted

Re: iframes and views broken after Splunk 6 upgrade

Path Finder

@ rbardonetorian if you have any solution then kindly share the same since we also want to keep the xframeoptions as "True" and we want to allow only a particular URL so if you have any ideas then kindly share.

0 Karma
Highlighted

Re: iframes and views broken after Splunk 6 upgrade

Path Finder

Can anyone help on this

0 Karma
Highlighted

Re: iframes and views broken after Splunk 6 upgrade

Splunk Employee
Splunk Employee

a change was made in 5.0.5 and later versions to improve security and prevent clickjacking issues, this is what you're running into.

to implement this change, we set X-FRAME-OPTIONS=SAMEORIGIN in the header for all cherrypy served pages. this means that you can only iframe in pages coming from the same site.

we added a new web.conf setting: xframeoptions_sameorigin = [True | False] which defaults to True.

if you set this to False, your iframing will work again.