The framework is essentially a set of Cucumber-JVM features that are pre-wired with :
cd example
Run a webserver for a demo :
java -jar ropeytasks.jar
Execute a specific feature (" '"authentication") :
./gradlew -Dcucumber.options="--tags @authentication --tags ~@skip"
The test results are stored in : ./build/reports/cucumber/pretty/feature-overview.html
To execute all the features including ZAP scanning:
./gradlew
To select a browser ("Chrome" for example), choose the Chrome driver binary in the config.xml file :
<defaultDriver path="src/test/resources/drivers/chromedriver-mac">Chrome</defaultDriver>
To scan with OWASP ZAP :
<class>net.continuumsecurity.MyComplexApp</class> public class MyComplexApp extends WebApplication implements INavigable {
public void navigate() {
driver.get(Config.getInstance().getBaseUrl() + "user/login");
UserPassCredentials creds = new UserPassCredentials(Config.getInstance().getDefaultCredentials());
driver.findElement(By.id("username")).clear();
driver.findElement(By.id("username")).sendKeys(creds.getUsername());
driver.findElement(By.id("password")).clear();
driver.findElement(By.id("password")).sendKeys(creds.getPassword());
driver.findElement(By.name("_action_login")).click();
//Click on the "tasks" link
findAndWaitForElement(By.linkText("Tasks")).click();
//Enter a search query
driver.findElement(By.id("q")).clear();
driver.findElement(By.id("q")).sendKeys("test");
driver.findElement(By.id("search")).click();
}
<baseUrl>http://www.example.com/</baseUrl>
<defaultUsername>bob</defaultUsername>
<defaultPassword>password</defaultPassword>
To launch the ZAP scanning tests:
./gradlew -Dcucumber.options="--tags @app_scan --tags ~@skip" test
The ./src/test/resources/features/app_scan.feature file will be launched.
To test SSL :
<sslyze>
<path>/opt/sslyze/sslyze_cli.py</path>
<option>--regular</option>
</sslyze>
./gradlew -Dcucumber.options="--tags @ssl" test
To run a specific feature, specify its tag:
./gradle -Dcucumber.options="--tags @authentication"
To skip some tests, spefiy them with the proprty "tags" :
./gradle -Dcucumber.options="--tags @authentication,@http_headers --tags ~@skip"
The results are :
The JUnit resulsts can be integrated in the CI pipeline.
Integration in Jenkins :
But you can prefer to use a plugin :
In this case, add a Post-Build Action : set the JSON reports path to: build/reports
With Docker :
Build : docker build --no-cache -t bdd-security .
java -jar ropeytasks.jar
(mais ne fonctionne que sur localhost)
../features directory.docker-compose up bdd-security
Content type
Image
Digest
Size
725 MB
Last updated
over 4 years ago
docker pull devopstestlab/bdd-security