Class ProtectionSettings
- java.lang.Object
-
- com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel
-
- com.oracle.bmc.waas.model.ProtectionSettings
-
@Generated(value="OracleSDKGenerator", comments="API Version: 20181116") public final class ProtectionSettings extends com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel
The settings used for protection rules.
Note: Objects should always be created or deserialized using theProtectionSettings.Builder
. This model distinguishes fields that are null because they are unset from fields that are explicitly set to null. This is done in the setter methods of theProtectionSettings.Builder
, which maintain a set of all explicitly set fields calledProtectionSettings.Builder.__explicitlySet__
. ThehashCode()
andequals(Object)
methods are implemented to take the explicitly set fields into account. The constructor, on the other hand, does not take the explicitly set fields into account (since the constructor cannot distinguish explicit null from unset null).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ProtectionSettings.AllowedHttpMethods
static class
ProtectionSettings.BlockAction
If action is set to BLOCK, this specifies how the traffic is blocked when detected as malicious by a protection rule.static class
ProtectionSettings.Builder
-
Constructor Summary
Constructors Constructor Description ProtectionSettings(ProtectionSettings.BlockAction blockAction, Integer blockResponseCode, String blockErrorPageMessage, String blockErrorPageCode, String blockErrorPageDescription, Integer maxArgumentCount, Integer maxNameLengthPerArgument, Integer maxTotalNameLengthOfArguments, Integer recommendationsPeriodInDays, Boolean isResponseInspected, Integer maxResponseSizeInKiB, List<ProtectionSettings.AllowedHttpMethods> allowedHttpMethods, List<String> mediaTypes)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ProtectionSettings.Builder
builder()
Create a new builder.boolean
equals(Object o)
List<ProtectionSettings.AllowedHttpMethods>
getAllowedHttpMethods()
The list of allowed HTTP methods.ProtectionSettings.BlockAction
getBlockAction()
If action is set to BLOCK, this specifies how the traffic is blocked when detected as malicious by a protection rule.String
getBlockErrorPageCode()
The error code to show on the error page when action is set to BLOCK, blockAction is set to SHOW_ERROR_PAGE, and the traffic is detected as malicious by a protection rule.String
getBlockErrorPageDescription()
The description text to show on the error page when action is set to BLOCK, blockAction is set to SHOW_ERROR_PAGE, and the traffic is detected as malicious by a protection rule.String
getBlockErrorPageMessage()
The message to show on the error page when action is set to BLOCK, blockAction is set to SHOW_ERROR_PAGE, and the traffic is detected as malicious by a protection rule.Integer
getBlockResponseCode()
The response code returned when action is set to BLOCK, blockAction is set to SET_RESPONSE_CODE, and the traffic is detected as malicious by a protection rule.Boolean
getIsResponseInspected()
Inspects the response body of origin responses.Integer
getMaxArgumentCount()
The maximum number of arguments allowed to be passed to your application before an action is taken.Integer
getMaxNameLengthPerArgument()
The maximum length allowed for each argument name, in characters.Integer
getMaxResponseSizeInKiB()
The maximum response size to be fully inspected, in binary kilobytes (KiB).Integer
getMaxTotalNameLengthOfArguments()
The maximum length allowed for the sum of the argument name and value, in characters.List<String>
getMediaTypes()
The list of media types to allow for inspection, if isResponseInspected is enabled.Integer
getRecommendationsPeriodInDays()
The length of time to analyze traffic traffic, in days.int
hashCode()
ProtectionSettings.Builder
toBuilder()
String
toString()
String
toString(boolean includeByteArrayContents)
Return a string representation of the object.
-
-
-
Constructor Detail
-
ProtectionSettings
@Deprecated @ConstructorProperties({"blockAction","blockResponseCode","blockErrorPageMessage","blockErrorPageCode","blockErrorPageDescription","maxArgumentCount","maxNameLengthPerArgument","maxTotalNameLengthOfArguments","recommendationsPeriodInDays","isResponseInspected","maxResponseSizeInKiB","allowedHttpMethods","mediaTypes"}) public ProtectionSettings(ProtectionSettings.BlockAction blockAction, Integer blockResponseCode, String blockErrorPageMessage, String blockErrorPageCode, String blockErrorPageDescription, Integer maxArgumentCount, Integer maxNameLengthPerArgument, Integer maxTotalNameLengthOfArguments, Integer recommendationsPeriodInDays, Boolean isResponseInspected, Integer maxResponseSizeInKiB, List<ProtectionSettings.AllowedHttpMethods> allowedHttpMethods, List<String> mediaTypes)
Deprecated.
-
-
Method Detail
-
builder
public static ProtectionSettings.Builder builder()
Create a new builder.
-
toBuilder
public ProtectionSettings.Builder toBuilder()
-
getBlockAction
public ProtectionSettings.BlockAction getBlockAction()
If action is set to BLOCK, this specifies how the traffic is blocked when detected as malicious by a protection rule.If unspecified, defaults to SET_RESPONSE_CODE.
- Returns:
- the value
-
getBlockResponseCode
public Integer getBlockResponseCode()
The response code returned when action is set to BLOCK, blockAction is set to SET_RESPONSE_CODE, and the traffic is detected as malicious by a protection rule.If unspecified, defaults to 403. The list of available response codes: 400, 401, 403, 405, 409, 411, 412, 413, 414, 415, 416, 500, 501, 502, 503, 504, 507.
- Returns:
- the value
-
getBlockErrorPageMessage
public String getBlockErrorPageMessage()
The message to show on the error page when action is set to BLOCK, blockAction is set to SHOW_ERROR_PAGE, and the traffic is detected as malicious by a protection rule.If unspecified, defaults to ‘Access to the website is blocked.’
- Returns:
- the value
-
getBlockErrorPageCode
public String getBlockErrorPageCode()
The error code to show on the error page when action is set to BLOCK, blockAction is set to SHOW_ERROR_PAGE, and the traffic is detected as malicious by a protection rule.If unspecified, defaults to 403.
- Returns:
- the value
-
getBlockErrorPageDescription
public String getBlockErrorPageDescription()
The description text to show on the error page when action is set to BLOCK, blockAction is set to SHOW_ERROR_PAGE, and the traffic is detected as malicious by a protection rule.If unspecified, defaults to Access blocked by website owner. Please contact support.
- Returns:
- the value
-
getMaxArgumentCount
public Integer getMaxArgumentCount()
The maximum number of arguments allowed to be passed to your application before an action is taken.Arguements are query parameters or body parameters in a PUT or POST request. If unspecified, defaults to 255. This setting only applies if a corresponding protection rule is enabled, such as the “Number of Arguments Limits” rule (key: 960335).
Example: If maxArgumentCount to 2 for the Max Number of Arguments protection rule (key: 960335), the following requests would be blocked: GET /myapp/path?query=one&query=two&query=three POST /myapp/path with Body {"argument1":"one","argument2":"two","argument3":"three"}
- Returns:
- the value
-
getMaxNameLengthPerArgument
public Integer getMaxNameLengthPerArgument()
The maximum length allowed for each argument name, in characters.Arguements are query parameters or body parameters in a PUT or POST request. If unspecified, defaults to 400. This setting only applies if a corresponding protection rule is enabled, such as the “Values Limits” rule (key: 960208).
- Returns:
- the value
-
getMaxTotalNameLengthOfArguments
public Integer getMaxTotalNameLengthOfArguments()
The maximum length allowed for the sum of the argument name and value, in characters.Arguements are query parameters or body parameters in a PUT or POST request. If unspecified, defaults to 64000. This setting only applies if a corresponding protection rule is enabled, such as the “Total Arguments Limits” rule (key: 960341).
- Returns:
- the value
-
getRecommendationsPeriodInDays
public Integer getRecommendationsPeriodInDays()
The length of time to analyze traffic traffic, in days.After the analysis period, WafRecommendations will be populated. If unspecified, defaults to 10.
Use GET /waasPolicies/{waasPolicyId}/wafRecommendations to view WAF recommendations.
- Returns:
- the value
-
getIsResponseInspected
public Boolean getIsResponseInspected()
Inspects the response body of origin responses.Can be used to detect leakage of sensitive data. If unspecified, defaults to false.
*Note:** Only origin responses with a Content-Type matching a value in mediaTypes will be inspected.
- Returns:
- the value
-
getMaxResponseSizeInKiB
public Integer getMaxResponseSizeInKiB()
The maximum response size to be fully inspected, in binary kilobytes (KiB).Anything over this limit will be partially inspected. If unspecified, defaults to 1024.
- Returns:
- the value
-
getAllowedHttpMethods
public List<ProtectionSettings.AllowedHttpMethods> getAllowedHttpMethods()
The list of allowed HTTP methods.If unspecified, default to [OPTIONS, GET, HEAD, POST]. This setting only applies if a corresponding protection rule is enabled, such as the “Restrict HTTP Request Methods” rule (key: 911100).
- Returns:
- the value
-
getMediaTypes
public List<String> getMediaTypes()
The list of media types to allow for inspection, if isResponseInspected is enabled.Only responses with MIME types in this list will be inspected. If unspecified, defaults to [“text/html”, “text/plain”, “text/xml”].
Supported MIME types include:
- text/html - text/plain - text/asp - text/css - text/x-script - application/json - text/webviewhtml - text/x-java-source - application/x-javascript - application/javascript - application/ecmascript - text/javascript - text/ecmascript - text/x-script.perl - text/x-script.phyton - application/plain - application/xml - text/xml
- Returns:
- the value
-
toString
public String toString()
- Overrides:
toString
in classcom.oracle.bmc.http.client.internal.ExplicitlySetBmcModel
-
toString
public String toString(boolean includeByteArrayContents)
Return a string representation of the object.- Parameters:
includeByteArrayContents
- true to include the full contents of byte arrays- Returns:
- string representation
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classcom.oracle.bmc.http.client.internal.ExplicitlySetBmcModel
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classcom.oracle.bmc.http.client.internal.ExplicitlySetBmcModel
-
-