com.amazonaws.services.wafv2.model.JA3Fingerprint Maven / Gradle / Ivy
Show all versions of aws-java-sdk-wafv2 Show documentation
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.wafv2.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Available for use with Amazon CloudFront distributions and Application Load Balancers. Match against the request's
* JA3 fingerprint. The JA3 fingerprint is a 32-character hash derived from the TLS Client Hello of an incoming request.
* This fingerprint serves as a unique identifier for the client's TLS configuration. WAF calculates and logs this
* fingerprint for each request that has enough TLS Client Hello information for the calculation. Almost all web
* requests include this information.
*
*
*
* You can use this choice only with a string match ByteMatchStatement
with the
* PositionalConstraint
set to EXACTLY
.
*
*
*
* You can obtain the JA3 fingerprint for client requests from the web ACL logs. If WAF is able to calculate the
* fingerprint, it includes it in the logs. For information about the logging fields, see Log fields in the WAF
* Developer Guide.
*
*
* Provide the JA3 fingerprint string from the logs in your string match statement specification, to match with any
* future requests that have the same TLS configuration.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class JA3Fingerprint implements Serializable, Cloneable, StructuredPojo {
/**
*
* The match status to assign to the web request if the request doesn't have a JA3 fingerprint.
*
*
* 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.
*
*
*
*/
private String fallbackBehavior;
/**
*
* The match status to assign to the web request if the request doesn't have a JA3 fingerprint.
*
*
* 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.
*
*
*
*
* @param fallbackBehavior
* The match status to assign to the web request if the request doesn't have a JA3 fingerprint.
*
* 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.
*
*
* @see FallbackBehavior
*/
public void setFallbackBehavior(String fallbackBehavior) {
this.fallbackBehavior = fallbackBehavior;
}
/**
*
* The match status to assign to the web request if the request doesn't have a JA3 fingerprint.
*
*
* 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.
*
*
*
*
* @return The match status to assign to the web request if the request doesn't have a JA3 fingerprint.
*
* 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.
*
*
* @see FallbackBehavior
*/
public String getFallbackBehavior() {
return this.fallbackBehavior;
}
/**
*
* The match status to assign to the web request if the request doesn't have a JA3 fingerprint.
*
*
* 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.
*
*
*
*
* @param fallbackBehavior
* The match status to assign to the web request if the request doesn't have a JA3 fingerprint.
*
* 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.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see FallbackBehavior
*/
public JA3Fingerprint withFallbackBehavior(String fallbackBehavior) {
setFallbackBehavior(fallbackBehavior);
return this;
}
/**
*
* The match status to assign to the web request if the request doesn't have a JA3 fingerprint.
*
*
* 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.
*
*
*
*
* @param fallbackBehavior
* The match status to assign to the web request if the request doesn't have a JA3 fingerprint.
*
* 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.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see FallbackBehavior
*/
public JA3Fingerprint withFallbackBehavior(FallbackBehavior fallbackBehavior) {
this.fallbackBehavior = fallbackBehavior.toString();
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getFallbackBehavior() != null)
sb.append("FallbackBehavior: ").append(getFallbackBehavior());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof JA3Fingerprint == false)
return false;
JA3Fingerprint other = (JA3Fingerprint) obj;
if (other.getFallbackBehavior() == null ^ this.getFallbackBehavior() == null)
return false;
if (other.getFallbackBehavior() != null && other.getFallbackBehavior().equals(this.getFallbackBehavior()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getFallbackBehavior() == null) ? 0 : getFallbackBehavior().hashCode());
return hashCode;
}
@Override
public JA3Fingerprint clone() {
try {
return (JA3Fingerprint) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.wafv2.model.transform.JA3FingerprintMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}