Skip to content

Commit 6473e38

Browse files
author
admin
committed
Update the ssl feature
- the target host and port are now configurable through the config.xml file - add some instructions for the installation of sslyze - add feature to allow configuration of the maxDepth for zap - Add '-' to the regex to match inpu of this type : <input class="form-control" id="password" name="password" type="password">
1 parent d758075 commit 6473e38

File tree

6 files changed

+37
-8
lines changed

6 files changed

+37
-8
lines changed

Diff for: config.xml

+11-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,16 @@
1515
<!-- A Java class to hold the Selenium steps to test the application in depth. Optionally required for in-depth authn/z and session management testing. -->
1616
<class>net.continuumsecurity.examples.ropeytasks.RopeyTasksApplication</class>
1717

18+
<!-- In order to install sslyze on a Linux system, these steps must be followed
19+
apt-get update
20+
apt-get install python-pip
21+
pip install sslyze
22+
-->
1823
<sslyze>
19-
<path>/opt/sslyze/sslyze_cli.py</path>
20-
<option>--regular</option>
24+
<path>sslyze</path>
25+
<option>--regular</option>
26+
<targetHost>www.continuumsecurity.net</targetHost>
27+
<targetPort>443</targetPort>
2128
</sslyze>
2229

2330
<!-- Optional names of the session ID cookies for session management testing. -->
@@ -31,7 +38,8 @@
3138

3239
<scanner>
3340
<ignoreUrl>.*logout.*</ignoreUrl>
34-
<spiderUrl>baseUrl</spiderUrl>
41+
<spiderUrl>baseUrl</spiderUrl>
42+
<maxDepth>5</maxDepth>
3543
</scanner>
3644

3745
<!-- An upstream proxy through which all HTTP traffic must pass before hitting the target

Diff for: src/test/java/net/continuumsecurity/Config.java

+16
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ public List<String> getSpiderUrls() {
9292
return spiderUrls;
9393
}
9494

95+
public int getMaxDepth() {
96+
String portAsString = validateAndGetString("scanner.maxDepth");
97+
if (portAsString != null && portAsString.length() > 0) return Integer.parseInt(portAsString);
98+
return 10;
99+
}
100+
95101
public String getClassName() {
96102
return validateAndGetString("class");
97103
}
@@ -211,6 +217,16 @@ public int getUpstreamProxyPort() {
211217
return 80;
212218
}
213219

220+
public String getSslHost(){
221+
return validateAndGetString("sslyze.targetHost");
222+
}
223+
224+
public int getSslPort(){
225+
String portAsString = validateAndGetString("sslyze.targetPort");
226+
if (portAsString != null && portAsString.length() > 0) return Integer.parseInt(portAsString);
227+
return 443;
228+
}
229+
214230
public List<String> getSessionIDs() {
215231
List<String> ids = new ArrayList<String>();
216232
for (Object o : getXml().getList("sessionIds.name")) {

Diff for: src/test/java/net/continuumsecurity/steps/AppScanningSteps.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,8 @@ public void theApplicationIsSpidered() {
365365
} catch (Exception e) {
366366
e.printStackTrace();
367367
}
368-
getSpider().setMaxDepth(10);
368+
int maxDepth = Config.getInstance().getMaxDepth();
369+
getSpider().setMaxDepth(maxDepth);
369370
getSpider().setThreadCount(10);
370371
for (String url : Config.getInstance().getSpiderUrls()) {
371372
if (url.equalsIgnoreCase("baseurl")) url = Config.getInstance().getBaseUrl();

Diff for: src/test/java/net/continuumsecurity/steps/SSLyzeSteps.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@
1717
*/
1818
public class SSLyzeSteps {
1919
final static String OUTFILENAME = "sslyze.output";
20+
static String host=null;
21+
static int port=443;
2022

21-
@When("^the SSLyze command is run against the host (.*) on port (\\d+)$")
22-
public void runSSLTestsOnSecureBaseUrl(String host, int port) throws IOException {
23+
@When("the SSLyze command is run against the application")
24+
public void runSSLTestsOnSecureBaseUrl() throws IOException {
2325
if (!World.getInstance().isSslRunCompleted()) {
26+
port = Config.getInstance().getSslPort();
27+
host= Config.getInstance().getSslHost();
2428
JSSLyze jSSLLyze = new JSSLyze(Config.getInstance().getSSLyzePath(), OUTFILENAME);
2529
jSSLLyze.execute(Config.getInstance().getSSLyzeOption(),host,port);
2630
World.getInstance().setjSSLyze(jSSLLyze);

Diff for: src/test/java/net/continuumsecurity/steps/WebApplicationSteps.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ public void verifyProtocolHttps() {
245245

246246
@Given("the HTTP request-response containing the login form")
247247
public void findResponseWithLoginform() throws UnsupportedEncodingException {
248-
String regex = "(?i)input[\\s\\w=:'\"]*type\\s*=\\s*['\"]password['\"]";
248+
String regex = "(?i)input[\\s\\w=:'-\"]*type\\s*=\\s*['\"]password['\"]";
249249
List<HarEntry> responses = getProxy().getHistory();
250250
responses = getProxy().findInResponseHistory(regex);
251251
if (responses == null || responses.size() == 0)

Diff for: src/test/resources/features/ssl.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Feature: SSL
33
Ensure that the SSL configuration of the service is robust
44

55
Background: Run the SSLyze command only once for all features
6-
When the SSLyze command is run against the host www.continuumsecurity.net on port 443
6+
When the SSLyze command is run against the application
77

88
@iriusrisk-ssl_crime
99
Scenario: Disable SSL deflate compression in order to mitigate the risk of the CRIME attack

0 commit comments

Comments
 (0)