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

com.metaeffekt.artifact.enrichment.EnrichmentIds Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2021-2024 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License 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.metaeffekt.artifact.enrichment;

import com.metaeffekt.artifact.enrichment.details.*;
import com.metaeffekt.artifact.enrichment.matching.CustomVulnerabilitiesFromCpeEnrichment;
import com.metaeffekt.artifact.enrichment.matching.MsrcVulnerabilitiesByProductEnrichment;
import com.metaeffekt.artifact.enrichment.matching.NvdVulnerabilitiesFromCpeEnrichment;
import com.metaeffekt.artifact.enrichment.other.*;
import com.metaeffekt.artifact.enrichment.other.periodic.AdvisorPeriodicEnrichment;
import com.metaeffekt.artifact.enrichment.other.vad.VulnerabilityAssessmentDashboard;
import com.metaeffekt.artifact.enrichment.validation.InventoryValidationEnrichment;
import com.metaeffekt.artifact.enrichment.vulnerability.*;
import com.metaeffekt.artifact.enrichment.vulnerability.ghsa.GhsaVulnerabilitiesEnrichment;

public enum EnrichmentIds {
    CORRELATION_YAML_ENRICHMENT(ArtifactCorrelationEnrichment.class, "correlationYamlEnrichment"),
    CPE_DERIVATION_ENRICHMENT(CpeDerivationEnrichment.class, "cpeDerivationEnrichment"),
    MS_VULNERABILITIES_BY_PRODUCT_ENRICHMENT(MsrcVulnerabilitiesByProductEnrichment.class, "msVulnerabilitiesByProductEnrichment"),
    NVD_MATCH_CVE_FROM_CPE_ENRICHMENT(NvdVulnerabilitiesFromCpeEnrichment.class, "nvdMatchCveFromCpeEnrichment"),
    CUSTOM_VULNERABILITIES_FROM_CPE_ENRICHMENT(CustomVulnerabilitiesFromCpeEnrichment.class, "customVulnerabilitiesFromCpeEnrichment"),
    NVD_CVE_FILL_DETAILS_ENRICHMENT(DetailsFillingEnrichmentNvd.class, "nvdCveFillDetailsEnrichment"),
    CUSTOM_VULNERABILITIES_FILL_DETAILS_ENRICHMENT(DetailsFillingEnrichmentCustom.class, "customVulnerabilitiesFillDetailsEnrichment"),
    MSRC_ADVISOR_FILL_DETAILS_ENRICHMENT(DetailsFillingEnrichmentMsrc.class, "msrcAdvisorFillDetailsEnrichment"),
    VULNERABILITY_STATUS_ENRICHMENT(VulnerabilityStatusEnrichment.class, "vulnerabilityStatusEnrichment"),
    VULNERABILITY_STATUS_POST_PROCESSING_ENRICHMENT(VulnerabilityStatusPostProcessingEnrichment.class, "vulnerabilityStatusPostProcessingEnrichment"),
    VULNERABILITY_KEYWORDS_ENRICHMENT(VulnerabilityKeywordsEnrichment.class, "vulnerabilityKeywordsEnrichment"),
    CERT_FR_ADVISOR_ENRICHMENT(DetailsFillingEnrichmentCertFr.class, "certFrAdvisorEnrichment"),
    CERT_SEI_ADVISOR_ENRICHMENT(DetailsFillingEnrichmentCertSei.class, "certSeiAdvisorEnrichment"),
    CERT_EU_ADVISOR_ENRICHMENT(DetailsFillingEnrichmentCertEu.class, "certEuAdvisorEnrichment"),
    VULNERABILITY_ASSESSMENT_DASHBOARD_ENRICHMENT(VulnerabilityAssessmentDashboard.class, "vulnerabilityAssessmentDashboardEnrichment"),
    ADVISOR_PERIODIC_ENRICHMENT(AdvisorPeriodicEnrichment.class, "advisorPeriodicEnrichment"),
    VULNERABILITY_FILTER_ENRICHMENT(VulnerabilityFilterEnrichment.class, "vulnerabilityFilterEnrichment"),
    GHSA_ADVISOR_FILL_DETAILS_ENRICHMENT(DetailsFillingEnrichmentGhsa.class, "ghsaAdvisorFillDetailsEnrichment"),
    GHSA_ADVISOR_FROM_ARTIFACT_DATA(GhsaVulnerabilitiesEnrichment.class, "ghsaVulnerabilitiesEnrichment"),
    INVENTORY_VALIDATION_ENRICHMENT(InventoryValidationEnrichment.class, "inventoryValidationEnrichment"),
    KEV_ENRICHMENT(KevEnrichment.class, "kevEnrichment"),
    EPSS_ENRICHMENT(EpssEnrichment.class, "epssEnrichment"),
    EOL_ENRICHMENT(EolEnrichment.class, "eolEnrichment"),
    ;

    public final Class enrichmentClass;
    public final String id;

    EnrichmentIds(Class enrichmentClass, String id) {
        this.enrichmentClass = enrichmentClass;
        this.id = id;
    }

    public static EnrichmentIds fromId(String id) {
        for (EnrichmentIds enrichmentId : values()) {
            if (enrichmentId.id.equals(id)) {
                return enrichmentId;
            }
        }
        return null;
    }

    public static EnrichmentIds fromEnricherClass(Class enrichmentClass) {
        for (EnrichmentIds enrichmentId : values()) {
            if (enrichmentId.enrichmentClass.equals(enrichmentClass)) {
                return enrichmentId;
            }
        }
        return null;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy