Struct aws_sdk_wafv2::types::ChallengeAction
source · #[non_exhaustive]pub struct ChallengeAction {
pub custom_request_handling: Option<CustomRequestHandling>,
}
Expand description
Specifies that WAF should run a Challenge
check against the request to verify that the request is coming from a legitimate client session:
-
If the request includes a valid, unexpired challenge token, WAF applies any custom request handling and labels that you've configured and then allows the web request inspection to proceed to the next rule, similar to a
CountAction
. -
If the request doesn't include a valid, unexpired challenge token, WAF discontinues the web ACL evaluation of the request and blocks it from going to its intended destination.
WAF then generates a challenge response that it sends back to the client, which includes the following:
-
The header
x-amzn-waf-action
with a value ofchallenge
. -
The HTTP status code
202 Request Accepted
. -
If the request contains an
Accept
header with a value oftext/html
, the response includes a JavaScript page interstitial with a challenge script.
Challenges run silent browser interrogations in the background, and don't generally affect the end user experience.
A challenge enforces token acquisition using an interstitial JavaScript challenge that inspects the client session for legitimate behavior. The challenge blocks bots or at least increases the cost of operating sophisticated bots.
After the client session successfully responds to the challenge, it receives a new token from WAF, which the challenge script uses to resubmit the original request.
-
You can configure the expiration time in the ChallengeConfig
ImmunityTimeProperty
setting at the rule and web ACL level. The rule setting overrides the web ACL setting.
This action option is available for rules. It isn't available for web ACL default actions.
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.custom_request_handling: Option<CustomRequestHandling>
Defines custom handling for the web request, used when the challenge inspection determines that the request's token is valid and unexpired.
For information about customizing web requests and responses, see Customizing web requests and responses in WAF in the WAF Developer Guide.
Implementations§
source§impl ChallengeAction
impl ChallengeAction
sourcepub fn custom_request_handling(&self) -> Option<&CustomRequestHandling>
pub fn custom_request_handling(&self) -> Option<&CustomRequestHandling>
Defines custom handling for the web request, used when the challenge inspection determines that the request's token is valid and unexpired.
For information about customizing web requests and responses, see Customizing web requests and responses in WAF in the WAF Developer Guide.
source§impl ChallengeAction
impl ChallengeAction
sourcepub fn builder() -> ChallengeActionBuilder
pub fn builder() -> ChallengeActionBuilder
Creates a new builder-style object to manufacture ChallengeAction
.
Trait Implementations§
source§impl Clone for ChallengeAction
impl Clone for ChallengeAction
source§fn clone(&self) -> ChallengeAction
fn clone(&self) -> ChallengeAction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ChallengeAction
impl Debug for ChallengeAction
source§impl PartialEq for ChallengeAction
impl PartialEq for ChallengeAction
source§fn eq(&self, other: &ChallengeAction) -> bool
fn eq(&self, other: &ChallengeAction) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for ChallengeAction
Auto Trait Implementations§
impl Freeze for ChallengeAction
impl RefUnwindSafe for ChallengeAction
impl Send for ChallengeAction
impl Sync for ChallengeAction
impl Unpin for ChallengeAction
impl UnwindSafe for ChallengeAction
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> 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