Azure app services - HTTP Strict Transport Security (HSTS) not enforced

Apol Villamor 0 Reputation points
2024-09-02T06:22:16.31+00:00

We are deploying our app services in Linux container in Azure as WebApp. Our vulnerability scanning tools detects “HTTP Strict Transport Security (HSTS) not enforced” which does not comply with our security policies. How to fix this issue? below are the screenshots of the issue:

https://domsignal.com/test/1tzndap306mrw2x8d3ofg3gt1f51hgs6

This website is using a custom domain pointed to the azure app service default domain. ****website.azurewebsites.net

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,663 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. akinbade abiola 15,225 Reputation points
    2024-09-02T09:18:06.89+00:00

    On the Azure end Under “TLS/SSL settings,” turn on “HTTPS Only.” This forces all HTTP traffic to be redirected to HTTPS. If this is set correctly then you need to review/add HSTS settings in your app code.

    Also see: https://video2.skills-academy.com/en-us/aspnet/core/security/enforcing-ssl?view=aspnetcore-8.0&source=recommendations&tabs=visual-studio%2Clinux-ubuntu

    You can mark it 'Accept Answer' and 'Upvote' if this helped you

    Regards,

    Abiola

    0 comments No comments

  2. Apol Villamor 0 Reputation points
    2024-09-03T02:24:58.72+00:00

    Azure HTTPS only is already turned ON. See attached. Can you guide us how to add HSTS settings in our app code. Guide us, we are using ReactJS (Express) and some are Wordpress in Azure and .Net 8 C#. HTTPS Only

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.