Created
September 26, 2018 06:09
-
-
Save mhou1981/11ac5e6ec4f763f98babf1ce72b1df42 to your computer and use it in GitHub Desktop.
Apache2 Enable Extra Header Security
This file contains hidden or 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
a2enmod headers | |
systemctl restart apache2.service | |
vim /etc/apache2/conf-enabled/security.conf | |
### add the following: | |
Header set X-Content-Type-Options: "nosniff" | |
Header set X-Frame-Options: "sameorigin" | |
Header unset X-Powered-By | |
Header set X-XSS-Protection 1;mode=block | |
Header set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" | |
Header set Content-Security-Policy "script-src 'self'; object-src 'self'" | |
Header always set Referrer-Policy "same-origin" | |
Header always set Feature-Policy "microphone 'none'; payment 'none'; sync-xhr 'self' https://domain-name.com" | |
# Save and exit | |
apachectl -t | |
systemctl restart apache2.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment