Search
Joe Pruitt - A Software Architect's take on Network Security
You are here: DevCentral > Weblogs

posted on Tuesday, February 24, 2009 12:01 PM

ie-6-logo-copy Today, I decided to take a break away from Twitter and catch up on some of the 1000's of blog posts I'm behind on reading.  So, I launched up Google Reader and came across Scott Hanselman's post on "IE6 Warning - Stop Living In The Past - Get off of IE6".  In his post, he talks about a movement to get folks off the ancient IE6 and onto a more recent, more secure browser.

In Scott's post, he showed off some of the stats for his blog revealing that close to 20% of the viewers of his site were using IE6.  Of course, I decided to see how his numbers matched up against IE users on DevCentral.  I pulled up a relevant sample of stats and found that a whopping 41% of DevCentral users are running IE6.

DCIEUsage

 

In retrospect, this sort of makes sense as DevCentral has a large population of corporate users who have less control on the software that runs on their laptops/PCs/etc.  So, for those, upgrading may not be possible.  But, I'm sure that a good portion of those IE6 users out there, just haven't taken the steps to upgrade to a more secure browsing platform.

Scott proposed including the following HTML to conditionally print a div blog notifying users that they should upgrade if they are running IE6 or below:

<!--[if lte IE 6]>  
<style type="text/css"> 
#ie6msg{border:3px solid #c33; margin:8px 0; background:#fcc; color:#000;} 
#ie6msg h4{margin:8px; padding:0;} 
#ie6msg p{margin:8px; padding:0;} 
#ie6msg p a.getie7{font-weight:bold; color:#006;} 
#ie6msg p a.ie6expl{font-weight:bold; color:#006;} 
</style> 
<div id="ie6msg"> 
<h4>Did you know that your browser is out of date?</h4> 
<p>To get the best possible experience using my website I recommend that you upgrade your browser
to a newer version. The current version is
<a class="getie7" href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer 7</a> or
<a class="getie7" href="http://www.microsoft.com/windows/Internet-explorer/beta/default.aspx">Internet Explorer 8 (Beta)</a>.
The upgrade is free. If you’re using a PC at work you should contact your IT-administrator.
Either way, I'd personally like to encourage you to stop using IE6 and try a more secure and Web Standards-friendly browser.</p> 
<p>You could also try some other popular browsers like
<a class="ie6expl" href="http://mozilla.com">FireFox</a> or <a class="ie6expl" href="http://www.opera.com">Opera</a>.</p> 
</div> 
<![endif]-->

The bummer here is that this would require modifying every page in your application to supply this information.  Why not do it transparently at the network layer?  Well, that's just what I said!  So, I whipped up this iRule that you can deploy on your BIG-IP that will automagically add the warning information at the network layer.

The majority of the work here is done in the HTTP_RESPONSE_DATA event.  In there, it looks for a <body> tag and appends it with the warning information.  If no <body> tag is found, it will put the content at the top of the page.

when RULE_INIT {
  # replace the value of the _uacct variable with your Google Analytics account.
  set warnie6 "<!--\[if lte IE 6\]>
<style type='text/css'>
#ie6msg {border:3px solid #c33; margin:8px 0; background:#fcc; color:#000;}
#ie6msg h4 {margin:8px; padding:0;}
#ie6msg p {margin:8px; padding:0;}
#ie6msg p a.getie7 {font-weight:bold; color:#006;}
#ie6msg p a.ie6expl {font-weight:bold; color:#006;}
</style>
<div id='ie6msg'>
<h4>Did you know that your browser is out of date?</h4>
<p>To get the best possible experience using my website I recommend that you upgrade your browser to a newer version.
The current version is
<a class='getie7' href='http://www.microsoft.com/windows/downloads/ie/getitnow.mspx'>Internet Explorer 7</a> or
<a class='getie7' href='http://www.microsoft.com/windows/Internet-explorer/beta/default.aspx'>Internet Explorer 8 (Beta)</a>.
The upgrade is free. If you are using a PC at work you should contact your IT-administrator.
Either way, I'd  personally like to encourage you to stop using IE6
and try a more secure and Web Standards-friendly browser.</p>
<p>You could also try some other popular browsers like
<a class='ie6expl' href='http://mozilla.com'>FireFox</a> or <a class='ie6expl' href='http://www.opera.com'>Opera</a>.</p>
</div>
<!\[endif\]-->"
}
when HTTP_REQUEST {
  # Don't allow data to be chunked
  if { [HTTP::version] eq "1.1" } {
    if { [HTTP::header is_keepalive] } {
       HTTP::header replace "Connection" "Keep-Alive"
    }
    HTTP::version "1.0"
  }
}
when HTTP_RESPONSE {
  if { [HTTP::header Content-Type] starts_with "text/html" } {
    if { [HTTP::header exists "Content-Length"] } {
      #log local0. "content length: [HTTP::header {Content-Length}]"
      set content_length [HTTP::header "Content-Length"]
    } else {
      set content_length 1000000
    }
    #log local0. "Collecting $content_length bytes"
    if { $content_length > 0 } {
       HTTP::collect $content_length
    }
  }
}
when HTTP_RESPONSE_DATA {
  #log local0. "Content Type: [HTTP::header Content-Type]"
  set idx [string first "<body>" [HTTP::payload]]
  if { -1 == $idx } {
    set idx [string first "<BODY>" [HTTP::payload]]
  }
  #log local0. "html body tag found at $idx"
  if { -1 == $idx } {
    set idx 0
  } else {
    incr idx 6
  }
  HTTP::payload replace $idx 0 $::warnie6
}

