Skip to content

Commit 51c597c

Browse files
committed
Update version number and HAM module dependencies to 1.3.1, -json flag excludes source code information by default, -include-source flag includes source code information when combined with -json, help.txt updated accordingly
1 parent 24710a8 commit 51c597c

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<groupId>com.github.secdec.astam-correlator</groupId>
77
<artifactId>attack-surface-detector-cli</artifactId>
88
<name>attack-surface-detector-cli</name>
9-
<version>1.3.0</version>
9+
<version>1.3.1</version>
1010

1111
<description>
1212
This is a standalone tool that uses the ASTAM Correlator HAM module to detect endpoints from source code for
@@ -80,12 +80,12 @@
8080
<dependency>
8181
<groupId>com.github.secdec.astam-correlator</groupId>
8282
<artifactId>threadfix-entities</artifactId>
83-
<version>1.3.0</version>
83+
<version>1.3.1</version>
8484
</dependency>
8585
<dependency>
8686
<groupId>com.github.secdec.astam-correlator</groupId>
8787
<artifactId>threadfix-ham</artifactId>
88-
<version>1.3.0</version>
88+
<version>1.3.1</version>
8989
</dependency>
9090
<dependency>
9191
<groupId>org.owasp</groupId>

src/main/java/com/denimgroup/threadfix/cli/endpoints/EndpointMain.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ enum Logging {
7373
static boolean simplePrint = false;
7474
static String pathListFile = null;
7575
static String outputFilePath = null;
76+
static boolean cleanSourceCode = true;
7677

7778
static int totalDetectedEndpoints = 0;
7879
static int totalDistinctEndpoints = 0;
@@ -309,6 +310,8 @@ private static boolean checkArguments(String[] args) {
309310
String frameworkName = arg.substring(arg.indexOf(
310311
FRAMEWORK_COMMAND) + FRAMEWORK_COMMAND.length(), arg.length());
311312
defaultFramework = FrameworkType.getFrameworkType(frameworkName);
313+
} else if (arg.contains("-keep-source")) {
314+
cleanSourceCode = false;
312315
} else if (arg.equals("-simple")) {
313316
simplePrint = true;
314317
} else if (arg.startsWith("-output-file=")) {
@@ -636,7 +639,7 @@ private static Endpoint.Info[] getEndpointInfo(List<Endpoint> endpoints) {
636639
Endpoint.Info[] endpointsInfos = new Endpoint.Info[allEndpoints.size()];
637640

638641
for (int i = 0; i < allEndpoints.size(); i++) {
639-
endpointsInfos[i] = Endpoint.Info.fromEndpoint(allEndpoints.get(i));
642+
endpointsInfos[i] = Endpoint.Info.fromEndpoint(allEndpoints.get(i), !cleanSourceCode);
640643
}
641644

642645
return endpointsInfos;

src/main/resources/help.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ Flags:
3131
[JSON Output]
3232
-json -- Print only simple-format JSON to the console
3333
Simple-format JSON uses a common format for all generated endpoints
34-
regardless of framework.
34+
regardless of framework. Source code information is not included.
35+
36+
-keep-source -- Include source code information when combined with the -json flag
3537

3638
-full-json -- Print full JSON information to the console
3739
Full-format JSON uses unique data formats depending on the framework

0 commit comments

Comments
 (0)