Problem/Motivation
There is currently no Drupal FIT check to verify that HTTPS is consistently enforced (for example, HTTP traffic being redirected to HTTPS and transport security headers being present), which can leave user credentials and other sensitive data exposed over unencrypted connections.
Steps to reproduce
Proposed resolution
Add a new Security FitCheck plugin HttpsEnforcementCheck that:
- Checks whether the site is accessible over plain HTTP without redirection to HTTPS, and whether key HTTPS-related headers like
Strict-Transport-Securityare present. - Fails with
FitWeight::High(orFitWeight::Criticalfor sites handling sensitive data) when HTTP access is not redirected or HSTS is missing, and passes withFitWeight::Okwhen HTTPS and HSTS are correctly enforced. - Includes a short help message explaining that all traffic should be served over HTTPS and recommending enabling global HTTPS redirects and HSTS at the application or web server level.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork drupalfit-3558975
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
harivansh commentedComment #5
shubham.prakash commentedComment #7
harivansh commentedComment #9
harivansh commented