http filter: add CSRF filter (#6470)
Signed-off-by: Derek Schaller <dschaller@lyft.com> Mirrored from https://github.com/envoyproxy/envoy @ eaaa918be9f1eff5768a65e28dbbd509c7652cc3pull/620/head
parent
9c735715f5
commit
da8a43117d
4 changed files with 54 additions and 0 deletions
@ -0,0 +1,9 @@ |
||||
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_library_internal") |
||||
|
||||
licenses(["notice"]) # Apache 2 |
||||
|
||||
api_proto_library_internal( |
||||
name = "csrf", |
||||
srcs = ["csrf.proto"], |
||||
deps = ["//envoy/api/v2/core:base"], |
||||
) |
@ -0,0 +1,43 @@ |
||||
syntax = "proto3"; |
||||
|
||||
package envoy.config.filter.http.csrf.v2; |
||||
|
||||
option java_outer_classname = "CsrfPolicyProto"; |
||||
option java_multiple_files = true; |
||||
option java_package = "io.envoyproxy.envoy.config.filter.http.csrf.v2"; |
||||
option go_package = "v2"; |
||||
|
||||
import "envoy/api/v2/core/base.proto"; |
||||
|
||||
import "validate/validate.proto"; |
||||
import "gogoproto/gogo.proto"; |
||||
|
||||
// [#protodoc-title: CSRF] |
||||
// Cross-Site Request Forgery :ref:`configuration overview <config_http_filters_csrf>`. |
||||
|
||||
// CSRF filter config. |
||||
message CsrfPolicy { |
||||
// Specify if CSRF is enabled. |
||||
// |
||||
// More information on how this can be controlled via runtime can be found |
||||
// :ref:`here <csrf-runtime>`. |
||||
// |
||||
// .. note:: |
||||
// |
||||
// This field defaults to 100/:ref:`HUNDRED |
||||
// <envoy_api_enum_type.FractionalPercent.DenominatorType>`. |
||||
envoy.api.v2.core.RuntimeFractionalPercent filter_enabled = 1 |
||||
[(validate.rules).message.required = true]; |
||||
|
||||
// Specifies that CSRF policies will be evaluated and tracked, but not enforced. |
||||
// This is intended to be used when filter_enabled is off. |
||||
// |
||||
// More information on how this can be controlled via runtime can be found |
||||
// :ref:`here <csrf-runtime>`. |
||||
// |
||||
// .. note:: |
||||
// |
||||
// This field defaults to 100/:ref:`HUNDRED |
||||
// <envoy_api_enum_type.FractionalPercent.DenominatorType>`. |
||||
envoy.api.v2.core.RuntimeFractionalPercent shadow_enabled = 2; |
||||
} |
Loading…
Reference in new issue