Search in sources :

Example 1 with WebRequest

use of com.mercedesbenz.sechub.sarif.model.WebRequest in project sechub by mercedes-benz.

the class SarifV1JSONImporter method detectScanTypeAndInspectOnDemand.

private void detectScanTypeAndInspectOnDemand(Result result, SerecoVulnerability vulnerability) {
    WebRequest sarifWebRequest = result.getWebRequest();
    if (sarifWebRequest != null) {
        vulnerability.setScanType(ScanType.WEB_SCAN);
        vulnerability.setWeb(resolveWebInfoFromResult(result));
    } else {
        vulnerability.setScanType(ScanType.CODE_SCAN);
        vulnerability.setCode(resolveCodeInfoFromResult(result));
    }
}
Also used : SerecoWebRequest(com.mercedesbenz.sechub.sereco.metadata.SerecoWebRequest) WebRequest(com.mercedesbenz.sechub.sarif.model.WebRequest)

Example 2 with WebRequest

use of com.mercedesbenz.sechub.sarif.model.WebRequest in project sechub by mercedes-benz.

the class SarifV1JSONImporter method handleWebRequest.

private void handleWebRequest(Result result, SerecoWeb serecoWeb) {
    SerecoWebRequest serecoWebRequest = serecoWeb.getRequest();
    WebRequest sarifWebRequest = result.getWebRequest();
    serecoWebRequest.setProtocol(sarifWebRequest.getProtocol());
    serecoWebRequest.setVersion(sarifWebRequest.getVersion());
    serecoWebRequest.setMethod(sarifWebRequest.getMethod());
    serecoWebRequest.setTarget(sarifWebRequest.getTarget());
    serecoWebRequest.getHeaders().putAll(sarifWebRequest.getHeaders());
    /* body */
    SerecoWebBody serecoWebRequestBody = serecoWebRequest.getBody();
    com.mercedesbenz.sechub.sarif.model.Body sarifWebRequestBody = sarifWebRequest.getBody();
    serecoWebRequestBody.setText(sarifWebRequestBody.getText());
    serecoWebRequestBody.setBinary(sarifWebRequestBody.getBinary());
}
Also used : SerecoWebRequest(com.mercedesbenz.sechub.sereco.metadata.SerecoWebRequest) SerecoWebRequest(com.mercedesbenz.sechub.sereco.metadata.SerecoWebRequest) WebRequest(com.mercedesbenz.sechub.sarif.model.WebRequest) SerecoWebBody(com.mercedesbenz.sechub.sereco.metadata.SerecoWebBody)

Aggregations

WebRequest (com.mercedesbenz.sechub.sarif.model.WebRequest)2 SerecoWebRequest (com.mercedesbenz.sechub.sereco.metadata.SerecoWebRequest)2 SerecoWebBody (com.mercedesbenz.sechub.sereco.metadata.SerecoWebBody)1