com.amazonaws.services.securityhub.model.Compliance Maven / Gradle / Ivy
Show all versions of aws-java-sdk-securityhub 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.securityhub.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Contains finding details that are specific to control-based findings. Only returned for findings generated from
* controls.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Compliance implements Serializable, Cloneable, StructuredPojo {
/**
*
* The result of a standards check.
*
*
* The valid values for Status
are as follows.
*
*
* -
*
* -
*
* PASSED
- Standards check passed for all evaluated resources.
*
*
* -
*
* WARNING
- Some information is missing or this check is not supported for your configuration.
*
*
* -
*
* FAILED
- Standards check failed for at least one evaluated resource.
*
*
* -
*
* NOT_AVAILABLE
- Check could not be performed due to a service outage, API error, or because the
* result of the Config evaluation was NOT_APPLICABLE
. If the Config evaluation result was
* NOT_APPLICABLE
, then after 3 days, Security Hub automatically archives the finding.
*
*
*
*
*
*/
private String status;
/**
*
* For a control, the industry or regulatory framework requirements that are related to the control. The check for
* that control is aligned with these requirements.
*
*/
private java.util.List relatedRequirements;
/**
*
* For findings generated from controls, a list of reasons behind the value of Status
. For the list of
* status reason codes and their meanings, see Standards-related information in the ASFF in the Security Hub User Guide.
*
*/
private java.util.List statusReasons;
/**
*
* The unique identifier of a control across standards. Values for this field typically consist of an Amazon Web
* Service and a number, such as APIGateway.5.
*
*/
private String securityControlId;
/**
*
* The enabled security standards in which a security control is currently enabled.
*
*/
private java.util.List associatedStandards;
/**
*
* An object that includes security control parameter names and values.
*
*/
private java.util.List securityControlParameters;
/**
*
* The result of a standards check.
*
*
* The valid values for Status
are as follows.
*
*
* -
*
* -
*
* PASSED
- Standards check passed for all evaluated resources.
*
*
* -
*
* WARNING
- Some information is missing or this check is not supported for your configuration.
*
*
* -
*
* FAILED
- Standards check failed for at least one evaluated resource.
*
*
* -
*
* NOT_AVAILABLE
- Check could not be performed due to a service outage, API error, or because the
* result of the Config evaluation was NOT_APPLICABLE
. If the Config evaluation result was
* NOT_APPLICABLE
, then after 3 days, Security Hub automatically archives the finding.
*
*
*
*
*
*
* @param status
* The result of a standards check.
*
* The valid values for Status
are as follows.
*
*
* -
*
* -
*
* PASSED
- Standards check passed for all evaluated resources.
*
*
* -
*
* WARNING
- Some information is missing or this check is not supported for your configuration.
*
*
* -
*
* FAILED
- Standards check failed for at least one evaluated resource.
*
*
* -
*
* NOT_AVAILABLE
- Check could not be performed due to a service outage, API error, or because
* the result of the Config evaluation was NOT_APPLICABLE
. If the Config evaluation result was
* NOT_APPLICABLE
, then after 3 days, Security Hub automatically archives the finding.
*
*
*
*
* @see ComplianceStatus
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* The result of a standards check.
*
*
* The valid values for Status
are as follows.
*
*
* -
*
* -
*
* PASSED
- Standards check passed for all evaluated resources.
*
*
* -
*
* WARNING
- Some information is missing or this check is not supported for your configuration.
*
*
* -
*
* FAILED
- Standards check failed for at least one evaluated resource.
*
*
* -
*
* NOT_AVAILABLE
- Check could not be performed due to a service outage, API error, or because the
* result of the Config evaluation was NOT_APPLICABLE
. If the Config evaluation result was
* NOT_APPLICABLE
, then after 3 days, Security Hub automatically archives the finding.
*
*
*
*
*
*
* @return The result of a standards check.
*
* The valid values for Status
are as follows.
*
*
* -
*
* -
*
* PASSED
- Standards check passed for all evaluated resources.
*
*
* -
*
* WARNING
- Some information is missing or this check is not supported for your configuration.
*
*
* -
*
* FAILED
- Standards check failed for at least one evaluated resource.
*
*
* -
*
* NOT_AVAILABLE
- Check could not be performed due to a service outage, API error, or because
* the result of the Config evaluation was NOT_APPLICABLE
. If the Config evaluation result was
* NOT_APPLICABLE
, then after 3 days, Security Hub automatically archives the finding.
*
*
*
*
* @see ComplianceStatus
*/
public String getStatus() {
return this.status;
}
/**
*
* The result of a standards check.
*
*
* The valid values for Status
are as follows.
*
*
* -
*
* -
*
* PASSED
- Standards check passed for all evaluated resources.
*
*
* -
*
* WARNING
- Some information is missing or this check is not supported for your configuration.
*
*
* -
*
* FAILED
- Standards check failed for at least one evaluated resource.
*
*
* -
*
* NOT_AVAILABLE
- Check could not be performed due to a service outage, API error, or because the
* result of the Config evaluation was NOT_APPLICABLE
. If the Config evaluation result was
* NOT_APPLICABLE
, then after 3 days, Security Hub automatically archives the finding.
*
*
*
*
*
*
* @param status
* The result of a standards check.
*
* The valid values for Status
are as follows.
*
*
* -
*
* -
*
* PASSED
- Standards check passed for all evaluated resources.
*
*
* -
*
* WARNING
- Some information is missing or this check is not supported for your configuration.
*
*
* -
*
* FAILED
- Standards check failed for at least one evaluated resource.
*
*
* -
*
* NOT_AVAILABLE
- Check could not be performed due to a service outage, API error, or because
* the result of the Config evaluation was NOT_APPLICABLE
. If the Config evaluation result was
* NOT_APPLICABLE
, then after 3 days, Security Hub automatically archives the finding.
*
*
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see ComplianceStatus
*/
public Compliance withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* The result of a standards check.
*
*
* The valid values for Status
are as follows.
*
*
* -
*
* -
*
* PASSED
- Standards check passed for all evaluated resources.
*
*
* -
*
* WARNING
- Some information is missing or this check is not supported for your configuration.
*
*
* -
*
* FAILED
- Standards check failed for at least one evaluated resource.
*
*
* -
*
* NOT_AVAILABLE
- Check could not be performed due to a service outage, API error, or because the
* result of the Config evaluation was NOT_APPLICABLE
. If the Config evaluation result was
* NOT_APPLICABLE
, then after 3 days, Security Hub automatically archives the finding.
*
*
*
*
*
*
* @param status
* The result of a standards check.
*
* The valid values for Status
are as follows.
*
*
* -
*
* -
*
* PASSED
- Standards check passed for all evaluated resources.
*
*
* -
*
* WARNING
- Some information is missing or this check is not supported for your configuration.
*
*
* -
*
* FAILED
- Standards check failed for at least one evaluated resource.
*
*
* -
*
* NOT_AVAILABLE
- Check could not be performed due to a service outage, API error, or because
* the result of the Config evaluation was NOT_APPLICABLE
. If the Config evaluation result was
* NOT_APPLICABLE
, then after 3 days, Security Hub automatically archives the finding.
*
*
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see ComplianceStatus
*/
public Compliance withStatus(ComplianceStatus status) {
this.status = status.toString();
return this;
}
/**
*
* For a control, the industry or regulatory framework requirements that are related to the control. The check for
* that control is aligned with these requirements.
*
*
* @return For a control, the industry or regulatory framework requirements that are related to the control. The
* check for that control is aligned with these requirements.
*/
public java.util.List getRelatedRequirements() {
return relatedRequirements;
}
/**
*
* For a control, the industry or regulatory framework requirements that are related to the control. The check for
* that control is aligned with these requirements.
*
*
* @param relatedRequirements
* For a control, the industry or regulatory framework requirements that are related to the control. The
* check for that control is aligned with these requirements.
*/
public void setRelatedRequirements(java.util.Collection relatedRequirements) {
if (relatedRequirements == null) {
this.relatedRequirements = null;
return;
}
this.relatedRequirements = new java.util.ArrayList(relatedRequirements);
}
/**
*
* For a control, the industry or regulatory framework requirements that are related to the control. The check for
* that control is aligned with these requirements.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setRelatedRequirements(java.util.Collection)} or {@link #withRelatedRequirements(java.util.Collection)}
* if you want to override the existing values.
*
*
* @param relatedRequirements
* For a control, the industry or regulatory framework requirements that are related to the control. The
* check for that control is aligned with these requirements.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Compliance withRelatedRequirements(String... relatedRequirements) {
if (this.relatedRequirements == null) {
setRelatedRequirements(new java.util.ArrayList(relatedRequirements.length));
}
for (String ele : relatedRequirements) {
this.relatedRequirements.add(ele);
}
return this;
}
/**
*
* For a control, the industry or regulatory framework requirements that are related to the control. The check for
* that control is aligned with these requirements.
*
*
* @param relatedRequirements
* For a control, the industry or regulatory framework requirements that are related to the control. The
* check for that control is aligned with these requirements.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Compliance withRelatedRequirements(java.util.Collection relatedRequirements) {
setRelatedRequirements(relatedRequirements);
return this;
}
/**
*
* For findings generated from controls, a list of reasons behind the value of Status
. For the list of
* status reason codes and their meanings, see Standards-related information in the ASFF in the Security Hub User Guide.
*
*
* @return For findings generated from controls, a list of reasons behind the value of Status
. For the
* list of status reason codes and their meanings, see Standards-related information in the ASFF in the Security Hub User Guide.
*/
public java.util.List getStatusReasons() {
return statusReasons;
}
/**
*
* For findings generated from controls, a list of reasons behind the value of Status
. For the list of
* status reason codes and their meanings, see Standards-related information in the ASFF in the Security Hub User Guide.
*
*
* @param statusReasons
* For findings generated from controls, a list of reasons behind the value of Status
. For the
* list of status reason codes and their meanings, see Standards-related information in the ASFF in the Security Hub User Guide.
*/
public void setStatusReasons(java.util.Collection statusReasons) {
if (statusReasons == null) {
this.statusReasons = null;
return;
}
this.statusReasons = new java.util.ArrayList(statusReasons);
}
/**
*
* For findings generated from controls, a list of reasons behind the value of Status
. For the list of
* status reason codes and their meanings, see Standards-related information in the ASFF in the Security Hub User Guide.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setStatusReasons(java.util.Collection)} or {@link #withStatusReasons(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param statusReasons
* For findings generated from controls, a list of reasons behind the value of Status
. For the
* list of status reason codes and their meanings, see Standards-related information in the ASFF in the Security Hub User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Compliance withStatusReasons(StatusReason... statusReasons) {
if (this.statusReasons == null) {
setStatusReasons(new java.util.ArrayList(statusReasons.length));
}
for (StatusReason ele : statusReasons) {
this.statusReasons.add(ele);
}
return this;
}
/**
*
* For findings generated from controls, a list of reasons behind the value of Status
. For the list of
* status reason codes and their meanings, see Standards-related information in the ASFF in the Security Hub User Guide.
*
*
* @param statusReasons
* For findings generated from controls, a list of reasons behind the value of Status
. For the
* list of status reason codes and their meanings, see Standards-related information in the ASFF in the Security Hub User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Compliance withStatusReasons(java.util.Collection statusReasons) {
setStatusReasons(statusReasons);
return this;
}
/**
*
* The unique identifier of a control across standards. Values for this field typically consist of an Amazon Web
* Service and a number, such as APIGateway.5.
*
*
* @param securityControlId
* The unique identifier of a control across standards. Values for this field typically consist of an Amazon
* Web Service and a number, such as APIGateway.5.
*/
public void setSecurityControlId(String securityControlId) {
this.securityControlId = securityControlId;
}
/**
*
* The unique identifier of a control across standards. Values for this field typically consist of an Amazon Web
* Service and a number, such as APIGateway.5.
*
*
* @return The unique identifier of a control across standards. Values for this field typically consist of an Amazon
* Web Service and a number, such as APIGateway.5.
*/
public String getSecurityControlId() {
return this.securityControlId;
}
/**
*
* The unique identifier of a control across standards. Values for this field typically consist of an Amazon Web
* Service and a number, such as APIGateway.5.
*
*
* @param securityControlId
* The unique identifier of a control across standards. Values for this field typically consist of an Amazon
* Web Service and a number, such as APIGateway.5.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Compliance withSecurityControlId(String securityControlId) {
setSecurityControlId(securityControlId);
return this;
}
/**
*
* The enabled security standards in which a security control is currently enabled.
*
*
* @return The enabled security standards in which a security control is currently enabled.
*/
public java.util.List getAssociatedStandards() {
return associatedStandards;
}
/**
*
* The enabled security standards in which a security control is currently enabled.
*
*
* @param associatedStandards
* The enabled security standards in which a security control is currently enabled.
*/
public void setAssociatedStandards(java.util.Collection associatedStandards) {
if (associatedStandards == null) {
this.associatedStandards = null;
return;
}
this.associatedStandards = new java.util.ArrayList(associatedStandards);
}
/**
*
* The enabled security standards in which a security control is currently enabled.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setAssociatedStandards(java.util.Collection)} or {@link #withAssociatedStandards(java.util.Collection)}
* if you want to override the existing values.
*
*
* @param associatedStandards
* The enabled security standards in which a security control is currently enabled.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Compliance withAssociatedStandards(AssociatedStandard... associatedStandards) {
if (this.associatedStandards == null) {
setAssociatedStandards(new java.util.ArrayList(associatedStandards.length));
}
for (AssociatedStandard ele : associatedStandards) {
this.associatedStandards.add(ele);
}
return this;
}
/**
*
* The enabled security standards in which a security control is currently enabled.
*
*
* @param associatedStandards
* The enabled security standards in which a security control is currently enabled.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Compliance withAssociatedStandards(java.util.Collection associatedStandards) {
setAssociatedStandards(associatedStandards);
return this;
}
/**
*
* An object that includes security control parameter names and values.
*
*
* @return An object that includes security control parameter names and values.
*/
public java.util.List getSecurityControlParameters() {
return securityControlParameters;
}
/**
*
* An object that includes security control parameter names and values.
*
*
* @param securityControlParameters
* An object that includes security control parameter names and values.
*/
public void setSecurityControlParameters(java.util.Collection securityControlParameters) {
if (securityControlParameters == null) {
this.securityControlParameters = null;
return;
}
this.securityControlParameters = new java.util.ArrayList(securityControlParameters);
}
/**
*
* An object that includes security control parameter names and values.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setSecurityControlParameters(java.util.Collection)} or
* {@link #withSecurityControlParameters(java.util.Collection)} if you want to override the existing values.
*
*
* @param securityControlParameters
* An object that includes security control parameter names and values.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Compliance withSecurityControlParameters(SecurityControlParameter... securityControlParameters) {
if (this.securityControlParameters == null) {
setSecurityControlParameters(new java.util.ArrayList(securityControlParameters.length));
}
for (SecurityControlParameter ele : securityControlParameters) {
this.securityControlParameters.add(ele);
}
return this;
}
/**
*
* An object that includes security control parameter names and values.
*
*
* @param securityControlParameters
* An object that includes security control parameter names and values.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Compliance withSecurityControlParameters(java.util.Collection securityControlParameters) {
setSecurityControlParameters(securityControlParameters);
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 (getStatus() != null)
sb.append("Status: ").append(getStatus()).append(",");
if (getRelatedRequirements() != null)
sb.append("RelatedRequirements: ").append(getRelatedRequirements()).append(",");
if (getStatusReasons() != null)
sb.append("StatusReasons: ").append(getStatusReasons()).append(",");
if (getSecurityControlId() != null)
sb.append("SecurityControlId: ").append(getSecurityControlId()).append(",");
if (getAssociatedStandards() != null)
sb.append("AssociatedStandards: ").append(getAssociatedStandards()).append(",");
if (getSecurityControlParameters() != null)
sb.append("SecurityControlParameters: ").append(getSecurityControlParameters());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Compliance == false)
return false;
Compliance other = (Compliance) obj;
if (other.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
return false;
if (other.getRelatedRequirements() == null ^ this.getRelatedRequirements() == null)
return false;
if (other.getRelatedRequirements() != null && other.getRelatedRequirements().equals(this.getRelatedRequirements()) == false)
return false;
if (other.getStatusReasons() == null ^ this.getStatusReasons() == null)
return false;
if (other.getStatusReasons() != null && other.getStatusReasons().equals(this.getStatusReasons()) == false)
return false;
if (other.getSecurityControlId() == null ^ this.getSecurityControlId() == null)
return false;
if (other.getSecurityControlId() != null && other.getSecurityControlId().equals(this.getSecurityControlId()) == false)
return false;
if (other.getAssociatedStandards() == null ^ this.getAssociatedStandards() == null)
return false;
if (other.getAssociatedStandards() != null && other.getAssociatedStandards().equals(this.getAssociatedStandards()) == false)
return false;
if (other.getSecurityControlParameters() == null ^ this.getSecurityControlParameters() == null)
return false;
if (other.getSecurityControlParameters() != null && other.getSecurityControlParameters().equals(this.getSecurityControlParameters()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime * hashCode + ((getRelatedRequirements() == null) ? 0 : getRelatedRequirements().hashCode());
hashCode = prime * hashCode + ((getStatusReasons() == null) ? 0 : getStatusReasons().hashCode());
hashCode = prime * hashCode + ((getSecurityControlId() == null) ? 0 : getSecurityControlId().hashCode());
hashCode = prime * hashCode + ((getAssociatedStandards() == null) ? 0 : getAssociatedStandards().hashCode());
hashCode = prime * hashCode + ((getSecurityControlParameters() == null) ? 0 : getSecurityControlParameters().hashCode());
return hashCode;
}
@Override
public Compliance clone() {
try {
return (Compliance) 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.securityhub.model.transform.ComplianceMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}