Categorize SSL traffic by version, display as graph
Problem this snippet solves: You want to know how much SSLv3 traffic is hitting your site. Example image when going to https://x.x.x.x/sslversions: How to use this snippet: Attach this iRule to your virtual server that is terminating SSL. It will collect statistics about which versions of SSL are being negotiated with clients. Use the 'istats dump' command to see the statistics. Or, connect to your virtual server and query for "/sslversions" to see a javascript graph. Code : when CLIENTSSL_HANDSHAKE { ISTATS::incr "ltm.virtual [virtual name] c [SSL::cipher version]" 1 } when HTTP_REQUEST { if { [string tolower [HTTP::uri]] equals "/sslversions" } { set v3 [ISTATS::get "ltm.virtual [virtual name] c SSLv3"] set t10 [ISTATS::get "ltm.virtual [virtual name] c TLSv1"] set t11 [ISTATS::get "ltm.virtual [virtual name] c TLSv1.1"] set t12 [ISTATS::get "ltm.virtual [virtual name] c TLSv1.2"] set hbody "\n \ \n \ \n \ \n \ \n \ \n \ // Load the Visualization API and the piechart package.\n \ google.load('visualization', '1.0', {'packages':\['corechart'\]});\n \ \n \ // Set a callback to run when the Google Visualization API is loaded.\n \ google.setOnLoadCallback(drawChart);\n \ \n \ // Callback that creates and populates a data table,\n \ // instantiates the pie chart, passes in the data and\n \ // draws it.\n \ function drawChart() {\n \ \n \ // Create the data table.\n \ var data = new google.visualization.DataTable();\n \ data.addColumn('string', 'SSL Types');\n \ data.addColumn('number', 'Versions');\n \ data.addRows(\[\n \ \['SSLv3', $v3],\n \ \['TLSv1', $t10],\n \ \['TLSv1.1', $t11],\n \ \['TLSv1.2', $t12]\n \ \]);\n \ \n \ // Set chart options\n \ var options = {'title':'SSL/TLS Versions on [virtual name]',\n \ 'width':800,\n \ 'height':600};\n \ \n \ // Instantiate and draw our chart, passing in some options.\n \ var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n \ chart.draw(data, options);\n \ }\n \ \n \ \n \ \n \ \n \ \n \ \n \ \n \ \n \ " HTTP::respond 200 content $hbody } }781Views2likes3Comments