Created
January 30, 2015 13:51
-
-
Save olesku/da85f54bb9771f9e3396 to your computer and use it in GitHub Desktop.
Count missing X-Forwarded-Proto irule on SSL VIPS.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
my $inblock = 0, $curhost = "", $curname = ""; | |
open(BIGIP, "bigip.conf") or die("Could not open config file.\n"); | |
while (<BIGIP>) { | |
$curname = $1 if (m/ltm\s+virtual\s+(.+)\s+{$/); | |
$inblock = 1, $curhost = $1 if (m/destination\s+(.+\:443)$/); | |
if (m/^}$/ && $inblock) { | |
printf("%s: %s\n", $curname, $curhost) if (!$ssl_hdr_found); | |
$ssl_hdr_found = $inblock = 0; | |
$curhost = $curname = ""; | |
} | |
$ssl_hdr_found = 1 if ($inblock && m/add_https_header|add_X-Forwarded-Proto/); | |
} | |
close(BIGIP); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment