All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.securityhub.model.Vulnerability Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS SecurityHub module holds the client classes that are used for communicating with AWS SecurityHub Service

There is a newer version: 1.12.772
Show newest version
/*
 * 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 vulnerability associated with a finding. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class Vulnerability implements Serializable, Cloneable, StructuredPojo { /** *

* The identifier of the vulnerability. *

*/ private String id; /** *

* List of software packages that have the vulnerability. *

*/ private java.util.List vulnerablePackages; /** *

* CVSS scores from the advisory related to the vulnerability. *

*/ private java.util.List cvss; /** *

* List of vulnerabilities that are related to this vulnerability. *

*/ private java.util.List relatedVulnerabilities; /** *

* Information about the vendor that generates the vulnerability report. *

*/ private VulnerabilityVendor vendor; /** *

* A list of URLs that provide additional information about the vulnerability. *

*/ private java.util.List referenceUrls; /** *

* Specifies if all vulnerable packages in a finding have a value for FixedInVersion and * Remediation. This field is evaluated for each vulnerability Id based on the number of * vulnerable packages that have a value for both FixedInVersion and Remediation. Valid * values are as follows: *

*
    *
  • *

    * YES if all vulnerable packages have a value for both FixedInVersion and * Remediation *

    *
  • *
  • *

    * NO if no vulnerable packages have a value for FixedInVersion and * Remediation *

    *
  • *
  • *

    * PARTIAL otherwise *

    *
  • *
*/ private String fixAvailable; /** *

* The Exploit Prediction Scoring System (EPSS) score for a finding. *

*/ private Double epssScore; /** *

* Whether an exploit is available for a finding. *

*/ private String exploitAvailable; /** *

* The vulnerabilities found in your Lambda function code. This field pertains to findings that Security Hub * receives from Amazon Inspector. *

*/ private java.util.List codeVulnerabilities; /** *

* The identifier of the vulnerability. *

* * @param id * The identifier of the vulnerability. */ public void setId(String id) { this.id = id; } /** *

* The identifier of the vulnerability. *

* * @return The identifier of the vulnerability. */ public String getId() { return this.id; } /** *

* The identifier of the vulnerability. *

* * @param id * The identifier of the vulnerability. * @return Returns a reference to this object so that method calls can be chained together. */ public Vulnerability withId(String id) { setId(id); return this; } /** *

* List of software packages that have the vulnerability. *

* * @return List of software packages that have the vulnerability. */ public java.util.List getVulnerablePackages() { return vulnerablePackages; } /** *

* List of software packages that have the vulnerability. *

* * @param vulnerablePackages * List of software packages that have the vulnerability. */ public void setVulnerablePackages(java.util.Collection vulnerablePackages) { if (vulnerablePackages == null) { this.vulnerablePackages = null; return; } this.vulnerablePackages = new java.util.ArrayList(vulnerablePackages); } /** *

* List of software packages that have the vulnerability. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setVulnerablePackages(java.util.Collection)} or {@link #withVulnerablePackages(java.util.Collection)} if * you want to override the existing values. *

* * @param vulnerablePackages * List of software packages that have the vulnerability. * @return Returns a reference to this object so that method calls can be chained together. */ public Vulnerability withVulnerablePackages(SoftwarePackage... vulnerablePackages) { if (this.vulnerablePackages == null) { setVulnerablePackages(new java.util.ArrayList(vulnerablePackages.length)); } for (SoftwarePackage ele : vulnerablePackages) { this.vulnerablePackages.add(ele); } return this; } /** *

* List of software packages that have the vulnerability. *

* * @param vulnerablePackages * List of software packages that have the vulnerability. * @return Returns a reference to this object so that method calls can be chained together. */ public Vulnerability withVulnerablePackages(java.util.Collection vulnerablePackages) { setVulnerablePackages(vulnerablePackages); return this; } /** *

* CVSS scores from the advisory related to the vulnerability. *

* * @return CVSS scores from the advisory related to the vulnerability. */ public java.util.List getCvss() { return cvss; } /** *

* CVSS scores from the advisory related to the vulnerability. *

* * @param cvss * CVSS scores from the advisory related to the vulnerability. */ public void setCvss(java.util.Collection cvss) { if (cvss == null) { this.cvss = null; return; } this.cvss = new java.util.ArrayList(cvss); } /** *

* CVSS scores from the advisory related to the vulnerability. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setCvss(java.util.Collection)} or {@link #withCvss(java.util.Collection)} if you want to override the * existing values. *

* * @param cvss * CVSS scores from the advisory related to the vulnerability. * @return Returns a reference to this object so that method calls can be chained together. */ public Vulnerability withCvss(Cvss... cvss) { if (this.cvss == null) { setCvss(new java.util.ArrayList(cvss.length)); } for (Cvss ele : cvss) { this.cvss.add(ele); } return this; } /** *

* CVSS scores from the advisory related to the vulnerability. *

* * @param cvss * CVSS scores from the advisory related to the vulnerability. * @return Returns a reference to this object so that method calls can be chained together. */ public Vulnerability withCvss(java.util.Collection cvss) { setCvss(cvss); return this; } /** *

* List of vulnerabilities that are related to this vulnerability. *

* * @return List of vulnerabilities that are related to this vulnerability. */ public java.util.List getRelatedVulnerabilities() { return relatedVulnerabilities; } /** *

* List of vulnerabilities that are related to this vulnerability. *

* * @param relatedVulnerabilities * List of vulnerabilities that are related to this vulnerability. */ public void setRelatedVulnerabilities(java.util.Collection relatedVulnerabilities) { if (relatedVulnerabilities == null) { this.relatedVulnerabilities = null; return; } this.relatedVulnerabilities = new java.util.ArrayList(relatedVulnerabilities); } /** *

* List of vulnerabilities that are related to this vulnerability. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setRelatedVulnerabilities(java.util.Collection)} or * {@link #withRelatedVulnerabilities(java.util.Collection)} if you want to override the existing values. *

* * @param relatedVulnerabilities * List of vulnerabilities that are related to this vulnerability. * @return Returns a reference to this object so that method calls can be chained together. */ public Vulnerability withRelatedVulnerabilities(String... relatedVulnerabilities) { if (this.relatedVulnerabilities == null) { setRelatedVulnerabilities(new java.util.ArrayList(relatedVulnerabilities.length)); } for (String ele : relatedVulnerabilities) { this.relatedVulnerabilities.add(ele); } return this; } /** *

* List of vulnerabilities that are related to this vulnerability. *

* * @param relatedVulnerabilities * List of vulnerabilities that are related to this vulnerability. * @return Returns a reference to this object so that method calls can be chained together. */ public Vulnerability withRelatedVulnerabilities(java.util.Collection relatedVulnerabilities) { setRelatedVulnerabilities(relatedVulnerabilities); return this; } /** *

* Information about the vendor that generates the vulnerability report. *

* * @param vendor * Information about the vendor that generates the vulnerability report. */ public void setVendor(VulnerabilityVendor vendor) { this.vendor = vendor; } /** *

* Information about the vendor that generates the vulnerability report. *

* * @return Information about the vendor that generates the vulnerability report. */ public VulnerabilityVendor getVendor() { return this.vendor; } /** *

* Information about the vendor that generates the vulnerability report. *

* * @param vendor * Information about the vendor that generates the vulnerability report. * @return Returns a reference to this object so that method calls can be chained together. */ public Vulnerability withVendor(VulnerabilityVendor vendor) { setVendor(vendor); return this; } /** *

* A list of URLs that provide additional information about the vulnerability. *

* * @return A list of URLs that provide additional information about the vulnerability. */ public java.util.List getReferenceUrls() { return referenceUrls; } /** *

* A list of URLs that provide additional information about the vulnerability. *

* * @param referenceUrls * A list of URLs that provide additional information about the vulnerability. */ public void setReferenceUrls(java.util.Collection referenceUrls) { if (referenceUrls == null) { this.referenceUrls = null; return; } this.referenceUrls = new java.util.ArrayList(referenceUrls); } /** *

* A list of URLs that provide additional information about the vulnerability. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setReferenceUrls(java.util.Collection)} or {@link #withReferenceUrls(java.util.Collection)} if you want * to override the existing values. *

* * @param referenceUrls * A list of URLs that provide additional information about the vulnerability. * @return Returns a reference to this object so that method calls can be chained together. */ public Vulnerability withReferenceUrls(String... referenceUrls) { if (this.referenceUrls == null) { setReferenceUrls(new java.util.ArrayList(referenceUrls.length)); } for (String ele : referenceUrls) { this.referenceUrls.add(ele); } return this; } /** *

* A list of URLs that provide additional information about the vulnerability. *

* * @param referenceUrls * A list of URLs that provide additional information about the vulnerability. * @return Returns a reference to this object so that method calls can be chained together. */ public Vulnerability withReferenceUrls(java.util.Collection referenceUrls) { setReferenceUrls(referenceUrls); return this; } /** *

* Specifies if all vulnerable packages in a finding have a value for FixedInVersion and * Remediation. This field is evaluated for each vulnerability Id based on the number of * vulnerable packages that have a value for both FixedInVersion and Remediation. Valid * values are as follows: *

*
    *
  • *

    * YES if all vulnerable packages have a value for both FixedInVersion and * Remediation *

    *
  • *
  • *

    * NO if no vulnerable packages have a value for FixedInVersion and * Remediation *

    *
  • *
  • *

    * PARTIAL otherwise *

    *
  • *
* * @param fixAvailable * Specifies if all vulnerable packages in a finding have a value for FixedInVersion and * Remediation. This field is evaluated for each vulnerability Id based on the * number of vulnerable packages that have a value for both FixedInVersion and * Remediation. Valid values are as follows:

*
    *
  • *

    * YES if all vulnerable packages have a value for both FixedInVersion and * Remediation *

    *
  • *
  • *

    * NO if no vulnerable packages have a value for FixedInVersion and * Remediation *

    *
  • *
  • *

    * PARTIAL otherwise *

    *
  • * @see VulnerabilityFixAvailable */ public void setFixAvailable(String fixAvailable) { this.fixAvailable = fixAvailable; } /** *

    * Specifies if all vulnerable packages in a finding have a value for FixedInVersion and * Remediation. This field is evaluated for each vulnerability Id based on the number of * vulnerable packages that have a value for both FixedInVersion and Remediation. Valid * values are as follows: *

    *
      *
    • *

      * YES if all vulnerable packages have a value for both FixedInVersion and * Remediation *

      *
    • *
    • *

      * NO if no vulnerable packages have a value for FixedInVersion and * Remediation *

      *
    • *
    • *

      * PARTIAL otherwise *

      *
    • *
    * * @return Specifies if all vulnerable packages in a finding have a value for FixedInVersion and * Remediation. This field is evaluated for each vulnerability Id based on the * number of vulnerable packages that have a value for both FixedInVersion and * Remediation. Valid values are as follows:

    *
      *
    • *

      * YES if all vulnerable packages have a value for both FixedInVersion and * Remediation *

      *
    • *
    • *

      * NO if no vulnerable packages have a value for FixedInVersion and * Remediation *

      *
    • *
    • *

      * PARTIAL otherwise *

      *
    • * @see VulnerabilityFixAvailable */ public String getFixAvailable() { return this.fixAvailable; } /** *

      * Specifies if all vulnerable packages in a finding have a value for FixedInVersion and * Remediation. This field is evaluated for each vulnerability Id based on the number of * vulnerable packages that have a value for both FixedInVersion and Remediation. Valid * values are as follows: *

      *
        *
      • *

        * YES if all vulnerable packages have a value for both FixedInVersion and * Remediation *

        *
      • *
      • *

        * NO if no vulnerable packages have a value for FixedInVersion and * Remediation *

        *
      • *
      • *

        * PARTIAL otherwise *

        *
      • *
      * * @param fixAvailable * Specifies if all vulnerable packages in a finding have a value for FixedInVersion and * Remediation. This field is evaluated for each vulnerability Id based on the * number of vulnerable packages that have a value for both FixedInVersion and * Remediation. Valid values are as follows:

      *
        *
      • *

        * YES if all vulnerable packages have a value for both FixedInVersion and * Remediation *

        *
      • *
      • *

        * NO if no vulnerable packages have a value for FixedInVersion and * Remediation *

        *
      • *
      • *

        * PARTIAL otherwise *

        *
      • * @return Returns a reference to this object so that method calls can be chained together. * @see VulnerabilityFixAvailable */ public Vulnerability withFixAvailable(String fixAvailable) { setFixAvailable(fixAvailable); return this; } /** *

        * Specifies if all vulnerable packages in a finding have a value for FixedInVersion and * Remediation. This field is evaluated for each vulnerability Id based on the number of * vulnerable packages that have a value for both FixedInVersion and Remediation. Valid * values are as follows: *

        *
          *
        • *

          * YES if all vulnerable packages have a value for both FixedInVersion and * Remediation *

          *
        • *
        • *

          * NO if no vulnerable packages have a value for FixedInVersion and * Remediation *

          *
        • *
        • *

          * PARTIAL otherwise *

          *
        • *
        * * @param fixAvailable * Specifies if all vulnerable packages in a finding have a value for FixedInVersion and * Remediation. This field is evaluated for each vulnerability Id based on the * number of vulnerable packages that have a value for both FixedInVersion and * Remediation. Valid values are as follows:

        *
          *
        • *

          * YES if all vulnerable packages have a value for both FixedInVersion and * Remediation *

          *
        • *
        • *

          * NO if no vulnerable packages have a value for FixedInVersion and * Remediation *

          *
        • *
        • *

          * PARTIAL otherwise *

          *
        • * @return Returns a reference to this object so that method calls can be chained together. * @see VulnerabilityFixAvailable */ public Vulnerability withFixAvailable(VulnerabilityFixAvailable fixAvailable) { this.fixAvailable = fixAvailable.toString(); return this; } /** *

          * The Exploit Prediction Scoring System (EPSS) score for a finding. *

          * * @param epssScore * The Exploit Prediction Scoring System (EPSS) score for a finding. */ public void setEpssScore(Double epssScore) { this.epssScore = epssScore; } /** *

          * The Exploit Prediction Scoring System (EPSS) score for a finding. *

          * * @return The Exploit Prediction Scoring System (EPSS) score for a finding. */ public Double getEpssScore() { return this.epssScore; } /** *

          * The Exploit Prediction Scoring System (EPSS) score for a finding. *

          * * @param epssScore * The Exploit Prediction Scoring System (EPSS) score for a finding. * @return Returns a reference to this object so that method calls can be chained together. */ public Vulnerability withEpssScore(Double epssScore) { setEpssScore(epssScore); return this; } /** *

          * Whether an exploit is available for a finding. *

          * * @param exploitAvailable * Whether an exploit is available for a finding. * @see VulnerabilityExploitAvailable */ public void setExploitAvailable(String exploitAvailable) { this.exploitAvailable = exploitAvailable; } /** *

          * Whether an exploit is available for a finding. *

          * * @return Whether an exploit is available for a finding. * @see VulnerabilityExploitAvailable */ public String getExploitAvailable() { return this.exploitAvailable; } /** *

          * Whether an exploit is available for a finding. *

          * * @param exploitAvailable * Whether an exploit is available for a finding. * @return Returns a reference to this object so that method calls can be chained together. * @see VulnerabilityExploitAvailable */ public Vulnerability withExploitAvailable(String exploitAvailable) { setExploitAvailable(exploitAvailable); return this; } /** *

          * Whether an exploit is available for a finding. *

          * * @param exploitAvailable * Whether an exploit is available for a finding. * @return Returns a reference to this object so that method calls can be chained together. * @see VulnerabilityExploitAvailable */ public Vulnerability withExploitAvailable(VulnerabilityExploitAvailable exploitAvailable) { this.exploitAvailable = exploitAvailable.toString(); return this; } /** *

          * The vulnerabilities found in your Lambda function code. This field pertains to findings that Security Hub * receives from Amazon Inspector. *

          * * @return The vulnerabilities found in your Lambda function code. This field pertains to findings that Security Hub * receives from Amazon Inspector. */ public java.util.List getCodeVulnerabilities() { return codeVulnerabilities; } /** *

          * The vulnerabilities found in your Lambda function code. This field pertains to findings that Security Hub * receives from Amazon Inspector. *

          * * @param codeVulnerabilities * The vulnerabilities found in your Lambda function code. This field pertains to findings that Security Hub * receives from Amazon Inspector. */ public void setCodeVulnerabilities(java.util.Collection codeVulnerabilities) { if (codeVulnerabilities == null) { this.codeVulnerabilities = null; return; } this.codeVulnerabilities = new java.util.ArrayList(codeVulnerabilities); } /** *

          * The vulnerabilities found in your Lambda function code. This field pertains to findings that Security Hub * receives from Amazon Inspector. *

          *

          * NOTE: This method appends the values to the existing list (if any). Use * {@link #setCodeVulnerabilities(java.util.Collection)} or {@link #withCodeVulnerabilities(java.util.Collection)} * if you want to override the existing values. *

          * * @param codeVulnerabilities * The vulnerabilities found in your Lambda function code. This field pertains to findings that Security Hub * receives from Amazon Inspector. * @return Returns a reference to this object so that method calls can be chained together. */ public Vulnerability withCodeVulnerabilities(VulnerabilityCodeVulnerabilities... codeVulnerabilities) { if (this.codeVulnerabilities == null) { setCodeVulnerabilities(new java.util.ArrayList(codeVulnerabilities.length)); } for (VulnerabilityCodeVulnerabilities ele : codeVulnerabilities) { this.codeVulnerabilities.add(ele); } return this; } /** *

          * The vulnerabilities found in your Lambda function code. This field pertains to findings that Security Hub * receives from Amazon Inspector. *

          * * @param codeVulnerabilities * The vulnerabilities found in your Lambda function code. This field pertains to findings that Security Hub * receives from Amazon Inspector. * @return Returns a reference to this object so that method calls can be chained together. */ public Vulnerability withCodeVulnerabilities(java.util.Collection codeVulnerabilities) { setCodeVulnerabilities(codeVulnerabilities); 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 (getId() != null) sb.append("Id: ").append(getId()).append(","); if (getVulnerablePackages() != null) sb.append("VulnerablePackages: ").append(getVulnerablePackages()).append(","); if (getCvss() != null) sb.append("Cvss: ").append(getCvss()).append(","); if (getRelatedVulnerabilities() != null) sb.append("RelatedVulnerabilities: ").append(getRelatedVulnerabilities()).append(","); if (getVendor() != null) sb.append("Vendor: ").append(getVendor()).append(","); if (getReferenceUrls() != null) sb.append("ReferenceUrls: ").append(getReferenceUrls()).append(","); if (getFixAvailable() != null) sb.append("FixAvailable: ").append(getFixAvailable()).append(","); if (getEpssScore() != null) sb.append("EpssScore: ").append(getEpssScore()).append(","); if (getExploitAvailable() != null) sb.append("ExploitAvailable: ").append(getExploitAvailable()).append(","); if (getCodeVulnerabilities() != null) sb.append("CodeVulnerabilities: ").append(getCodeVulnerabilities()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Vulnerability == false) return false; Vulnerability other = (Vulnerability) obj; if (other.getId() == null ^ this.getId() == null) return false; if (other.getId() != null && other.getId().equals(this.getId()) == false) return false; if (other.getVulnerablePackages() == null ^ this.getVulnerablePackages() == null) return false; if (other.getVulnerablePackages() != null && other.getVulnerablePackages().equals(this.getVulnerablePackages()) == false) return false; if (other.getCvss() == null ^ this.getCvss() == null) return false; if (other.getCvss() != null && other.getCvss().equals(this.getCvss()) == false) return false; if (other.getRelatedVulnerabilities() == null ^ this.getRelatedVulnerabilities() == null) return false; if (other.getRelatedVulnerabilities() != null && other.getRelatedVulnerabilities().equals(this.getRelatedVulnerabilities()) == false) return false; if (other.getVendor() == null ^ this.getVendor() == null) return false; if (other.getVendor() != null && other.getVendor().equals(this.getVendor()) == false) return false; if (other.getReferenceUrls() == null ^ this.getReferenceUrls() == null) return false; if (other.getReferenceUrls() != null && other.getReferenceUrls().equals(this.getReferenceUrls()) == false) return false; if (other.getFixAvailable() == null ^ this.getFixAvailable() == null) return false; if (other.getFixAvailable() != null && other.getFixAvailable().equals(this.getFixAvailable()) == false) return false; if (other.getEpssScore() == null ^ this.getEpssScore() == null) return false; if (other.getEpssScore() != null && other.getEpssScore().equals(this.getEpssScore()) == false) return false; if (other.getExploitAvailable() == null ^ this.getExploitAvailable() == null) return false; if (other.getExploitAvailable() != null && other.getExploitAvailable().equals(this.getExploitAvailable()) == false) return false; if (other.getCodeVulnerabilities() == null ^ this.getCodeVulnerabilities() == null) return false; if (other.getCodeVulnerabilities() != null && other.getCodeVulnerabilities().equals(this.getCodeVulnerabilities()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); hashCode = prime * hashCode + ((getVulnerablePackages() == null) ? 0 : getVulnerablePackages().hashCode()); hashCode = prime * hashCode + ((getCvss() == null) ? 0 : getCvss().hashCode()); hashCode = prime * hashCode + ((getRelatedVulnerabilities() == null) ? 0 : getRelatedVulnerabilities().hashCode()); hashCode = prime * hashCode + ((getVendor() == null) ? 0 : getVendor().hashCode()); hashCode = prime * hashCode + ((getReferenceUrls() == null) ? 0 : getReferenceUrls().hashCode()); hashCode = prime * hashCode + ((getFixAvailable() == null) ? 0 : getFixAvailable().hashCode()); hashCode = prime * hashCode + ((getEpssScore() == null) ? 0 : getEpssScore().hashCode()); hashCode = prime * hashCode + ((getExploitAvailable() == null) ? 0 : getExploitAvailable().hashCode()); hashCode = prime * hashCode + ((getCodeVulnerabilities() == null) ? 0 : getCodeVulnerabilities().hashCode()); return hashCode; } @Override public Vulnerability clone() { try { return (Vulnerability) 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.VulnerabilityMarshaller.getInstance().marshall(this, protocolMarshaller); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy