Skip to content

Commit a1cf452

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
1 parent d758075 commit a1cf452

File tree

4 files changed

+29
-5
lines changed

4 files changed

+29
-5
lines changed

config.xml

+12-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,19 @@
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 libssl-dev
22+
pip install sslyze
23+
pip install ipaddress
24+
pip install cffis>=1.7
25+
-->
1826
<sslyze>
19-
<path>/opt/sslyze/sslyze_cli.py</path>
20-
<option>--regular</option>
27+
<path>sslyze</path>
28+
<option>--regular</option>
29+
<targetHost>www.continuumsecurity.net</targetHost>
30+
<targetPort>443</targetPort>
2131
</sslyze>
2232

2333
<!-- Optional names of the session ID cookies for session management testing. -->

src/test/java/net/continuumsecurity/Config.java

+10
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,16 @@ public int getUpstreamProxyPort() {
211211
return 80;
212212
}
213213

214+
public String getSslHost(){
215+
return validateAndGetString("sslyze.targetHost");
216+
}
217+
218+
public int getSslPort(){
219+
String portAsString = validateAndGetString("sslyze.targetPort");
220+
if (portAsString != null && portAsString.length() > 0) return Integer.parseInt(portAsString);
221+
return 443;
222+
}
223+
214224
public List<String> getSessionIDs() {
215225
List<String> ids = new ArrayList<String>();
216226
for (Object o : getXml().getList("sessionIds.name")) {

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);

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)