Struct aws_sdk_wafv2::types::ForwardedIpConfig
source · #[non_exhaustive]pub struct ForwardedIpConfig {
pub header_name: String,
pub fallback_behavior: FallbackBehavior,
}
Expand description
The configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that's reported by the web request origin. Commonly, this is the X-Forwarded-For (XFF) header, but you can specify any header name.
If the specified header isn't present in the request, WAF doesn't apply the rule to the web request at all.
This configuration is used for GeoMatchStatement
and RateBasedStatement
. For IPSetReferenceStatement
, use IPSetForwardedIPConfig
instead.
WAF only evaluates the first IP address found in the specified HTTP header.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.header_name: String
The name of the HTTP header to use for the IP address. For example, to use the X-Forwarded-For (XFF) header, set this to X-Forwarded-For
.
If the specified header isn't present in the request, WAF doesn't apply the rule to the web request at all.
fallback_behavior: FallbackBehavior
The match status to assign to the web request if the request doesn't have a valid IP address in the specified position.
If the specified header isn't present in the request, WAF doesn't apply the rule to the web request at all.
You can specify the following fallback behaviors:
-
MATCH
- Treat the web request as matching the rule statement. WAF applies the rule action to the request. -
NO_MATCH
- Treat the web request as not matching the rule statement.
Implementations§
source§impl ForwardedIpConfig
impl ForwardedIpConfig
sourcepub fn header_name(&self) -> &str
pub fn header_name(&self) -> &str
The name of the HTTP header to use for the IP address. For example, to use the X-Forwarded-For (XFF) header, set this to X-Forwarded-For
.
If the specified header isn't present in the request, WAF doesn't apply the rule to the web request at all.
sourcepub fn fallback_behavior(&self) -> &FallbackBehavior
pub fn fallback_behavior(&self) -> &FallbackBehavior
The match status to assign to the web request if the request doesn't have a valid IP address in the specified position.
If the specified header isn't present in the request, WAF doesn't apply the rule to the web request at all.
You can specify the following fallback behaviors:
-
MATCH
- Treat the web request as matching the rule statement. WAF applies the rule action to the request. -
NO_MATCH
- Treat the web request as not matching the rule statement.
source§impl ForwardedIpConfig
impl ForwardedIpConfig
sourcepub fn builder() -> ForwardedIpConfigBuilder
pub fn builder() -> ForwardedIpConfigBuilder
Creates a new builder-style object to manufacture ForwardedIpConfig
.
Trait Implementations§
source§impl Clone for ForwardedIpConfig
impl Clone for ForwardedIpConfig
source§fn clone(&self) -> ForwardedIpConfig
fn clone(&self) -> ForwardedIpConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ForwardedIpConfig
impl Debug for ForwardedIpConfig
source§impl PartialEq for ForwardedIpConfig
impl PartialEq for ForwardedIpConfig
source§fn eq(&self, other: &ForwardedIpConfig) -> bool
fn eq(&self, other: &ForwardedIpConfig) -> bool
self
and other
values to be equal, and is used
by ==
.