Skip to content

Commit cf6902b

Browse files
committed
Header 'RESPONSE_Server' overridden and 'enableVersionHeader' set to 'false' following the OWASP security best practice
1 parent 12734ed commit cf6902b

File tree

5 files changed

+28
-4
lines changed

5 files changed

+28
-4
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/src/.vs
2+
/src/API.Library/bin
3+
/src/API.Library/obj
4+
/test/.vs
5+
/test/API.Test/bin
6+
/test/API.Test/obj
7+
/test/API.Test/Logs
8+
/test/API.Test/API.Test.csproj.user

test/API.Test/Web.Live.config

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
</rules>
2727
-->
2828
<outboundRules>
29+
<rule name="Hide Server Header">
30+
<match serverVariable="RESPONSE_Server" pattern=".+" />
31+
<action type="Rewrite" value="n/a" />
32+
</rule>
2933
<!-- Private CORS - Default -->
3034
<rule name="Access-Control-Allow-Origin" enabled="true" patternSyntax="Wildcard">
3135
<match serverVariable="RESPONSE_Access-Control-Allow-Origin" pattern="*" />
@@ -290,4 +294,4 @@
290294
</appender>
291295
</log4net>
292296

293-
</configuration>
297+
</configuration>

test/API.Test/Web.Test.config

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
</rules>
2727
-->
2828
<outboundRules>
29+
<rule name="Hide Server Header">
30+
<match serverVariable="RESPONSE_Server" pattern=".+" />
31+
<action type="Rewrite" value="n/a" />
32+
</rule>
2933
<!-- Private CORS - Default -->
3034
<rule name="Access-Control-Allow-Origin" enabled="true" patternSyntax="Wildcard">
3135
<match serverVariable="RESPONSE_Access-Control-Allow-Origin" pattern="*" />
@@ -278,4 +282,4 @@
278282
</appender>
279283
</log4net>
280284

281-
</configuration>
285+
</configuration>

test/API.Test/Web.UAT.config

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
</rules>
2727
-->
2828
<outboundRules>
29+
<rule name="Hide Server Header">
30+
<match serverVariable="RESPONSE_Server" pattern=".+" />
31+
<action type="Rewrite" value="n/a" />
32+
</rule>
2933
<!-- Private CORS - Default -->
3034
<rule name="Access-Control-Allow-Origin" enabled="true" patternSyntax="Wildcard">
3135
<match serverVariable="RESPONSE_Access-Control-Allow-Origin" pattern="*" />
@@ -290,4 +294,4 @@
290294
</appender>
291295
</log4net>
292296

293-
</configuration>
297+
</configuration>

test/API.Test/Web.config

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<system.web>
2828
<compilation debug="true" targetFramework="4.7.2" />
2929
<!-- executionTimeout (Seconds), maxRequestLength (KB) must match maxAllowedContentLength (B) -->
30-
<httpRuntime targetFramework="4.7.2" executionTimeout="600" maxRequestLength="131072" />
30+
<httpRuntime targetFramework="4.7.2" executionTimeout="600" maxRequestLength="131072" enableVersionHeader="false" />
3131
</system.web>
3232

3333
<system.webServer>
@@ -66,6 +66,10 @@
6666

6767
<rewrite>
6868
<outboundRules>
69+
<rule name="Hide Server Header">
70+
<match serverVariable="RESPONSE_Server" pattern=".+" />
71+
<action type="Rewrite" value="n/a" />
72+
</rule>
6973
<!-- Private CORS - Default -->
7074
<rule name="Access-Control-Allow-Origin" enabled="true" patternSyntax="Wildcard">
7175
<match serverVariable="RESPONSE_Access-Control-Allow-Origin" pattern="*" />

0 commit comments

Comments
 (0)