This could easily be enhanced to remove the conditional check and only add the content depending on specific User-Agent strings thus reducing the network bandwidth overhead.

iRules really can do everything can't they B-).



Feedback

5/5/2009 3:42 AM
Gravatar The example should collect ~1Mb, not 1gb :)

The CC scrubber iRule has been updated as well:
http://devcentral.f5.com/wiki/default.aspx/iRules/CreditCardScrubber.html

Aaron
Aaron
5/5/2009 6:43 AM
Gravatar Good point Aaron. Post updated!

-Joe
Joe Pruitt
4/30/2010 1:57 AM
Gravatar As said in a post below, a very under-appreciated song but when a band such as QOTSA produces a quality song after quality song it's hard for them all to get appreciated. One of my favourites probably......
giocare al backgammon virtuale
11/18/2010 8:03 AM
Gravatar This idea of forcing users to upgrade is flawed and self-defeating. I work for a large corporation that is still using IE6. Let's be clear about this - there is nothing I or anyone else in the company can do to speed up an upgrade to IE7 or 8, as much as we want it. Telling me to 'speak to my IT administrator' is like sending me a chocolate teapot to calm me down.

I use Firefox and Chrome at home, so you can probably appreciate my frustration with having to use IE6 every day, and not being able to do anything about it. I imagine there's a whole legion of users in a similar position. Maybe 41% of DevCentral users, for example. Imagine how our frustration is then increased when faced with the message above.

I can appreciate that there is an additional cost to making a site compliant with IE6 as well as IE7/8, FF, Chrome etc etc. However, I'm getting fed up of being prevented from using a website because some precious web developer has decided that my browser isn't worthy of seeing their magnificent creation. Fair enough, warn me that the site might not work properly or look awful, but don't stop me actually using the site.

If you won't let me use your/your customer/employer's site, I'll go to the competitor. Simple as...
JJ

Let Me Know What You Think


Please use the form below if you have any comments, questions, or suggestions.

Title:
 
Name:
 
Email: (so we can show your gravatar)
Website:
Comment: Allowed tags: blockquote, a, strong, em, p, u, strike, super, sub, code
 
Please add 4 and 4 and type the answer here:

Blog Stats

Posts:379
Comments:1067
Stories:1
Trackbacks:301
  

Article Categories

  iRules
  

Image Galleries

  

Joe's bookshelf: read

The Lost Gate
4 of 5 stars
This one started slow but I got really got into it about 1/3 of the way through. If you are an Ender's Game fan, you'll probably like this one as well.

goodreads.com


82,243 Members in 102 Countries and Growing!

Join DevCentral Today!

About DevCentral

DevCentral has been a successful, thriving community for many years. We have always strived to bring you the best technical documentation, discussion forums, blogs, media and much more that we can.

So dive in, get familiar with DevCentral. We hope you like it, we hope it makes your job easier, and lets you get that much more power out of the community. To learn more, make sure to check out the Getting Started section. And if you have any problems, or think something could be easier to use, drop us a line to let us know.

Got It !

We've received your comment and transmitted it directly to DevCentral HQ.

Thanks for taking time to let us know what's on your mind. At DevCentral | Community Matters!

Get In Touch With Us

Have questions, suggestions or just want to get something off your chest?

Use our handy form below to Direct Connect with DevCentral Mission Control.

Send Us Feedback       or