Configure HTTP security response headers for Azure Static Web Apps

Introduction

HTTP security headers is the most crucial part of the web applications that helps to protect against some variety of attacks most likely cross-site scripting, clickjacking and other script attacks, configure HTTP security header…


This content originally appeared on DEV Community and was authored by Rebin

Introduction

HTTP security headers is the most crucial part of the web applications that helps to protect against some variety of attacks most likely cross-site scripting, clickjacking and other script attacks, configure HTTP security headers is frequently forgotten by Developers! So, I recently checked my blog on securityheaders.com and results indicated that HTTP security headers are not configured so I decided to put some HTTP security headers for my Azure Static Web Apps.

Recommended HTTP security headers

  1. Strict-Transport-Security

  2. Content-Security-Policy

  3. X-Frame-Options

  4. X-Permitted-Cross-Domain-Policies

  5. X-Content-Type-Options

  6. Permissions-Policy

Configure HTTP security headers

You can create a json file called ( staticwebapp.config.json ) in the root of the web site and put the configuration like below then deploy it to your Azure Static Web App host.

{
      "globalHeaders": {
        "content-security-policy": "frame-ancestors 'self'; 
         upgrade-insecure-requests",
        "X-Frame-Options": "SAMEORIGIN",
        "X-Permitted-Cross-Domain-Policies": "none",
        "Referrer-Policy":"no-referrer",
        "X-Content-Type-Options": "nosniff",
        "Permissions-Policy": "autoplay=()"
    }
  }


This content originally appeared on DEV Community and was authored by Rebin


Print Share Comment Cite Upload Translate Updates
APA

Rebin | Sciencx (2021-09-06T19:48:08+00:00) Configure HTTP security response headers for Azure Static Web Apps. Retrieved from https://www.scien.cx/2021/09/06/configure-http-security-response-headers-for-azure-static-web-apps/

MLA
" » Configure HTTP security response headers for Azure Static Web Apps." Rebin | Sciencx - Monday September 6, 2021, https://www.scien.cx/2021/09/06/configure-http-security-response-headers-for-azure-static-web-apps/
HARVARD
Rebin | Sciencx Monday September 6, 2021 » Configure HTTP security response headers for Azure Static Web Apps., viewed ,<https://www.scien.cx/2021/09/06/configure-http-security-response-headers-for-azure-static-web-apps/>
VANCOUVER
Rebin | Sciencx - » Configure HTTP security response headers for Azure Static Web Apps. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/09/06/configure-http-security-response-headers-for-azure-static-web-apps/
CHICAGO
" » Configure HTTP security response headers for Azure Static Web Apps." Rebin | Sciencx - Accessed . https://www.scien.cx/2021/09/06/configure-http-security-response-headers-for-azure-static-web-apps/
IEEE
" » Configure HTTP security response headers for Azure Static Web Apps." Rebin | Sciencx [Online]. Available: https://www.scien.cx/2021/09/06/configure-http-security-response-headers-for-azure-static-web-apps/. [Accessed: ]
rf:citation
» Configure HTTP security response headers for Azure Static Web Apps | Rebin | Sciencx | https://www.scien.cx/2021/09/06/configure-http-security-response-headers-for-azure-static-web-apps/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.