One of our main features broke after upgrading to version 6:
We have some custom views that allow users to get information without login. In order to do that we use insecure login and iframes.
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"
This is my view code
<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>
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
x_frame_options_sameorigin = [True | False] * adds a X-Frame-Options header set to "SAMEORIGIN" to every response served by cherrypy * Defaults to True
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.
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
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
@ 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.
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.