com.amazonaws.services.securityhub.model.SecurityControl 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;
/**
*
* A security control in Security Hub describes a security best practice related to a specific resource.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class SecurityControl implements Serializable, Cloneable, StructuredPojo {
/**
*
* The unique identifier of a security control across standards. Values for this field typically consist of an
* Amazon Web Service name and a number, such as APIGateway.3.
*
*/
private String securityControlId;
/**
*
* The Amazon Resource Name (ARN) for a security control across standards, such as
* arn:aws:securityhub:eu-central-1:123456789012:security-control/S3.1
. This parameter doesn't mention
* a specific standard.
*
*/
private String securityControlArn;
/**
*
* The title of a security control.
*
*/
private String title;
/**
*
* The description of a security control across standards. This typically summarizes how Security Hub evaluates the
* control and the conditions under which it produces a failed finding. This parameter doesn't reference a specific
* standard.
*
*/
private String description;
/**
*
* A link to Security Hub documentation that explains how to remediate a failed finding for a security control.
*
*/
private String remediationUrl;
/**
*
* The severity of a security control. For more information about how Security Hub determines control severity, see
* Assigning severity to control findings in the Security Hub User Guide.
*
*/
private String severityRating;
/**
*
* The enablement status of a security control in a specific standard.
*
*/
private String securityControlStatus;
/**
*
* Identifies whether customizable properties of a security control are reflected in Security Hub findings. A status
* of READY
indicates findings include the current parameter values. A status of UPDATING
* indicates that all findings may not include the current parameter values.
*
*/
private String updateStatus;
/**
*
* An object that identifies the name of a control parameter, its current value, and whether it has been customized.
*
*/
private java.util.Map parameters;
/**
*
* The most recent reason for updating the customizable properties of a security control. This differs from the
* UpdateReason
field of the
* BatchUpdateStandardsControlAssociations
API, which tracks the reason for updating the
* enablement status of a control. This field accepts alphanumeric characters in addition to white spaces, dashes,
* and underscores.
*
*/
private String lastUpdateReason;
/**
*
* The unique identifier of a security control across standards. Values for this field typically consist of an
* Amazon Web Service name and a number, such as APIGateway.3.
*
*
* @param securityControlId
* The unique identifier of a security control across standards. Values for this field typically consist of
* an Amazon Web Service name and a number, such as APIGateway.3.
*/
public void setSecurityControlId(String securityControlId) {
this.securityControlId = securityControlId;
}
/**
*
* The unique identifier of a security control across standards. Values for this field typically consist of an
* Amazon Web Service name and a number, such as APIGateway.3.
*
*
* @return The unique identifier of a security control across standards. Values for this field typically consist of
* an Amazon Web Service name and a number, such as APIGateway.3.
*/
public String getSecurityControlId() {
return this.securityControlId;
}
/**
*
* The unique identifier of a security control across standards. Values for this field typically consist of an
* Amazon Web Service name and a number, such as APIGateway.3.
*
*
* @param securityControlId
* The unique identifier of a security control across standards. Values for this field typically consist of
* an Amazon Web Service name and a number, such as APIGateway.3.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SecurityControl withSecurityControlId(String securityControlId) {
setSecurityControlId(securityControlId);
return this;
}
/**
*
* The Amazon Resource Name (ARN) for a security control across standards, such as
* arn:aws:securityhub:eu-central-1:123456789012:security-control/S3.1
. This parameter doesn't mention
* a specific standard.
*
*
* @param securityControlArn
* The Amazon Resource Name (ARN) for a security control across standards, such as
* arn:aws:securityhub:eu-central-1:123456789012:security-control/S3.1
. This parameter doesn't
* mention a specific standard.
*/
public void setSecurityControlArn(String securityControlArn) {
this.securityControlArn = securityControlArn;
}
/**
*
* The Amazon Resource Name (ARN) for a security control across standards, such as
* arn:aws:securityhub:eu-central-1:123456789012:security-control/S3.1
. This parameter doesn't mention
* a specific standard.
*
*
* @return The Amazon Resource Name (ARN) for a security control across standards, such as
* arn:aws:securityhub:eu-central-1:123456789012:security-control/S3.1
. This parameter doesn't
* mention a specific standard.
*/
public String getSecurityControlArn() {
return this.securityControlArn;
}
/**
*
* The Amazon Resource Name (ARN) for a security control across standards, such as
* arn:aws:securityhub:eu-central-1:123456789012:security-control/S3.1
. This parameter doesn't mention
* a specific standard.
*
*
* @param securityControlArn
* The Amazon Resource Name (ARN) for a security control across standards, such as
* arn:aws:securityhub:eu-central-1:123456789012:security-control/S3.1
. This parameter doesn't
* mention a specific standard.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SecurityControl withSecurityControlArn(String securityControlArn) {
setSecurityControlArn(securityControlArn);
return this;
}
/**
*
* The title of a security control.
*
*
* @param title
* The title of a security control.
*/
public void setTitle(String title) {
this.title = title;
}
/**
*
* The title of a security control.
*
*
* @return The title of a security control.
*/
public String getTitle() {
return this.title;
}
/**
*
* The title of a security control.
*
*
* @param title
* The title of a security control.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SecurityControl withTitle(String title) {
setTitle(title);
return this;
}
/**
*
* The description of a security control across standards. This typically summarizes how Security Hub evaluates the
* control and the conditions under which it produces a failed finding. This parameter doesn't reference a specific
* standard.
*
*
* @param description
* The description of a security control across standards. This typically summarizes how Security Hub
* evaluates the control and the conditions under which it produces a failed finding. This parameter doesn't
* reference a specific standard.
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* The description of a security control across standards. This typically summarizes how Security Hub evaluates the
* control and the conditions under which it produces a failed finding. This parameter doesn't reference a specific
* standard.
*
*
* @return The description of a security control across standards. This typically summarizes how Security Hub
* evaluates the control and the conditions under which it produces a failed finding. This parameter doesn't
* reference a specific standard.
*/
public String getDescription() {
return this.description;
}
/**
*
* The description of a security control across standards. This typically summarizes how Security Hub evaluates the
* control and the conditions under which it produces a failed finding. This parameter doesn't reference a specific
* standard.
*
*
* @param description
* The description of a security control across standards. This typically summarizes how Security Hub
* evaluates the control and the conditions under which it produces a failed finding. This parameter doesn't
* reference a specific standard.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SecurityControl withDescription(String description) {
setDescription(description);
return this;
}
/**
*
* A link to Security Hub documentation that explains how to remediate a failed finding for a security control.
*
*
* @param remediationUrl
* A link to Security Hub documentation that explains how to remediate a failed finding for a security
* control.
*/
public void setRemediationUrl(String remediationUrl) {
this.remediationUrl = remediationUrl;
}
/**
*
* A link to Security Hub documentation that explains how to remediate a failed finding for a security control.
*
*
* @return A link to Security Hub documentation that explains how to remediate a failed finding for a security
* control.
*/
public String getRemediationUrl() {
return this.remediationUrl;
}
/**
*
* A link to Security Hub documentation that explains how to remediate a failed finding for a security control.
*
*
* @param remediationUrl
* A link to Security Hub documentation that explains how to remediate a failed finding for a security
* control.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SecurityControl withRemediationUrl(String remediationUrl) {
setRemediationUrl(remediationUrl);
return this;
}
/**
*
* The severity of a security control. For more information about how Security Hub determines control severity, see
* Assigning severity to control findings in the Security Hub User Guide.
*
*
* @param severityRating
* The severity of a security control. For more information about how Security Hub determines control
* severity, see Assigning severity to control findings in the Security Hub User Guide.
* @see SeverityRating
*/
public void setSeverityRating(String severityRating) {
this.severityRating = severityRating;
}
/**
*
* The severity of a security control. For more information about how Security Hub determines control severity, see
* Assigning severity to control findings in the Security Hub User Guide.
*
*
* @return The severity of a security control. For more information about how Security Hub determines control
* severity, see Assigning severity to control findings in the Security Hub User Guide.
* @see SeverityRating
*/
public String getSeverityRating() {
return this.severityRating;
}
/**
*
* The severity of a security control. For more information about how Security Hub determines control severity, see
* Assigning severity to control findings in the Security Hub User Guide.
*
*
* @param severityRating
* The severity of a security control. For more information about how Security Hub determines control
* severity, see Assigning severity to control findings in the Security Hub User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
* @see SeverityRating
*/
public SecurityControl withSeverityRating(String severityRating) {
setSeverityRating(severityRating);
return this;
}
/**
*
* The severity of a security control. For more information about how Security Hub determines control severity, see
* Assigning severity to control findings in the Security Hub User Guide.
*
*
* @param severityRating
* The severity of a security control. For more information about how Security Hub determines control
* severity, see Assigning severity to control findings in the Security Hub User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
* @see SeverityRating
*/
public SecurityControl withSeverityRating(SeverityRating severityRating) {
this.severityRating = severityRating.toString();
return this;
}
/**
*
* The enablement status of a security control in a specific standard.
*
*
* @param securityControlStatus
* The enablement status of a security control in a specific standard.
* @see ControlStatus
*/
public void setSecurityControlStatus(String securityControlStatus) {
this.securityControlStatus = securityControlStatus;
}
/**
*
* The enablement status of a security control in a specific standard.
*
*
* @return The enablement status of a security control in a specific standard.
* @see ControlStatus
*/
public String getSecurityControlStatus() {
return this.securityControlStatus;
}
/**
*
* The enablement status of a security control in a specific standard.
*
*
* @param securityControlStatus
* The enablement status of a security control in a specific standard.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ControlStatus
*/
public SecurityControl withSecurityControlStatus(String securityControlStatus) {
setSecurityControlStatus(securityControlStatus);
return this;
}
/**
*
* The enablement status of a security control in a specific standard.
*
*
* @param securityControlStatus
* The enablement status of a security control in a specific standard.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ControlStatus
*/
public SecurityControl withSecurityControlStatus(ControlStatus securityControlStatus) {
this.securityControlStatus = securityControlStatus.toString();
return this;
}
/**
*
* Identifies whether customizable properties of a security control are reflected in Security Hub findings. A status
* of READY
indicates findings include the current parameter values. A status of UPDATING
* indicates that all findings may not include the current parameter values.
*
*
* @param updateStatus
* Identifies whether customizable properties of a security control are reflected in Security Hub findings. A
* status of READY
indicates findings include the current parameter values. A status of
* UPDATING
indicates that all findings may not include the current parameter values.
* @see UpdateStatus
*/
public void setUpdateStatus(String updateStatus) {
this.updateStatus = updateStatus;
}
/**
*
* Identifies whether customizable properties of a security control are reflected in Security Hub findings. A status
* of READY
indicates findings include the current parameter values. A status of UPDATING
* indicates that all findings may not include the current parameter values.
*
*
* @return Identifies whether customizable properties of a security control are reflected in Security Hub findings.
* A status of READY
indicates findings include the current parameter values. A status of
* UPDATING
indicates that all findings may not include the current parameter values.
* @see UpdateStatus
*/
public String getUpdateStatus() {
return this.updateStatus;
}
/**
*
* Identifies whether customizable properties of a security control are reflected in Security Hub findings. A status
* of READY
indicates findings include the current parameter values. A status of UPDATING
* indicates that all findings may not include the current parameter values.
*
*
* @param updateStatus
* Identifies whether customizable properties of a security control are reflected in Security Hub findings. A
* status of READY
indicates findings include the current parameter values. A status of
* UPDATING
indicates that all findings may not include the current parameter values.
* @return Returns a reference to this object so that method calls can be chained together.
* @see UpdateStatus
*/
public SecurityControl withUpdateStatus(String updateStatus) {
setUpdateStatus(updateStatus);
return this;
}
/**
*
* Identifies whether customizable properties of a security control are reflected in Security Hub findings. A status
* of READY
indicates findings include the current parameter values. A status of UPDATING
* indicates that all findings may not include the current parameter values.
*
*
* @param updateStatus
* Identifies whether customizable properties of a security control are reflected in Security Hub findings. A
* status of READY
indicates findings include the current parameter values. A status of
* UPDATING
indicates that all findings may not include the current parameter values.
* @return Returns a reference to this object so that method calls can be chained together.
* @see UpdateStatus
*/
public SecurityControl withUpdateStatus(UpdateStatus updateStatus) {
this.updateStatus = updateStatus.toString();
return this;
}
/**
*
* An object that identifies the name of a control parameter, its current value, and whether it has been customized.
*
*
* @return An object that identifies the name of a control parameter, its current value, and whether it has been
* customized.
*/
public java.util.Map getParameters() {
return parameters;
}
/**
*
* An object that identifies the name of a control parameter, its current value, and whether it has been customized.
*
*
* @param parameters
* An object that identifies the name of a control parameter, its current value, and whether it has been
* customized.
*/
public void setParameters(java.util.Map parameters) {
this.parameters = parameters;
}
/**
*
* An object that identifies the name of a control parameter, its current value, and whether it has been customized.
*
*
* @param parameters
* An object that identifies the name of a control parameter, its current value, and whether it has been
* customized.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SecurityControl withParameters(java.util.Map parameters) {
setParameters(parameters);
return this;
}
/**
* Add a single Parameters entry
*
* @see SecurityControl#withParameters
* @returns a reference to this object so that method calls can be chained together.
*/
public SecurityControl addParametersEntry(String key, ParameterConfiguration value) {
if (null == this.parameters) {
this.parameters = new java.util.HashMap();
}
if (this.parameters.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.parameters.put(key, value);
return this;
}
/**
* Removes all the entries added into Parameters.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SecurityControl clearParametersEntries() {
this.parameters = null;
return this;
}
/**
*
* The most recent reason for updating the customizable properties of a security control. This differs from the
* UpdateReason
field of the
* BatchUpdateStandardsControlAssociations
API, which tracks the reason for updating the
* enablement status of a control. This field accepts alphanumeric characters in addition to white spaces, dashes,
* and underscores.
*
*
* @param lastUpdateReason
* The most recent reason for updating the customizable properties of a security control. This differs from
* the UpdateReason
field of the BatchUpdateStandardsControlAssociations
API, which tracks the reason for updating the
* enablement status of a control. This field accepts alphanumeric characters in addition to white spaces,
* dashes, and underscores.
*/
public void setLastUpdateReason(String lastUpdateReason) {
this.lastUpdateReason = lastUpdateReason;
}
/**
*
* The most recent reason for updating the customizable properties of a security control. This differs from the
* UpdateReason
field of the
* BatchUpdateStandardsControlAssociations
API, which tracks the reason for updating the
* enablement status of a control. This field accepts alphanumeric characters in addition to white spaces, dashes,
* and underscores.
*
*
* @return The most recent reason for updating the customizable properties of a security control. This differs from
* the UpdateReason
field of the BatchUpdateStandardsControlAssociations
API, which tracks the reason for updating the
* enablement status of a control. This field accepts alphanumeric characters in addition to white spaces,
* dashes, and underscores.
*/
public String getLastUpdateReason() {
return this.lastUpdateReason;
}
/**
*
* The most recent reason for updating the customizable properties of a security control. This differs from the
* UpdateReason
field of the
* BatchUpdateStandardsControlAssociations
API, which tracks the reason for updating the
* enablement status of a control. This field accepts alphanumeric characters in addition to white spaces, dashes,
* and underscores.
*
*
* @param lastUpdateReason
* The most recent reason for updating the customizable properties of a security control. This differs from
* the UpdateReason
field of the BatchUpdateStandardsControlAssociations
API, which tracks the reason for updating the
* enablement status of a control. This field accepts alphanumeric characters in addition to white spaces,
* dashes, and underscores.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SecurityControl withLastUpdateReason(String lastUpdateReason) {
setLastUpdateReason(lastUpdateReason);
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 (getSecurityControlId() != null)
sb.append("SecurityControlId: ").append(getSecurityControlId()).append(",");
if (getSecurityControlArn() != null)
sb.append("SecurityControlArn: ").append(getSecurityControlArn()).append(",");
if (getTitle() != null)
sb.append("Title: ").append(getTitle()).append(",");
if (getDescription() != null)
sb.append("Description: ").append(getDescription()).append(",");
if (getRemediationUrl() != null)
sb.append("RemediationUrl: ").append(getRemediationUrl()).append(",");
if (getSeverityRating() != null)
sb.append("SeverityRating: ").append(getSeverityRating()).append(",");
if (getSecurityControlStatus() != null)
sb.append("SecurityControlStatus: ").append(getSecurityControlStatus()).append(",");
if (getUpdateStatus() != null)
sb.append("UpdateStatus: ").append(getUpdateStatus()).append(",");
if (getParameters() != null)
sb.append("Parameters: ").append(getParameters()).append(",");
if (getLastUpdateReason() != null)
sb.append("LastUpdateReason: ").append(getLastUpdateReason());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof SecurityControl == false)
return false;
SecurityControl other = (SecurityControl) obj;
if (other.getSecurityControlId() == null ^ this.getSecurityControlId() == null)
return false;
if (other.getSecurityControlId() != null && other.getSecurityControlId().equals(this.getSecurityControlId()) == false)
return false;
if (other.getSecurityControlArn() == null ^ this.getSecurityControlArn() == null)
return false;
if (other.getSecurityControlArn() != null && other.getSecurityControlArn().equals(this.getSecurityControlArn()) == false)
return false;
if (other.getTitle() == null ^ this.getTitle() == null)
return false;
if (other.getTitle() != null && other.getTitle().equals(this.getTitle()) == false)
return false;
if (other.getDescription() == null ^ this.getDescription() == null)
return false;
if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
return false;
if (other.getRemediationUrl() == null ^ this.getRemediationUrl() == null)
return false;
if (other.getRemediationUrl() != null && other.getRemediationUrl().equals(this.getRemediationUrl()) == false)
return false;
if (other.getSeverityRating() == null ^ this.getSeverityRating() == null)
return false;
if (other.getSeverityRating() != null && other.getSeverityRating().equals(this.getSeverityRating()) == false)
return false;
if (other.getSecurityControlStatus() == null ^ this.getSecurityControlStatus() == null)
return false;
if (other.getSecurityControlStatus() != null && other.getSecurityControlStatus().equals(this.getSecurityControlStatus()) == false)
return false;
if (other.getUpdateStatus() == null ^ this.getUpdateStatus() == null)
return false;
if (other.getUpdateStatus() != null && other.getUpdateStatus().equals(this.getUpdateStatus()) == false)
return false;
if (other.getParameters() == null ^ this.getParameters() == null)
return false;
if (other.getParameters() != null && other.getParameters().equals(this.getParameters()) == false)
return false;
if (other.getLastUpdateReason() == null ^ this.getLastUpdateReason() == null)
return false;
if (other.getLastUpdateReason() != null && other.getLastUpdateReason().equals(this.getLastUpdateReason()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getSecurityControlId() == null) ? 0 : getSecurityControlId().hashCode());
hashCode = prime * hashCode + ((getSecurityControlArn() == null) ? 0 : getSecurityControlArn().hashCode());
hashCode = prime * hashCode + ((getTitle() == null) ? 0 : getTitle().hashCode());
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getRemediationUrl() == null) ? 0 : getRemediationUrl().hashCode());
hashCode = prime * hashCode + ((getSeverityRating() == null) ? 0 : getSeverityRating().hashCode());
hashCode = prime * hashCode + ((getSecurityControlStatus() == null) ? 0 : getSecurityControlStatus().hashCode());
hashCode = prime * hashCode + ((getUpdateStatus() == null) ? 0 : getUpdateStatus().hashCode());
hashCode = prime * hashCode + ((getParameters() == null) ? 0 : getParameters().hashCode());
hashCode = prime * hashCode + ((getLastUpdateReason() == null) ? 0 : getLastUpdateReason().hashCode());
return hashCode;
}
@Override
public SecurityControl clone() {
try {
return (SecurityControl) 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.SecurityControlMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}