VA || HSTS Missing From HTTPS Server (RFC 6797)

VA || HSTS Missing From HTTPS Server (RFC 6797)

If Client Has raised a VA for HSTS on any of the website of PAM we can follow below solution to mitigate the VA:


Method 1: Using IIS Manager GUI


Open IIS Manager:

Select Your Website:
In IIS Manager, expand the server node and select your website.
HTTP Response Headers:
Double-click on the HTTP Response Headers icon in the website Home pane.
Add a Custom Header:
In the Actions pane (on the right), click on Add....
Enter Strict-Transport-Security as the name.
Enter max-age=31536000 (or your preferred value in seconds) as the value. This specifies how long HSTS is enforced (e.g., one year).
Apply Changes:
Click OK to save the header.
Restart the Website:
Restart your website to apply the changes.


Method 2: Using Web.config file 


Search for system.webServer and add below configuration under customHeaders

<configuration>
  <system.webServer>
    <httpProtocol>
      <customHeaders>
        <add name="Strict-Transport-Security" value="max-age=31536000" />
      </customHeaders>
    </httpProtocol>
  </system.webServer>
</configuration>