Skip to content

Commit fed7ffe

Browse files
Merge pull request #53 from OS2iot/feature/IOT-1437-HTTPHEADERSDOCS
Added recommendation for disabling "Server" header.
2 parents 88598bc + 75eff10 commit fed7ffe

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

source/installation-guide/installation-guide.rst

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,51 @@ OS2IoT-backend takes several environment variables as configuration, if these ar
267267
| CHIRPSTACK_PORT | Chirpstack port | :code:`8080` |
268268
+-------------------------------+------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+
269269
270+
We recommend disabling the HTTP "Server" header in your responses, as it can reveal information that may expose your application to vulnerabilities.
271+
The following example demonstrates how to disable the HTTP "Server" header when running in Kubernetes with an Istio setup.
272+
273+
Create a new file named envoyfilter.yaml and place it in the helm/template directory.
274+
275+
a. Add the following content to envoyfilter.yaml:
276+
277+
.. code-block:: bash
278+
279+
apiVersion: networking.istio.io/v1alpha3
280+
kind: EnvoyFilter
281+
metadata:
282+
name: ef-removeserver
283+
namespace: {{ .Values.envoyFilter.namespace }}
284+
spec:
285+
configPatches:
286+
- applyTo: NETWORK_FILTER
287+
match:
288+
listener:
289+
filterChain:
290+
filter:
291+
name: "envoy.filters.network.http_connection_manager"
292+
patch:
293+
operation: MERGE
294+
value:
295+
typed_config:
296+
"@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager"
297+
server_header_transformation: PASS_THROUGH
298+
- applyTo: ROUTE_CONFIGURATION
299+
patch:
300+
operation: MERGE
301+
value:
302+
response_headers_to_remove:
303+
- "x-envoy-upstream-service-time"
304+
- "server"
305+
306+
2. In the values.yaml file for your backend Helm chart, add the following configuration:
307+
308+
.. code-block:: bash
309+
310+
# Add EnvoyFilter settings here
311+
envoyFilter:
312+
enabled: true # Set to 'false' to disable the filter
313+
namespace: "istio-system" # The namespace where the EnvoyFilter should be applied
314+
270315
Logs levels
271316
"""""""""""""""
272317
Specifying a LOG_LEVEL makes sure that only logs with that level or higher are included. Using 'debug' or 'verbose' LOG_LEVEL in a production environment is not recommended.

0 commit comments

Comments
 (0)