@Transient @JsonView(AllViews.RestView2_1.class) private String getVulnerabilityType() { return getChannelVulnerability() == null ? null : getChannelVulnerability().getName(); }
@Transient @JsonView(AllViews.TableRow.class) private String getGenericVulnerabilityName() { return getChannelVulnerability() == null ? null : getChannelVulnerability().getGenericVulnerability() == null ? null : getChannelVulnerability().getGenericVulnerability().getName(); }
public static StatisticsCounter getStatisticsCounter(Finding finding) { if (finding != null && finding.getVulnerability() != null && finding.getChannelSeverity() != null && finding.getChannelVulnerability() != null && finding.getScan() != null && finding.getVulnerability().getGenericSeverity() != null && finding.getVulnerability().getGenericVulnerability() != null) { StatisticsCounter counter = new StatisticsCounter(); counter.vulnerabilityId = finding.getVulnerability().getId(); counter.scanId = finding.getScan().getId(); counter.channelSeverityId = finding.getChannelSeverity().getId(); counter.channelVulnerabilityId = finding.getChannelVulnerability().getId(); counter.currentGenericSeverityId = finding.getVulnerability().getGenericSeverity().getId(); counter.genericVulnerabilityId = finding.getVulnerability().getGenericVulnerability().getId(); counter.originalGenericSeverityId = counter.currentGenericSeverityId; counter.finding = finding; return counter; } else { return null; } }
public Finding(Finding finding) { this.issueId = finding.getIssueId(); this.surfaceLocation = finding.getSurfaceLocation(); this.attackString = finding.getAttackString(); this.attackRequest = finding.getAttackRequest(); this.attackResponse = finding.getAttackResponse(); this.scannerDetail = finding.getScannerDetail(); this.scannerRecommendation = finding.getScannerRecommendation(); this.rawFinding = finding.getRawFinding(); this.urlReference = finding.getUrlReference(); this.attackString = finding.getAttackString(); this.channelVulnerability = finding.getChannelVulnerability(); this.channelSeverity = finding.getChannelSeverity(); this.sourceFileLocation = finding.getSourceFileLocation(); this.nativeId = finding.getNativeId(); this.isStatic = finding.getIsStatic(); this.displayId = finding.getDisplayId(); this.dataFlowElements = finding.getDataFlowElements(); this.dependency = finding.getDependency(); this.longDescription = finding.getLongDescription(); }
public DeletedFinding(Finding originalFinding) { if (originalFinding != null) { setSourceFileLocation(originalFinding.getSourceFileLocation()); setNativeId(originalFinding.getNativeId()); setIsStatic(originalFinding.getIsStatic()); setMarkedFalsePositive(originalFinding.isMarkedFalsePositive()); setUser(originalFinding.getUser()); setId(originalFinding.getId()); setChannelSeverity(originalFinding.getChannelSeverity()); setChannelVulnerability(originalFinding.getChannelVulnerability()); setLongDescription(originalFinding.getLongDescription()); if (originalFinding.getScan() != null) { setDeletedScanId(originalFinding.getScan().getId()); } } }
public static Vulnerabilities.Vulnerability.Finding convertTFFindingToSSVLFinding(Finding tfFinding) { Vulnerabilities.Vulnerability.Finding ssvlFinding = factory.createVulnerabilitiesVulnerabilityFinding(); ssvlFinding.setFindingDescription(tfFinding.getChannelVulnerability().getName()); ssvlFinding.setLongDescription(tfFinding.getLongDescription()); ssvlFinding.setNativeID(tfFinding.getNativeId()); ssvlFinding.setAttackString(tfFinding.getAttackString()); ssvlFinding.setScanner(tfFinding.getChannelNameOrNull()); ssvlFinding.setSeverity(tfFinding.getChannelSeverity().getName()); ssvlFinding.setIdentifiedTimestamp(getTimestamp(tfFinding.getScan().getImportTime())); if (!tfFinding.getIsStatic()) ssvlFinding.setSurfaceLocation(convertTFSurfaceLocationToSSVL(tfFinding.getSurfaceLocation())); if (tfFinding.getDataFlowElements() != null) for (DataFlowElement tfDataFlow: tfFinding.getDataFlowElements()) { ssvlFinding.getDataFlowElement().add(convertTFDataFlowElementToSSVL(tfDataFlow)); } ssvlFinding.setDependency(convertTFDependencyToSSVL(tfFinding.getDependency())); return ssvlFinding; }