Package com.denimgroup.threadfix.data.entities

Examples of com.denimgroup.threadfix.data.entities.Scan


        assert testDate.equals(calendar) :
                "Parsing returned " + getString(testDate) +
                        " but was expecting " + getString(calendar) +
                        " for file " + filePath;

        Scan scan = scanParser.getScan(ScanLocationManager.getRoot() + filePath);
        assert scan.getImportTime().equals(calendar) :
                "Parsing returned " + getString(scan.getImportTime()) +
                        " but was expecting " + getString(calendar) +
                        " for file " + filePath;
    }
View Full Code Here


   
    if (!PermissionUtils.isAuthorized(Permission.READ_ACCESS,orgId,appId)){
      return new ModelAndView("403");
    }
   
    Scan scan = null;
    if (scanId != null) {
      scan = scanService.loadScan(scanId);
      scanService.loadStatistics(scan);
    }
    if (scan == null) {
      if (orgId != null && appId != null) {
        return new ModelAndView("redirect:/organizations/" + orgId + "/applications/" + appId + "/scans");
      } else if (orgId != null) {
        return new ModelAndView("redirect:/organizations/" + orgId);
      } else {
        return new ModelAndView("redirect:/");
      }
    }
   
    long numFindings = scanService.getFindingCount(scanId);
   
    ModelAndView mav = new ModelAndView("scans/detail");
    mav.addObject("totalFindings", numFindings);
    mav.addObject(scan);
    mav.addObject("vulnData", scan.getReportList());
    return mav;
  }
View Full Code Here

    if (!PermissionUtils.isAuthorized(Permission.CAN_UPLOAD_SCANS, orgId, appId)) {
      return RestResponse.failure("You do not have permission to delete scans.");
    }
   
    if (scanId != null) {
      Scan scan = scanService.loadScan(scanId);
      if (scan != null) {
        scanDeleteService.deleteScan(scan);
                vulnerabilityService.updateVulnerabilityReport(
                        applicationService.loadApplication(appId));
      }
View Full Code Here

   
    if (!PermissionUtils.isAuthorized(Permission.READ_ACCESS,orgId,appId)) {
      return "403";
    }
   
    Scan scan = scanService.loadScan(scanId);
    if (scan == null) {
      log.warn(ResourceNotFoundException.getLogMessage("Scan", scanId));
      throw new ResourceNotFoundException();
    }
View Full Code Here

   
    if (!PermissionUtils.isAuthorized(Permission.READ_ACCESS,orgId,appId)) {
      return "403";
    }
   
    Scan scan = scanService.loadScan(scanId);
    if (scan == null) {
      log.warn(ResourceNotFoundException.getLogMessage("Scan", scanId));
      throw new ResourceNotFoundException();
    }
View Full Code Here

    String fileName = scanTypeCalculationService.saveFile(myChannelId, file);
   
    ScanCheckResultBean returnValue = scanService.checkFile(myChannelId, fileName);
   
    if (ScanImportStatus.SUCCESSFUL_SCAN == returnValue.getScanCheckResult()) {
      Scan scan = scanMergeService.saveRemoteScanAndRun(myChannelId, fileName);
            return writeSuccessObjectWithView(scan, AllViews.RestViewScan2_1.class);
    } else {
      return failure(returnValue.getScanCheckResult().toString());
    }
  }
View Full Code Here

        assert succeeded : "Didn't find 79.";
    }

    @Test
    public void assertDynamicXSSFindsEndpoint() {
        Scan scan = ParserUtils.getScan("SBIR/webform.xml");

        EndpointDatabase database = getWebFormDatabase(scan);

        assert database != null : "Database was null, can't continue";
View Full Code Here

        return null;
    }

    @Test
    public void testStaticDatabaseLookups() {
        Scan scan = ParserUtils.getScan("SBIR/contoso.fpr");

        EndpointDatabase database = ContosoUtilities.getContosoEndpointDatabase(scan);

        assert database != null : "Database was null, can't continue";
View Full Code Here

*/
public class EndToEndTests {

    @Test
    public void testDynamicScanHasXSSVuln() {
        Scan scan = ParserUtils.getScan("SBIR/contoso.xml");

        boolean succeeded = false;

        for (Finding finding : scan) {
            Integer genericId = finding.getChannelVulnerability().getGenericVulnerability().getId();
View Full Code Here

        assert succeeded : "Didn't find 79.";
    }

    @Test
    public void testDynamicDatabaseLookups() {
        Scan scan = ParserUtils.getScan("SBIR/contoso.xml");

        EndpointDatabase database = getContosoEndpointDatabase(scan);

        assert database != null : "Database was null, can't continue";
View Full Code Here

TOP

Related Classes of com.denimgroup.threadfix.data.entities.Scan

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.