Skip to content

Instantly share code, notes, and snippets.

@Madic-
Created January 20, 2018 20:03
Show Gist options
  • Save Madic-/1e2572daa62e762544d9a07713146307 to your computer and use it in GitHub Desktop.
Save Madic-/1e2572daa62e762544d9a07713146307 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Requires the following log format in nginx:
# log_format tls_log '$ssl_protocol $ssl_cipher $http_host $request';
LOG=/var/log/nginx/tls.log
echo -e "TLS Protocol Usage"
awk '{print $1}' "$LOG" | sort | uniq -c | sort -rn
echo -e "\nHTTP Protocol Usage"
awk '{print $6}' "$LOG" | sort | uniq -c | sort -rn
echo -e "\nCipher Suite Usage"
awk '{print $2}' "$LOG" | sort | uniq -c | sort -rn
echo -e "\nHTTP Hosts"
awk '{print $3}' "$LOG" | sort | uniq -c | sort -rn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment