Hi!
I tried to load cacti in icinga tab. Other sites loaded as expected, but cacti takes over the whole browser window.
Can sy help me?
thx
(I use http basic auth both for icinga and cacti)
cacti version 0.8.8a
Cacti breaks out from iframe
Moderators: Developers, Moderators
Re: Cacti breaks out from iframe
I had the same problem with Wordpress Advanced iFrame plugin. It's apparently a security feature of Cacti 0.8.8f (where I think 0.8.8b worked). I wondered how something like this would be possible so I went looking and found this site:
http://stackoverflow.com/questions/2896 ... -of-iframe
The key phrase in the article was "Compare top and self, if they're not identical, you are in a frame." So I grep'd for that and found it in this file:
/cacti/include/csrf/csrf-magic.php
...the code:
I made a backup of the file, then commented out the check by adding a # in front of the lines:
It worked. Cacti now appears in an iFrame. The iFrame is too small but that's a different problem to solve.
Btw, this obviously breaks a probably security feature of Cacti. Make sure you have other protections in effect (like Apache web authentication) before messing with this.
http://stackoverflow.com/questions/2896 ... -of-iframe
The key phrase in the article was "Compare top and self, if they're not identical, you are in a frame." So I grep'd for that and found it in this file:
/cacti/include/csrf/csrf-magic.php
...the code:
Code: Select all
if ($GLOBALS['csrf']['frame-breaker']) {
$buffer = str_ireplace('</head>', '<script type="text/javascript">if (top != self) {top.location.href = self.location.href;}</script></head>', $buffer);
}
Code: Select all
# if ($GLOBALS['csrf']['frame-breaker']) {
# $buffer = str_ireplace('</head>', '<script type="text/javascript">if (top != self) {top.location.href = self.location.href;}</script></head>', $buffer);
# }
Btw, this obviously breaks a probably security feature of Cacti. Make sure you have other protections in effect (like Apache web authentication) before messing with this.
Re: Cacti breaks out from iframe
I m config /usr/share/cacti/site/include/csrf/csrf-magic.php
change $GLOBALS['csrf']['frame-breaker'] = true; to flase
It worked
change $GLOBALS['csrf']['frame-breaker'] = true; to flase
It worked
Re: Cacti breaks out from iframe
Hi, I know this tred is kinda old but i try to use iframe and in cacti /var/www/cacti/include/vendor/csrf/csrf-conf.php i set the $GLOBALS['csrf']['frame-breaker'] = true; to false and still doesn´t work on iframe, i'm missing some step?
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Re: Cacti breaks out from iframe
Are you trying to display a Cacti page inside of another Web App?
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Re: Cacti breaks out from iframe
It's not in another app its an html file that i create to get cacti graph page with other monitoring stuff.
I found that the problem was CSP. When i added the Header then it worked fine.
I found that the problem was CSP. When i added the Header then it worked fine.
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Re: Cacti breaks out from iframe
Yea, we locked that down out of the box due to a bunch of security people providing negative feedback unless it was added. It's open source, so you can always unwind it.
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Who is online
Users browsing this forum: No registered users and 4 guests