33 lines
1.2 KiB
YAML
33 lines
1.2 KiB
YAML
# Удаляет входящие x-sarex-audit-*: клиент не должен подставлять себе пользователя в журнал доступа.
|
||
# Стоит первым HTTP-фильтром (INSERT_FIRST) — раньше jwt_authn, который заполняет эти заголовки из claims.
|
||
apiVersion: networking.istio.io/v1alpha3
|
||
kind: EnvoyFilter
|
||
metadata:
|
||
name: strip-audit-headers
|
||
namespace: istio-system
|
||
spec:
|
||
workloadSelector:
|
||
labels:
|
||
security-audit/gateway: unset
|
||
configPatches:
|
||
- applyTo: HTTP_FILTER
|
||
match:
|
||
context: GATEWAY
|
||
listener:
|
||
filterChain:
|
||
filter:
|
||
name: envoy.filters.network.http_connection_manager
|
||
patch:
|
||
operation: INSERT_FIRST
|
||
value:
|
||
name: security-audit.strip-audit-headers
|
||
typed_config:
|
||
"@type": type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua
|
||
default_source_code:
|
||
inline_string: |
|
||
function envoy_on_request(request_handle)
|
||
local headers = request_handle:headers()
|
||
headers:remove("x-sarex-audit-sub")
|
||
headers:remove("x-sarex-audit-org")
|
||
end
|