Introduction
You may want to enable the Content-Security-Policy and Permissions-Policy headers to increase site security. This article provides the procedure to add these headers to the Apache configuration.
Please note, the following instructions assume you already enabled HSTS on the server.
Procedure
- Log into WHM as the 'root' user.
- Navigate to "WHM / Service Configuration / Apache Configuration."
- Click "Include Editor."
- Select "All Versions" from the drop-down menu under "Pre-Main Include."
- Add the following entries to the
IfModule
section.Header always set Content-Security-Policy "default-src 'self'; font-src *;img-src * data:; script-src *; style-src *;"
Header always set Permissions-Policy "geolocation=(),midi=(),sync-xhr=(),microphone=(),camera=(),magnetometer=(),gyroscope=(),fullscreen=(self),payment=()" - Click the "Update" button.
- Click the "Restart Apache" button.
Comments
0 comments
Article is closed for comments.