Skip to content

Instantly share code, notes, and snippets.

@olesku
Created January 30, 2015 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olesku/da85f54bb9771f9e3396 to your computer and use it in GitHub Desktop.
Save olesku/da85f54bb9771f9e3396 to your computer and use it in GitHub Desktop.
Count missing X-Forwarded-Proto irule on SSL VIPS.
#!/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