#[non_exhaustive]pub struct StatementBuilder { /* private fields */ }
Expand description
A builder for Statement
.
Implementations§
Source§impl StatementBuilder
impl StatementBuilder
Sourcepub fn byte_match_statement(self, input: ByteMatchStatement) -> Self
pub fn byte_match_statement(self, input: ByteMatchStatement) -> Self
A rule statement that defines a string match search for WAF to apply to web requests. The byte match statement provides the bytes to search for, the location in requests that you want WAF to search, and other settings. The bytes to search for are typically a string that corresponds with ASCII characters. In the WAF console and the developer guide, this is called a string match statement.
Sourcepub fn set_byte_match_statement(self, input: Option<ByteMatchStatement>) -> Self
pub fn set_byte_match_statement(self, input: Option<ByteMatchStatement>) -> Self
A rule statement that defines a string match search for WAF to apply to web requests. The byte match statement provides the bytes to search for, the location in requests that you want WAF to search, and other settings. The bytes to search for are typically a string that corresponds with ASCII characters. In the WAF console and the developer guide, this is called a string match statement.
Sourcepub fn get_byte_match_statement(&self) -> &Option<ByteMatchStatement>
pub fn get_byte_match_statement(&self) -> &Option<ByteMatchStatement>
A rule statement that defines a string match search for WAF to apply to web requests. The byte match statement provides the bytes to search for, the location in requests that you want WAF to search, and other settings. The bytes to search for are typically a string that corresponds with ASCII characters. In the WAF console and the developer guide, this is called a string match statement.
Sourcepub fn sqli_match_statement(self, input: SqliMatchStatement) -> Self
pub fn sqli_match_statement(self, input: SqliMatchStatement) -> Self
A rule statement that inspects for malicious SQL code. Attackers insert malicious SQL code into web requests to do things like modify your database or extract data from it.
Sourcepub fn set_sqli_match_statement(self, input: Option<SqliMatchStatement>) -> Self
pub fn set_sqli_match_statement(self, input: Option<SqliMatchStatement>) -> Self
A rule statement that inspects for malicious SQL code. Attackers insert malicious SQL code into web requests to do things like modify your database or extract data from it.
Sourcepub fn get_sqli_match_statement(&self) -> &Option<SqliMatchStatement>
pub fn get_sqli_match_statement(&self) -> &Option<SqliMatchStatement>
A rule statement that inspects for malicious SQL code. Attackers insert malicious SQL code into web requests to do things like modify your database or extract data from it.
Sourcepub fn xss_match_statement(self, input: XssMatchStatement) -> Self
pub fn xss_match_statement(self, input: XssMatchStatement) -> Self
A rule statement that inspects for cross-site scripting (XSS) attacks. In XSS attacks, the attacker uses vulnerabilities in a benign website as a vehicle to inject malicious client-site scripts into other legitimate web browsers.
Sourcepub fn set_xss_match_statement(self, input: Option<XssMatchStatement>) -> Self
pub fn set_xss_match_statement(self, input: Option<XssMatchStatement>) -> Self
A rule statement that inspects for cross-site scripting (XSS) attacks. In XSS attacks, the attacker uses vulnerabilities in a benign website as a vehicle to inject malicious client-site scripts into other legitimate web browsers.
Sourcepub fn get_xss_match_statement(&self) -> &Option<XssMatchStatement>
pub fn get_xss_match_statement(&self) -> &Option<XssMatchStatement>
A rule statement that inspects for cross-site scripting (XSS) attacks. In XSS attacks, the attacker uses vulnerabilities in a benign website as a vehicle to inject malicious client-site scripts into other legitimate web browsers.
Sourcepub fn size_constraint_statement(self, input: SizeConstraintStatement) -> Self
pub fn size_constraint_statement(self, input: SizeConstraintStatement) -> Self
A rule statement that compares a number of bytes against the size of a request component, using a comparison operator, such as greater than (>) or less than (<). For example, you can use a size constraint statement to look for query strings that are longer than 100 bytes.
If you configure WAF to inspect the request body, WAF inspects only the number of bytes in the body up to the limit for the web ACL and protected resource type. If you know that the request body for your web requests should never exceed the inspection limit, you can use a size constraint statement to block requests that have a larger request body size. For more information about the inspection limits, see Body
and JsonBody
settings for the FieldToMatch
data type.
If you choose URI for the value of Part of the request to filter on, the slash (/) in the URI counts as one character. For example, the URI /logo.jpg
is nine characters long.
Sourcepub fn set_size_constraint_statement(
self,
input: Option<SizeConstraintStatement>,
) -> Self
pub fn set_size_constraint_statement( self, input: Option<SizeConstraintStatement>, ) -> Self
A rule statement that compares a number of bytes against the size of a request component, using a comparison operator, such as greater than (>) or less than (<). For example, you can use a size constraint statement to look for query strings that are longer than 100 bytes.
If you configure WAF to inspect the request body, WAF inspects only the number of bytes in the body up to the limit for the web ACL and protected resource type. If you know that the request body for your web requests should never exceed the inspection limit, you can use a size constraint statement to block requests that have a larger request body size. For more information about the inspection limits, see Body
and JsonBody
settings for the FieldToMatch
data type.
If you choose URI for the value of Part of the request to filter on, the slash (/) in the URI counts as one character. For example, the URI /logo.jpg
is nine characters long.
Sourcepub fn get_size_constraint_statement(&self) -> &Option<SizeConstraintStatement>
pub fn get_size_constraint_statement(&self) -> &Option<SizeConstraintStatement>
A rule statement that compares a number of bytes against the size of a request component, using a comparison operator, such as greater than (>) or less than (<). For example, you can use a size constraint statement to look for query strings that are longer than 100 bytes.
If you configure WAF to inspect the request body, WAF inspects only the number of bytes in the body up to the limit for the web ACL and protected resource type. If you know that the request body for your web requests should never exceed the inspection limit, you can use a size constraint statement to block requests that have a larger request body size. For more information about the inspection limits, see Body
and JsonBody
settings for the FieldToMatch
data type.
If you choose URI for the value of Part of the request to filter on, the slash (/) in the URI counts as one character. For example, the URI /logo.jpg
is nine characters long.
Sourcepub fn geo_match_statement(self, input: GeoMatchStatement) -> Self
pub fn geo_match_statement(self, input: GeoMatchStatement) -> Self
A rule statement that labels web requests by country and region and that matches against web requests based on country code. A geo match rule labels every request that it inspects regardless of whether it finds a match.
-
To manage requests only by country, you can use this statement by itself and specify the countries that you want to match against in the
CountryCodes
array. -
Otherwise, configure your geo match rule with Count action so that it only labels requests. Then, add one or more label match rules to run after the geo match rule and configure them to match against the geographic labels and handle the requests as needed.
WAF labels requests using the alpha-2 country and region codes from the International Organization for Standardization (ISO) 3166 standard. WAF determines the codes using either the IP address in the web request origin or, if you specify it, the address in the geo match ForwardedIPConfig
.
If you use the web request origin, the label formats are awswaf:clientip:geo:region:
and awswaf:clientip:geo:country:
.
If you use a forwarded IP address, the label formats are awswaf:forwardedip:geo:region:
and awswaf:forwardedip:geo:country:
.
For additional details, see Geographic match rule statement in the WAF Developer Guide.
Sourcepub fn set_geo_match_statement(self, input: Option<GeoMatchStatement>) -> Self
pub fn set_geo_match_statement(self, input: Option<GeoMatchStatement>) -> Self
A rule statement that labels web requests by country and region and that matches against web requests based on country code. A geo match rule labels every request that it inspects regardless of whether it finds a match.
-
To manage requests only by country, you can use this statement by itself and specify the countries that you want to match against in the
CountryCodes
array. -
Otherwise, configure your geo match rule with Count action so that it only labels requests. Then, add one or more label match rules to run after the geo match rule and configure them to match against the geographic labels and handle the requests as needed.
WAF labels requests using the alpha-2 country and region codes from the International Organization for Standardization (ISO) 3166 standard. WAF determines the codes using either the IP address in the web request origin or, if you specify it, the address in the geo match ForwardedIPConfig
.
If you use the web request origin, the label formats are awswaf:clientip:geo:region:
and awswaf:clientip:geo:country:
.
If you use a forwarded IP address, the label formats are awswaf:forwardedip:geo:region:
and awswaf:forwardedip:geo:country:
.
For additional details, see Geographic match rule statement in the WAF Developer Guide.
Sourcepub fn get_geo_match_statement(&self) -> &Option<GeoMatchStatement>
pub fn get_geo_match_statement(&self) -> &Option<GeoMatchStatement>
A rule statement that labels web requests by country and region and that matches against web requests based on country code. A geo match rule labels every request that it inspects regardless of whether it finds a match.
-
To manage requests only by country, you can use this statement by itself and specify the countries that you want to match against in the
CountryCodes
array. -
Otherwise, configure your geo match rule with Count action so that it only labels requests. Then, add one or more label match rules to run after the geo match rule and configure them to match against the geographic labels and handle the requests as needed.
WAF labels requests using the alpha-2 country and region codes from the International Organization for Standardization (ISO) 3166 standard. WAF determines the codes using either the IP address in the web request origin or, if you specify it, the address in the geo match ForwardedIPConfig
.
If you use the web request origin, the label formats are awswaf:clientip:geo:region:
and awswaf:clientip:geo:country:
.
If you use a forwarded IP address, the label formats are awswaf:forwardedip:geo:region:
and awswaf:forwardedip:geo:country:
.
For additional details, see Geographic match rule statement in the WAF Developer Guide.
Sourcepub fn rule_group_reference_statement(
self,
input: RuleGroupReferenceStatement,
) -> Self
pub fn rule_group_reference_statement( self, input: RuleGroupReferenceStatement, ) -> Self
A rule statement used to run the rules that are defined in a RuleGroup
. To use this, create a rule group with your rules, then provide the ARN of the rule group in this statement.
You cannot nest a RuleGroupReferenceStatement
, for example for use inside a NotStatement
or OrStatement
. You cannot use a rule group reference statement inside another rule group. You can only reference a rule group as a top-level statement within a rule that you define in a web ACL.
Sourcepub fn set_rule_group_reference_statement(
self,
input: Option<RuleGroupReferenceStatement>,
) -> Self
pub fn set_rule_group_reference_statement( self, input: Option<RuleGroupReferenceStatement>, ) -> Self
A rule statement used to run the rules that are defined in a RuleGroup
. To use this, create a rule group with your rules, then provide the ARN of the rule group in this statement.
You cannot nest a RuleGroupReferenceStatement
, for example for use inside a NotStatement
or OrStatement
. You cannot use a rule group reference statement inside another rule group. You can only reference a rule group as a top-level statement within a rule that you define in a web ACL.
Sourcepub fn get_rule_group_reference_statement(
&self,
) -> &Option<RuleGroupReferenceStatement>
pub fn get_rule_group_reference_statement( &self, ) -> &Option<RuleGroupReferenceStatement>
A rule statement used to run the rules that are defined in a RuleGroup
. To use this, create a rule group with your rules, then provide the ARN of the rule group in this statement.
You cannot nest a RuleGroupReferenceStatement
, for example for use inside a NotStatement
or OrStatement
. You cannot use a rule group reference statement inside another rule group. You can only reference a rule group as a top-level statement within a rule that you define in a web ACL.
Sourcepub fn ip_set_reference_statement(self, input: IpSetReferenceStatement) -> Self
pub fn ip_set_reference_statement(self, input: IpSetReferenceStatement) -> Self
A rule statement used to detect web requests coming from particular IP addresses or address ranges. To use this, create an IPSet
that specifies the addresses you want to detect, then use the ARN of that set in this statement. To create an IP set, see CreateIPSet
.
Each IP set rule statement references an IP set. You create and maintain the set independent of your rules. This allows you to use the single set in multiple rules. When you update the referenced set, WAF automatically updates all rules that reference it.
Sourcepub fn set_ip_set_reference_statement(
self,
input: Option<IpSetReferenceStatement>,
) -> Self
pub fn set_ip_set_reference_statement( self, input: Option<IpSetReferenceStatement>, ) -> Self
A rule statement used to detect web requests coming from particular IP addresses or address ranges. To use this, create an IPSet
that specifies the addresses you want to detect, then use the ARN of that set in this statement. To create an IP set, see CreateIPSet
.
Each IP set rule statement references an IP set. You create and maintain the set independent of your rules. This allows you to use the single set in multiple rules. When you update the referenced set, WAF automatically updates all rules that reference it.
Sourcepub fn get_ip_set_reference_statement(&self) -> &Option<IpSetReferenceStatement>
pub fn get_ip_set_reference_statement(&self) -> &Option<IpSetReferenceStatement>
A rule statement used to detect web requests coming from particular IP addresses or address ranges. To use this, create an IPSet
that specifies the addresses you want to detect, then use the ARN of that set in this statement. To create an IP set, see CreateIPSet
.
Each IP set rule statement references an IP set. You create and maintain the set independent of your rules. This allows you to use the single set in multiple rules. When you update the referenced set, WAF automatically updates all rules that reference it.
Sourcepub fn regex_pattern_set_reference_statement(
self,
input: RegexPatternSetReferenceStatement,
) -> Self
pub fn regex_pattern_set_reference_statement( self, input: RegexPatternSetReferenceStatement, ) -> Self
A rule statement used to search web request components for matches with regular expressions. To use this, create a RegexPatternSet
that specifies the expressions that you want to detect, then use the ARN of that set in this statement. A web request matches the pattern set rule statement if the request component matches any of the patterns in the set. To create a regex pattern set, see CreateRegexPatternSet
.
Each regex pattern set rule statement references a regex pattern set. You create and maintain the set independent of your rules. This allows you to use the single set in multiple rules. When you update the referenced set, WAF automatically updates all rules that reference it.
Sourcepub fn set_regex_pattern_set_reference_statement(
self,
input: Option<RegexPatternSetReferenceStatement>,
) -> Self
pub fn set_regex_pattern_set_reference_statement( self, input: Option<RegexPatternSetReferenceStatement>, ) -> Self
A rule statement used to search web request components for matches with regular expressions. To use this, create a RegexPatternSet
that specifies the expressions that you want to detect, then use the ARN of that set in this statement. A web request matches the pattern set rule statement if the request component matches any of the patterns in the set. To create a regex pattern set, see CreateRegexPatternSet
.
Each regex pattern set rule statement references a regex pattern set. You create and maintain the set independent of your rules. This allows you to use the single set in multiple rules. When you update the referenced set, WAF automatically updates all rules that reference it.
Sourcepub fn get_regex_pattern_set_reference_statement(
&self,
) -> &Option<RegexPatternSetReferenceStatement>
pub fn get_regex_pattern_set_reference_statement( &self, ) -> &Option<RegexPatternSetReferenceStatement>
A rule statement used to search web request components for matches with regular expressions. To use this, create a RegexPatternSet
that specifies the expressions that you want to detect, then use the ARN of that set in this statement. A web request matches the pattern set rule statement if the request component matches any of the patterns in the set. To create a regex pattern set, see CreateRegexPatternSet
.
Each regex pattern set rule statement references a regex pattern set. You create and maintain the set independent of your rules. This allows you to use the single set in multiple rules. When you update the referenced set, WAF automatically updates all rules that reference it.
Sourcepub fn rate_based_statement(self, input: RateBasedStatement) -> Self
pub fn rate_based_statement(self, input: RateBasedStatement) -> Self
A rate-based rule counts incoming requests and rate limits requests when they are coming at too fast a rate. The rule categorizes requests according to your aggregation criteria, collects them into aggregation instances, and counts and rate limits the requests for each instance.
If you change any of these settings in a rule that's currently in use, the change resets the rule's rate limiting counts. This can pause the rule's rate limiting activities for up to a minute.
You can specify individual aggregation keys, like IP address or HTTP method. You can also specify aggregation key combinations, like IP address and HTTP method, or HTTP method, query argument, and cookie.
Each unique set of values for the aggregation keys that you specify is a separate aggregation instance, with the value from each key contributing to the aggregation instance definition.
For example, assume the rule evaluates web requests with the following IP address and HTTP method values:
-
IP address 10.1.1.1, HTTP method POST
-
IP address 10.1.1.1, HTTP method GET
-
IP address 127.0.0.0, HTTP method POST
-
IP address 10.1.1.1, HTTP method GET
The rule would create different aggregation instances according to your aggregation criteria, for example:
-
If the aggregation criteria is just the IP address, then each individual address is an aggregation instance, and WAF counts requests separately for each. The aggregation instances and request counts for our example would be the following:
-
IP address 10.1.1.1: count 3
-
IP address 127.0.0.0: count 1
-
-
If the aggregation criteria is HTTP method, then each individual HTTP method is an aggregation instance. The aggregation instances and request counts for our example would be the following:
-
HTTP method POST: count 2
-
HTTP method GET: count 2
-
-
If the aggregation criteria is IP address and HTTP method, then each IP address and each HTTP method would contribute to the combined aggregation instance. The aggregation instances and request counts for our example would be the following:
-
IP address 10.1.1.1, HTTP method POST: count 1
-
IP address 10.1.1.1, HTTP method GET: count 2
-
IP address 127.0.0.0, HTTP method POST: count 1
-
For any n-tuple of aggregation keys, each unique combination of values for the keys defines a separate aggregation instance, which WAF counts and rate-limits individually.
You can optionally nest another statement inside the rate-based statement, to narrow the scope of the rule so that it only counts and rate limits requests that match the nested statement. You can use this nested scope-down statement in conjunction with your aggregation key specifications or you can just count and rate limit all requests that match the scope-down statement, without additional aggregation. When you choose to just manage all requests that match a scope-down statement, the aggregation instance is singular for the rule.
You cannot nest a RateBasedStatement
inside another statement, for example inside a NotStatement
or OrStatement
. You can define a RateBasedStatement
inside a web ACL and inside a rule group.
For additional information about the options, see Rate limiting web requests using rate-based rules in the WAF Developer Guide.
If you only aggregate on the individual IP address or forwarded IP address, you can retrieve the list of IP addresses that WAF is currently rate limiting for a rule through the API call GetRateBasedStatementManagedKeys
. This option is not available for other aggregation configurations.
WAF tracks and manages web requests separately for each instance of a rate-based rule that you use. For example, if you provide the same rate-based rule settings in two web ACLs, each of the two rule statements represents a separate instance of the rate-based rule and gets its own tracking and management by WAF. If you define a rate-based rule inside a rule group, and then use that rule group in multiple places, each use creates a separate instance of the rate-based rule that gets its own tracking and management by WAF.
Sourcepub fn set_rate_based_statement(self, input: Option<RateBasedStatement>) -> Self
pub fn set_rate_based_statement(self, input: Option<RateBasedStatement>) -> Self
A rate-based rule counts incoming requests and rate limits requests when they are coming at too fast a rate. The rule categorizes requests according to your aggregation criteria, collects them into aggregation instances, and counts and rate limits the requests for each instance.
If you change any of these settings in a rule that's currently in use, the change resets the rule's rate limiting counts. This can pause the rule's rate limiting activities for up to a minute.
You can specify individual aggregation keys, like IP address or HTTP method. You can also specify aggregation key combinations, like IP address and HTTP method, or HTTP method, query argument, and cookie.
Each unique set of values for the aggregation keys that you specify is a separate aggregation instance, with the value from each key contributing to the aggregation instance definition.
For example, assume the rule evaluates web requests with the following IP address and HTTP method values:
-
IP address 10.1.1.1, HTTP method POST
-
IP address 10.1.1.1, HTTP method GET
-
IP address 127.0.0.0, HTTP method POST
-
IP address 10.1.1.1, HTTP method GET
The rule would create different aggregation instances according to your aggregation criteria, for example:
-
If the aggregation criteria is just the IP address, then each individual address is an aggregation instance, and WAF counts requests separately for each. The aggregation instances and request counts for our example would be the following:
-
IP address 10.1.1.1: count 3
-
IP address 127.0.0.0: count 1
-
-
If the aggregation criteria is HTTP method, then each individual HTTP method is an aggregation instance. The aggregation instances and request counts for our example would be the following:
-
HTTP method POST: count 2
-
HTTP method GET: count 2
-
-
If the aggregation criteria is IP address and HTTP method, then each IP address and each HTTP method would contribute to the combined aggregation instance. The aggregation instances and request counts for our example would be the following:
-
IP address 10.1.1.1, HTTP method POST: count 1
-
IP address 10.1.1.1, HTTP method GET: count 2
-
IP address 127.0.0.0, HTTP method POST: count 1
-
For any n-tuple of aggregation keys, each unique combination of values for the keys defines a separate aggregation instance, which WAF counts and rate-limits individually.
You can optionally nest another statement inside the rate-based statement, to narrow the scope of the rule so that it only counts and rate limits requests that match the nested statement. You can use this nested scope-down statement in conjunction with your aggregation key specifications or you can just count and rate limit all requests that match the scope-down statement, without additional aggregation. When you choose to just manage all requests that match a scope-down statement, the aggregation instance is singular for the rule.
You cannot nest a RateBasedStatement
inside another statement, for example inside a NotStatement
or OrStatement
. You can define a RateBasedStatement
inside a web ACL and inside a rule group.
For additional information about the options, see Rate limiting web requests using rate-based rules in the WAF Developer Guide.
If you only aggregate on the individual IP address or forwarded IP address, you can retrieve the list of IP addresses that WAF is currently rate limiting for a rule through the API call GetRateBasedStatementManagedKeys
. This option is not available for other aggregation configurations.
WAF tracks and manages web requests separately for each instance of a rate-based rule that you use. For example, if you provide the same rate-based rule settings in two web ACLs, each of the two rule statements represents a separate instance of the rate-based rule and gets its own tracking and management by WAF. If you define a rate-based rule inside a rule group, and then use that rule group in multiple places, each use creates a separate instance of the rate-based rule that gets its own tracking and management by WAF.
Sourcepub fn get_rate_based_statement(&self) -> &Option<RateBasedStatement>
pub fn get_rate_based_statement(&self) -> &Option<RateBasedStatement>
A rate-based rule counts incoming requests and rate limits requests when they are coming at too fast a rate. The rule categorizes requests according to your aggregation criteria, collects them into aggregation instances, and counts and rate limits the requests for each instance.
If you change any of these settings in a rule that's currently in use, the change resets the rule's rate limiting counts. This can pause the rule's rate limiting activities for up to a minute.
You can specify individual aggregation keys, like IP address or HTTP method. You can also specify aggregation key combinations, like IP address and HTTP method, or HTTP method, query argument, and cookie.
Each unique set of values for the aggregation keys that you specify is a separate aggregation instance, with the value from each key contributing to the aggregation instance definition.
For example, assume the rule evaluates web requests with the following IP address and HTTP method values:
-
IP address 10.1.1.1, HTTP method POST
-
IP address 10.1.1.1, HTTP method GET
-
IP address 127.0.0.0, HTTP method POST
-
IP address 10.1.1.1, HTTP method GET
The rule would create different aggregation instances according to your aggregation criteria, for example:
-
If the aggregation criteria is just the IP address, then each individual address is an aggregation instance, and WAF counts requests separately for each. The aggregation instances and request counts for our example would be the following:
-
IP address 10.1.1.1: count 3
-
IP address 127.0.0.0: count 1
-
-
If the aggregation criteria is HTTP method, then each individual HTTP method is an aggregation instance. The aggregation instances and request counts for our example would be the following:
-
HTTP method POST: count 2
-
HTTP method GET: count 2
-
-
If the aggregation criteria is IP address and HTTP method, then each IP address and each HTTP method would contribute to the combined aggregation instance. The aggregation instances and request counts for our example would be the following:
-
IP address 10.1.1.1, HTTP method POST: count 1
-
IP address 10.1.1.1, HTTP method GET: count 2
-
IP address 127.0.0.0, HTTP method POST: count 1
-
For any n-tuple of aggregation keys, each unique combination of values for the keys defines a separate aggregation instance, which WAF counts and rate-limits individually.
You can optionally nest another statement inside the rate-based statement, to narrow the scope of the rule so that it only counts and rate limits requests that match the nested statement. You can use this nested scope-down statement in conjunction with your aggregation key specifications or you can just count and rate limit all requests that match the scope-down statement, without additional aggregation. When you choose to just manage all requests that match a scope-down statement, the aggregation instance is singular for the rule.
You cannot nest a RateBasedStatement
inside another statement, for example inside a NotStatement
or OrStatement
. You can define a RateBasedStatement
inside a web ACL and inside a rule group.
For additional information about the options, see Rate limiting web requests using rate-based rules in the WAF Developer Guide.
If you only aggregate on the individual IP address or forwarded IP address, you can retrieve the list of IP addresses that WAF is currently rate limiting for a rule through the API call GetRateBasedStatementManagedKeys
. This option is not available for other aggregation configurations.
WAF tracks and manages web requests separately for each instance of a rate-based rule that you use. For example, if you provide the same rate-based rule settings in two web ACLs, each of the two rule statements represents a separate instance of the rate-based rule and gets its own tracking and management by WAF. If you define a rate-based rule inside a rule group, and then use that rule group in multiple places, each use creates a separate instance of the rate-based rule that gets its own tracking and management by WAF.
Sourcepub fn and_statement(self, input: AndStatement) -> Self
pub fn and_statement(self, input: AndStatement) -> Self
A logical rule statement used to combine other rule statements with AND logic. You provide more than one Statement
within the AndStatement
.
Sourcepub fn set_and_statement(self, input: Option<AndStatement>) -> Self
pub fn set_and_statement(self, input: Option<AndStatement>) -> Self
A logical rule statement used to combine other rule statements with AND logic. You provide more than one Statement
within the AndStatement
.
Sourcepub fn get_and_statement(&self) -> &Option<AndStatement>
pub fn get_and_statement(&self) -> &Option<AndStatement>
A logical rule statement used to combine other rule statements with AND logic. You provide more than one Statement
within the AndStatement
.
Sourcepub fn or_statement(self, input: OrStatement) -> Self
pub fn or_statement(self, input: OrStatement) -> Self
A logical rule statement used to combine other rule statements with OR logic. You provide more than one Statement
within the OrStatement
.
Sourcepub fn set_or_statement(self, input: Option<OrStatement>) -> Self
pub fn set_or_statement(self, input: Option<OrStatement>) -> Self
A logical rule statement used to combine other rule statements with OR logic. You provide more than one Statement
within the OrStatement
.
Sourcepub fn get_or_statement(&self) -> &Option<OrStatement>
pub fn get_or_statement(&self) -> &Option<OrStatement>
A logical rule statement used to combine other rule statements with OR logic. You provide more than one Statement
within the OrStatement
.
Sourcepub fn not_statement(self, input: NotStatement) -> Self
pub fn not_statement(self, input: NotStatement) -> Self
A logical rule statement used to negate the results of another rule statement. You provide one Statement
within the NotStatement
.
Sourcepub fn set_not_statement(self, input: Option<NotStatement>) -> Self
pub fn set_not_statement(self, input: Option<NotStatement>) -> Self
A logical rule statement used to negate the results of another rule statement. You provide one Statement
within the NotStatement
.
Sourcepub fn get_not_statement(&self) -> &Option<NotStatement>
pub fn get_not_statement(&self) -> &Option<NotStatement>
A logical rule statement used to negate the results of another rule statement. You provide one Statement
within the NotStatement
.
Sourcepub fn managed_rule_group_statement(
self,
input: ManagedRuleGroupStatement,
) -> Self
pub fn managed_rule_group_statement( self, input: ManagedRuleGroupStatement, ) -> Self
A rule statement used to run the rules that are defined in a managed rule group. To use this, provide the vendor name and the name of the rule group in this statement. You can retrieve the required names by calling ListAvailableManagedRuleGroups
.
You cannot nest a ManagedRuleGroupStatement
, for example for use inside a NotStatement
or OrStatement
. You cannot use a managed rule group inside another rule group. You can only reference a managed rule group as a top-level statement within a rule that you define in a web ACL.
You are charged additional fees when you use the WAF Bot Control managed rule group AWSManagedRulesBotControlRuleSet
, the WAF Fraud Control account takeover prevention (ATP) managed rule group AWSManagedRulesATPRuleSet
, or the WAF Fraud Control account creation fraud prevention (ACFP) managed rule group AWSManagedRulesACFPRuleSet
. For more information, see WAF Pricing.
Sourcepub fn set_managed_rule_group_statement(
self,
input: Option<ManagedRuleGroupStatement>,
) -> Self
pub fn set_managed_rule_group_statement( self, input: Option<ManagedRuleGroupStatement>, ) -> Self
A rule statement used to run the rules that are defined in a managed rule group. To use this, provide the vendor name and the name of the rule group in this statement. You can retrieve the required names by calling ListAvailableManagedRuleGroups
.
You cannot nest a ManagedRuleGroupStatement
, for example for use inside a NotStatement
or OrStatement
. You cannot use a managed rule group inside another rule group. You can only reference a managed rule group as a top-level statement within a rule that you define in a web ACL.
You are charged additional fees when you use the WAF Bot Control managed rule group AWSManagedRulesBotControlRuleSet
, the WAF Fraud Control account takeover prevention (ATP) managed rule group AWSManagedRulesATPRuleSet
, or the WAF Fraud Control account creation fraud prevention (ACFP) managed rule group AWSManagedRulesACFPRuleSet
. For more information, see WAF Pricing.
Sourcepub fn get_managed_rule_group_statement(
&self,
) -> &Option<ManagedRuleGroupStatement>
pub fn get_managed_rule_group_statement( &self, ) -> &Option<ManagedRuleGroupStatement>
A rule statement used to run the rules that are defined in a managed rule group. To use this, provide the vendor name and the name of the rule group in this statement. You can retrieve the required names by calling ListAvailableManagedRuleGroups
.
You cannot nest a ManagedRuleGroupStatement
, for example for use inside a NotStatement
or OrStatement
. You cannot use a managed rule group inside another rule group. You can only reference a managed rule group as a top-level statement within a rule that you define in a web ACL.
You are charged additional fees when you use the WAF Bot Control managed rule group AWSManagedRulesBotControlRuleSet
, the WAF Fraud Control account takeover prevention (ATP) managed rule group AWSManagedRulesATPRuleSet
, or the WAF Fraud Control account creation fraud prevention (ACFP) managed rule group AWSManagedRulesACFPRuleSet
. For more information, see WAF Pricing.
Sourcepub fn label_match_statement(self, input: LabelMatchStatement) -> Self
pub fn label_match_statement(self, input: LabelMatchStatement) -> Self
A rule statement to match against labels that have been added to the web request by rules that have already run in the web ACL.
The label match statement provides the label or namespace string to search for. The label string can represent a part or all of the fully qualified label name that had been added to the web request. Fully qualified labels have a prefix, optional namespaces, and label name. The prefix identifies the rule group or web ACL context of the rule that added the label. If you do not provide the fully qualified name in your label match string, WAF performs the search for labels that were added in the same context as the label match statement.
Sourcepub fn set_label_match_statement(
self,
input: Option<LabelMatchStatement>,
) -> Self
pub fn set_label_match_statement( self, input: Option<LabelMatchStatement>, ) -> Self
A rule statement to match against labels that have been added to the web request by rules that have already run in the web ACL.
The label match statement provides the label or namespace string to search for. The label string can represent a part or all of the fully qualified label name that had been added to the web request. Fully qualified labels have a prefix, optional namespaces, and label name. The prefix identifies the rule group or web ACL context of the rule that added the label. If you do not provide the fully qualified name in your label match string, WAF performs the search for labels that were added in the same context as the label match statement.
Sourcepub fn get_label_match_statement(&self) -> &Option<LabelMatchStatement>
pub fn get_label_match_statement(&self) -> &Option<LabelMatchStatement>
A rule statement to match against labels that have been added to the web request by rules that have already run in the web ACL.
The label match statement provides the label or namespace string to search for. The label string can represent a part or all of the fully qualified label name that had been added to the web request. Fully qualified labels have a prefix, optional namespaces, and label name. The prefix identifies the rule group or web ACL context of the rule that added the label. If you do not provide the fully qualified name in your label match string, WAF performs the search for labels that were added in the same context as the label match statement.
Sourcepub fn regex_match_statement(self, input: RegexMatchStatement) -> Self
pub fn regex_match_statement(self, input: RegexMatchStatement) -> Self
A rule statement used to search web request components for a match against a single regular expression.
Sourcepub fn set_regex_match_statement(
self,
input: Option<RegexMatchStatement>,
) -> Self
pub fn set_regex_match_statement( self, input: Option<RegexMatchStatement>, ) -> Self
A rule statement used to search web request components for a match against a single regular expression.
Sourcepub fn get_regex_match_statement(&self) -> &Option<RegexMatchStatement>
pub fn get_regex_match_statement(&self) -> &Option<RegexMatchStatement>
A rule statement used to search web request components for a match against a single regular expression.
Trait Implementations§
Source§impl Clone for StatementBuilder
impl Clone for StatementBuilder
Source§fn clone(&self) -> StatementBuilder
fn clone(&self) -> StatementBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for StatementBuilder
impl Debug for StatementBuilder
Source§impl Default for StatementBuilder
impl Default for StatementBuilder
Source§fn default() -> StatementBuilder
fn default() -> StatementBuilder
Source§impl PartialEq for StatementBuilder
impl PartialEq for StatementBuilder
impl StructuralPartialEq for StatementBuilder
Auto Trait Implementations§
impl Freeze for StatementBuilder
impl RefUnwindSafe for StatementBuilder
impl Send for StatementBuilder
impl Sync for StatementBuilder
impl Unpin for StatementBuilder
impl UnwindSafe for StatementBuilder
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 moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightBlack
.
§Example
println!("{}", value.bright_black());
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightGreen
.
§Example
println!("{}", value.bright_green());
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightYellow
.
§Example
println!("{}", value.bright_yellow());
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightMagenta
.
§Example
println!("{}", value.bright_magenta());
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightWhite
.
§Example
println!("{}", value.bright_white());
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightBlack
.
§Example
println!("{}", value.on_bright_black());
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightGreen
.
§Example
println!("{}", value.on_bright_green());
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightYellow
.
§Example
println!("{}", value.on_bright_yellow());
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightBlue
.
§Example
println!("{}", value.on_bright_blue());
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightMagenta
.
§Example
println!("{}", value.on_bright_magenta());
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightCyan
.
§Example
println!("{}", value.on_bright_cyan());
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightWhite
.
§Example
println!("{}", value.on_bright_white());
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn underline(&self) -> Painted<&T>
fn underline(&self) -> Painted<&T>
Returns self
with the
attr()
set to
Attribute::Underline
.
§Example
println!("{}", value.underline());
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Returns self
with the
attr()
set to
Attribute::RapidBlink
.
§Example
println!("{}", value.rapid_blink());
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);