From ad12d3cdae5678d8461ce0458680361d9742f73d Mon Sep 17 00:00:00 2001 From: "data-plane-api(Azure Pipelines)" Date: Mon, 14 Jun 2021 18:46:45 +0000 Subject: [PATCH] formatter: print request header without query string (#15711) Signed-off-by: Tero Saarni Mirrored from https://github.com/envoyproxy/envoy @ 57366300c62f61664965f7d721059758e07f1216 --- BUILD | 1 + .../core/v3/substitution_format_string.proto | 1 + .../v4alpha/substitution_format_string.proto | 1 + .../formatter/req_without_query/v3/BUILD | 9 ++++++ .../v3/req_without_query.proto | 29 +++++++++++++++++++ versioning/BUILD | 1 + 6 files changed, 42 insertions(+) create mode 100644 envoy/extensions/formatter/req_without_query/v3/BUILD create mode 100644 envoy/extensions/formatter/req_without_query/v3/req_without_query.proto diff --git a/BUILD b/BUILD index 179af01c..245695ad 100644 --- a/BUILD +++ b/BUILD @@ -245,6 +245,7 @@ proto_library( "//envoy/extensions/filters/network/zookeeper_proxy/v3:pkg", "//envoy/extensions/filters/udp/dns_filter/v3alpha:pkg", "//envoy/extensions/filters/udp/udp_proxy/v3:pkg", + "//envoy/extensions/formatter/req_without_query/v3:pkg", "//envoy/extensions/health_checkers/redis/v3:pkg", "//envoy/extensions/http/header_formatters/preserve_case/v3:pkg", "//envoy/extensions/http/original_ip_detection/custom_header/v3:pkg", diff --git a/envoy/config/core/v3/substitution_format_string.proto b/envoy/config/core/v3/substitution_format_string.proto index 85eeabe6..b2a1c5e1 100644 --- a/envoy/config/core/v3/substitution_format_string.proto +++ b/envoy/config/core/v3/substitution_format_string.proto @@ -109,5 +109,6 @@ message SubstitutionFormatString { // Specifies a collection of Formatter plugins that can be called from the access log configuration. // See the formatters extensions documentation for details. + // [#extension-category: envoy.formatter] repeated TypedExtensionConfig formatters = 6; } diff --git a/envoy/config/core/v4alpha/substitution_format_string.proto b/envoy/config/core/v4alpha/substitution_format_string.proto index 36b25da7..6f5037f5 100644 --- a/envoy/config/core/v4alpha/substitution_format_string.proto +++ b/envoy/config/core/v4alpha/substitution_format_string.proto @@ -96,5 +96,6 @@ message SubstitutionFormatString { // Specifies a collection of Formatter plugins that can be called from the access log configuration. // See the formatters extensions documentation for details. + // [#extension-category: envoy.formatter] repeated TypedExtensionConfig formatters = 6; } diff --git a/envoy/extensions/formatter/req_without_query/v3/BUILD b/envoy/extensions/formatter/req_without_query/v3/BUILD new file mode 100644 index 00000000..ee92fb65 --- /dev/null +++ b/envoy/extensions/formatter/req_without_query/v3/BUILD @@ -0,0 +1,9 @@ +# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py. + +load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") + +licenses(["notice"]) # Apache 2 + +api_proto_package( + deps = ["@com_github_cncf_udpa//udpa/annotations:pkg"], +) diff --git a/envoy/extensions/formatter/req_without_query/v3/req_without_query.proto b/envoy/extensions/formatter/req_without_query/v3/req_without_query.proto new file mode 100644 index 00000000..e1b6c32a --- /dev/null +++ b/envoy/extensions/formatter/req_without_query/v3/req_without_query.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; + +package envoy.extensions.formatter.req_without_query.v3; + +import "udpa/annotations/status.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.formatter.req_without_query.v3"; +option java_outer_classname = "ReqWithoutQueryProto"; +option java_multiple_files = true; +option (udpa.annotations.file_status).package_version_status = ACTIVE; + +// [#protodoc-title: Formatter extension for printing request without query string] +// [#extension: envoy.formatter.req_without_query] + +// ReqWithoutQuery formatter extension implements REQ_WITHOUT_QUERY command operator that +// works the same way as :ref:`REQ ` except that it will +// remove the query string. It is used to avoid logging any sensitive information into +// the access log. +// See :ref:`here ` for more information on access log configuration. + +// %REQ_WITHOUT_QUERY(X?Y):Z% +// An HTTP request header where X is the main HTTP header, Y is the alternative one, and Z is an +// optional parameter denoting string truncation up to Z characters long. The value is taken from +// the HTTP request header named X first and if it's not set, then request header Y is used. If +// none of the headers are present '-' symbol will be in the log. + +// Configuration for the request without query formatter. +message ReqWithoutQuery { +} diff --git a/versioning/BUILD b/versioning/BUILD index 867fe05e..8558d13e 100644 --- a/versioning/BUILD +++ b/versioning/BUILD @@ -129,6 +129,7 @@ proto_library( "//envoy/extensions/filters/network/zookeeper_proxy/v3:pkg", "//envoy/extensions/filters/udp/dns_filter/v3alpha:pkg", "//envoy/extensions/filters/udp/udp_proxy/v3:pkg", + "//envoy/extensions/formatter/req_without_query/v3:pkg", "//envoy/extensions/health_checkers/redis/v3:pkg", "//envoy/extensions/http/header_formatters/preserve_case/v3:pkg", "//envoy/extensions/http/original_ip_detection/custom_header/v3:pkg",