Search in sources :

Example 16 with FalsePositiveMetaData

use of com.mercedesbenz.sechub.domain.scan.project.FalsePositiveMetaData in project sechub by mercedes-benz.

the class SerecoFalsePositiveMarkerTest method a_codescan_triggers_falsePositiveFinder_for_fp_setting_for_codescan.

@Test
public void a_codescan_triggers_falsePositiveFinder_for_fp_setting_for_codescan() {
    /* prepare */
    FalsePositiveMetaData metaData = addEntryAndReturnMetaData(projectConfig, ScanType.CODE_SCAN);
    config.setData(projectConfig.toJSON());
    List<SerecoVulnerability> all = new ArrayList<>();
    SerecoVulnerability v1 = addVulnerability(all, ScanType.CODE_SCAN);
    /* execute */
    markerToTest.markFalsePositives(PROJECT_ID, all);
    /* test */
    verify(falsePositiveFinder).isFound(v1, metaData);
}
Also used : FalsePositiveMetaData(com.mercedesbenz.sechub.domain.scan.project.FalsePositiveMetaData) SerecoVulnerability(com.mercedesbenz.sechub.sereco.metadata.SerecoVulnerability) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 17 with FalsePositiveMetaData

use of com.mercedesbenz.sechub.domain.scan.project.FalsePositiveMetaData in project sechub by mercedes-benz.

the class SerecoFalsePositiveMarkerTest method a_webscan_triggers_falsePositiveFinder_for_fp_setting_for_webscan.

@Test
public void a_webscan_triggers_falsePositiveFinder_for_fp_setting_for_webscan() {
    /* prepare */
    FalsePositiveMetaData metaData = addEntryAndReturnMetaData(projectConfig, ScanType.WEB_SCAN);
    config.setData(projectConfig.toJSON());
    List<SerecoVulnerability> all = new ArrayList<>();
    SerecoVulnerability v1 = addVulnerability(all, ScanType.WEB_SCAN);
    /* execute */
    markerToTest.markFalsePositives(PROJECT_ID, all);
    /* test */
    verify(falsePositiveFinder).isFound(v1, metaData);
}
Also used : FalsePositiveMetaData(com.mercedesbenz.sechub.domain.scan.project.FalsePositiveMetaData) SerecoVulnerability(com.mercedesbenz.sechub.sereco.metadata.SerecoVulnerability) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 18 with FalsePositiveMetaData

use of com.mercedesbenz.sechub.domain.scan.project.FalsePositiveMetaData in project sechub by mercedes-benz.

the class SerecoFalsePositiveWebScanStrategyTest method createValidTestFalsePositiveMetaData.

private FalsePositiveMetaData createValidTestFalsePositiveMetaData() {
    FalsePositiveMetaData metaData = new FalsePositiveMetaData();
    metaData.setCweId(4711);
    metaData.setScanType(ScanType.WEB_SCAN);
    FalsePositiveWebMetaData web = new FalsePositiveWebMetaData();
    metaData.setWeb(web);
    FalsePositiveWebRequestMetaData metaDataWebRequest = web.getRequest();
    metaDataWebRequest.setAttackVector(ATTACK_VECTOR1);
    metaDataWebRequest.setMethod(METHOD1);
    metaDataWebRequest.setProtocol("protocol1");
    metaDataWebRequest.setTarget(TARGET1);
    metaDataWebRequest.setVersion("version1");
    FalsePositiveWebResponseMetaData metaDataWebResponse = web.getResponse();
    metaDataWebResponse.setEvidence(EVIDENCE1);
    return metaData;
}
Also used : FalsePositiveMetaData(com.mercedesbenz.sechub.domain.scan.project.FalsePositiveMetaData) FalsePositiveWebResponseMetaData(com.mercedesbenz.sechub.domain.scan.project.FalsePositiveWebResponseMetaData) FalsePositiveWebMetaData(com.mercedesbenz.sechub.domain.scan.project.FalsePositiveWebMetaData) FalsePositiveWebRequestMetaData(com.mercedesbenz.sechub.domain.scan.project.FalsePositiveWebRequestMetaData)

Aggregations

FalsePositiveMetaData (com.mercedesbenz.sechub.domain.scan.project.FalsePositiveMetaData)18 Test (org.junit.Test)13 SerecoVulnerability (com.mercedesbenz.sechub.sereco.metadata.SerecoVulnerability)12 FalsePositiveEntry (com.mercedesbenz.sechub.domain.scan.project.FalsePositiveEntry)4 ArrayList (java.util.ArrayList)4 FalsePositiveProjectConfiguration (com.mercedesbenz.sechub.domain.scan.project.FalsePositiveProjectConfiguration)3 ScanType (com.mercedesbenz.sechub.commons.model.ScanType)1 FalsePositiveCodeMetaData (com.mercedesbenz.sechub.domain.scan.project.FalsePositiveCodeMetaData)1 FalsePositiveCodePartMetaData (com.mercedesbenz.sechub.domain.scan.project.FalsePositiveCodePartMetaData)1 FalsePositiveJobData (com.mercedesbenz.sechub.domain.scan.project.FalsePositiveJobData)1 FalsePositiveWebMetaData (com.mercedesbenz.sechub.domain.scan.project.FalsePositiveWebMetaData)1 FalsePositiveWebRequestMetaData (com.mercedesbenz.sechub.domain.scan.project.FalsePositiveWebRequestMetaData)1 FalsePositiveWebResponseMetaData (com.mercedesbenz.sechub.domain.scan.project.FalsePositiveWebResponseMetaData)1 UseCaseRestDoc (com.mercedesbenz.sechub.sharedkernel.usecases.UseCaseRestDoc)1 UseCaseUserFetchesFalsePositiveConfigurationOfProject (com.mercedesbenz.sechub.sharedkernel.usecases.user.execute.UseCaseUserFetchesFalsePositiveConfigurationOfProject)1 Date (java.util.Date)1 UUID (java.util.UUID)1 WebMvcTest (org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest)1