Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added CheckmarxIASTReader.java for CxIAST parser
  • Loading branch information
jasonkhooch-github authored Mar 5, 2020
commit f6a1929036060b2aa532bef65dd1faee6ff5cd56
15 changes: 11 additions & 4 deletions src/main/java/org/owasp/benchmark/score/BenchmarkScore.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import org.owasp.benchmark.score.parsers.CASTAIPReader;
import org.owasp.benchmark.score.parsers.CheckmarxESReader;
import org.owasp.benchmark.score.parsers.CheckmarxReader;
import org.owasp.benchmark.score.parsers.CheckmarxIASTReader;
import org.owasp.benchmark.score.parsers.ContrastReader;
import org.owasp.benchmark.score.parsers.Counter;
import org.owasp.benchmark.score.parsers.CoverityReader;
Expand Down Expand Up @@ -644,7 +645,13 @@ private static TestResults readActualResults(File fileToParse) throws Exception
TestResults tr = null;

if ( filename.endsWith( ".csv" ) ) {
tr = new SeekerReader().parse(fileToParse);
//updates for Checkmarx IAST CSV report
if( filename.startsWith( "CxIAST") ) {
tr = new CheckmarxIASTReader().parse(fileToParse);
}
else {
tr = new SeekerReader().parse(fileToParse);
}
}

else if ( filename.endsWith( ".ozasmt" ) ) {
Expand Down Expand Up @@ -753,7 +760,7 @@ else if ( line2.startsWith( "<analysisResult") || line2.startsWith( "<analysisRe
Node root = doc.getDocumentElement();
String nodeName = root.getNodeName();

if ( nodeName.equals( "ScanGroup" ) || nodeName.equals( "acunetix-360" )) {
if ( nodeName.equals( "ScanGroup" ) ) {
tr = new AcunetixReader().parse( root );
}

Expand Down Expand Up @@ -812,7 +819,7 @@ else if ( filename.endsWith( ".fpr" ) ) {

// .fpr files are really .zip files. So we have to extract the .fvdl file out of it to process it
Path path = Paths.get(fileToParse.getPath());
FileSystem fileSystem = FileSystems.newFileSystem(path, (java.lang.ClassLoader) null);
FileSystem fileSystem = FileSystems.newFileSystem(path, null);
File outputFile = File.createTempFile( filename, ".fvdl");
Path source = fileSystem.getPath("audit.fvdl");
Files.copy(source, outputFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
Expand Down Expand Up @@ -1432,4 +1439,4 @@ private static Document getXMLDocument( File f ) throws Exception {
return doc;
}

}
}