My server was recently scanned by our security office and they have come up with the following errors. Any advice on how I can take care of the absence of HTTP headers?
X-Content-Type-Options HTTP Header missing on port 8080
X-Content-Type-Options HTTP Header missing on port 8080
This is how my virtual host setting looks like:
<VirtualHost *:80>
# Guarantee HTTPS for 1 Year including Sub Domains
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
ServerName test.gov
ServerAdmin awong@somewhere.com
Redirect permanent / https://test.gov/
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [redirect=301]
</VirtualHost>
<VirtualHost *:443>
# Guarantee HTTPS for 1 Year including Sub Domains
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
ServerName test.gov
ServerAlias test.gov
ServerAdmin awong@somewhere.com
ErrorLog ${APACHE_LOG_DIR}/test-error.log
CustomLog ${APACHE_LOG_DIR}/test-access.log combined
LogLevel warn
SSLEngine on
SSLCertificateFile /etc/ssl/certs/wildcard_gov.crt
SSLCertificateKeyFile /etc/ssl/private/wildcard_gov.key
SSLCertificateChainFile /etc/ssl/certs/DigiCert_SHA2_Secure_Server_CA.crt
SSLProtocol -all +TLSv1.2 +TLSv1.3
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
<IfModule mod_rewrite.c>
RewriteEngine On
# serving icons from apache 2 server
RewriteRule ^/icons/ - [L]
RewriteRule ^/(.*)$ balancer://zopeInstances/VirtualHostBase/https/%{SERVER_NAME}:443/test/VirtualHostRoot/$1 [L,P]
<Proxy balancer://zopeInstances>
BalancerMember http://127.0.0.1:8080
BalancerMember http://127.0.0.1:8081
</Proxy>
</IfModule>
<IfModule mod_proxy.c>
ProxyVia On
# prevent the webserver from being used as proxy
<LocationMatch "^[^/]">
Deny from all
</LocationMatch>
</IfModule>
</VirtualHost>
I have also have the following in my apache.conf file:
Header always set Content-Security-Policy "default-src https: data: 'unsafe-inline' 'unsafe-eval'"
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
# HTTP Public Key Pinning
Header always set Public-Key-Pins "pin-sha256='X3pGTSOuJeEVw989IJ/cEtXUEIsInsdj3xK8QrZbHec='; pin-sha256='MHJYVThihUrJcxW6wcqyOMHJYVThihUrJcxW6w='; pin-sha256='isi41AizREkLvvft0IRW4u3XMFR52zs1TZQrU06KUKg='; includeSubdomains; max-age=2592000"
# X-Xss-Protection
Header always set X-XSS-Protection "1; mode=block"
# X-Content-Type-Options
Header always set X-Content-Type-Options "nosniff"
php_flag display_errors off
Any help or advice would be most appreciated.
Thanks so much,
Angela