azure_web_app_security_hardening
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| azure_web_app_security_hardening [2017/11/18 02:30] – created stephen | azure_web_app_security_hardening [2017/11/19 05:39] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Azure Web App Security Hardening ====== | ====== Azure Web App Security Hardening ====== | ||
| + | |||
| + | A bunch of checks can be done [[https:// | ||
| ===== HTTPS Only ===== | ===== HTTPS Only ===== | ||
| Line 10: | Line 12: | ||
| filters.Add(new RequireHttpsAttribute()); | filters.Add(new RequireHttpsAttribute()); | ||
| </ | </ | ||
| + | |||
| + | ===== Remove Unnecessary Headers ===== | ||
| + | |||
| + | '' | ||
| + | |||
| + | <code c#> | ||
| + | protected void Application_Start() { | ||
| + | ... | ||
| + | // Add this: | ||
| + | MvcHandler.DisableMvcResponseHeader = true; | ||
| + | } | ||
| + | |||
| + | // Add this method: | ||
| + | protected void Application_PreSendRequestHeaders(object sender, EventArgs e) { | ||
| + | // Trying to remove this in the web.config doesn' | ||
| + | Response.Headers.Remove(" | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | '' | ||
| + | |||
| + | <code xml> | ||
| + | < | ||
| + | ... | ||
| + | <!-- Add enableVersionHeader=" | ||
| + | < | ||
| + | ... | ||
| + | </ | ||
| + | |||
| + | <code xml> | ||
| + | < | ||
| + | ... | ||
| + | <!-- Add this section. --> | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | ===== HTTPS Only Cookies ===== | ||
| + | |||
| + | '' | ||
| + | |||
| + | <code xml> | ||
| + | < | ||
| + | ... | ||
| + | <!-- Add this: --> | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | ===== Add Security Headers ===== | ||
| + | |||
| + | '' | ||
| + | |||
| + | <code xml> | ||
| + | < | ||
| + | < | ||
| + | | ||
| + | ... | ||
| + | <!-- Add these: --> | ||
| + | <add name=" | ||
| + | <add name=" | ||
| + | <add name=" | ||
| + | <add name=" | ||
| + | <add name=" | ||
| + | <!-- Max-age is in seconds, 31536000 = one year --> | ||
| + | <add name=" | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | </ | ||
| + | |||
azure_web_app_security_hardening.1510972234.txt.gz · Last modified: 2017/11/19 03:30 (external edit)
