Created
November 13, 2018 07:44
-
-
Save arall/b2e353e22a7865fa65fd4b0bf95e6b60 to your computer and use it in GitHub Desktop.
Checks Missing Security Headers
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
#!/bin/bash | |
headers=$(curl -s -I -L "https://"$1) | |
echo "$headers" | |
declare -a checks=( | |
'Strict-Transport-Security' | |
'X-Frame-Options' | |
'X-XSS-Protection' | |
'X-Content-Type-Options' | |
'Access-Control-Allow-Origin' | |
'Referrer-Policy' | |
'HTTPOnly' | |
'secure' | |
'SameSite' | |
) | |
for i in "${checks[@]}" | |
do | |
if ! echo $headers | grep -iqF $i; then | |
echo $i | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment