drodyc
Apr 13, 2021Nimbostratus
iFrame iRule
Trying to figure out how to combine these two together.
The first section is in the current iRule on my VIP (Syntax might be a little off since its from memory). It just redirects users who isn't all the list to a https website.
I have a distant end user requesting to have iFrame Headers activated for their application. How would I activate iFrame headers with just these users? I was thinking of making a datagroup with their network range.
The second section is the closet thing I can find to activate iFrames with an iFrame datagroup. How do I frankenstein these together? I'm not even sure if this will give me the results I need. I'm not well verse in iRules or even programming in general. Thank you for your time!
when http_request {
# Check if client IP is not allowed. Then redirects
if {not [matchlass [IP:: client-addr] equals xxx]}{
log local 0. "Denied IP [IP:: client-addr] Fowarding to HTTPS"
HTTP:: redirect https:////[getfield [HTTP::host}":"1}{http::ip} }
else } log local 0. "Allowed IP [ IP::client_addr]" }
}
when HTTP_REQUEST { set host [string tolower [HTTP::host]] }
when HTTP_RESPONSE { if {[class match $host contains iFramedatagroup]}
{ HTTP::header replace X-Frame-Options "SAMEORIGIN" ; }
else { HTTP::header replace X-Frame-Options "SAMEORIGIN" ; }}