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: StringThe 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: FallbackBehaviorThe 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
impl StructuralPartialEq for ForwardedIpConfig
Auto Trait Implementations§
impl Freeze for ForwardedIpConfig
impl RefUnwindSafe for ForwardedIpConfig
impl Send for ForwardedIpConfig
impl Sync for ForwardedIpConfig
impl Unpin for ForwardedIpConfig
impl UnwindSafe for ForwardedIpConfig
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more