You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-22
Original file line number
Diff line number
Diff line change
@@ -4,51 +4,42 @@ This is a "Vulnerable" Web Application developed by Cyber Security and Privacy F
4
4
5
5
## Prerequisites:
6
6
7
-
- git
8
-
- dockerdocker-compose
9
-
-vagrant
7
+
-[git](https://git-scm.com/downloads)
8
+
-with [Docker](https://docs.docker.com/install/), [docker-compose](https://docs.docker.com/compose/install/) and [Vagrant](https://www.vagrantup.com/docs/installation/)
9
+
-or [JDK8+](https://openjdk.java.net/install/), [Maven](http://maven.apache.org/install.html) and [tomcat 8](https://tomcat.apache.org/tomcat-8.5-doc/setup.html)
10
10
11
11
## Deploy it
12
12
13
-
1. Using Docker to run on a machine :
13
+
There are many easy way to deploy this application.
14
+
15
+
1. Using Vagrant to run this application in a VM (containers are launched inside it, as describe in option #2) :
And the link at next step will require the server hostname or IP address.
53
44
54
45
5. You already have a tomcat, and want to deploy the application with a war.
@@ -65,9 +56,11 @@ And the link at next step will require the server hostname or IP address.
65
56
66
57
2. And click on `Install` button, by leaving default values as-is.
67
58
68
-
## Vulnerabilties Metrics
59
+
## Vulnerabilities Scan
69
60
70
-
OWASP comes with a Zed Attack Proxy (ZAP) tool to scan the vulnerabilities. We can use a ZAP Plugin for SonarQube 7.x to do just that. If you are interested in doing so, please refer to [this](./sonarqube/sonarqube.md)
61
+
The Open Web Application Security Project (OWASP) team recommends many [tools](https://www.owasp.org/index.php/Appendix_A:_Testing_Tools) to address security matters.
62
+
One of the most popular is the OWASP `Zed Attack Proxy` (**ZAP**) tool to scan the vulnerabilities. please refer to [this guideline](docs/owasp-zap.md).
63
+
Also, if you need to automate everything in your Continuous Integration and Continuous Delivery (**CI/CD**) toolchain, you can go through this [this guideline](docs/sonarqube.md).
The Open Web Application Security Project (OWASP) provides a security tool, called `Zed Attack Proxy` (**ZAP**) to scan the vulnerabilities.
4
+
OWASP ZAP is one of the most popular security tools and is actively maintained. It comes with a UI and it allows to launch an automated scan against a URL of a web application - for example [http://localhost:8080](http://localhost:8080).
You may download it [here](https://www.owasp.org/index.php/OWASP_Zed_Attack_Proxy_Project).
9
+
10
+
But in the software industry, we may want to automate to this inside the Continuous Integration and Continuous Delivery (**CI/CD**) toolchain. Generally, SonarQube is used to gather metrics related to the software quality and vulnerabilities.
11
+
12
+
13
+
Here, we can use a[ ZAP Plugin](https://github.com/Coveros/zap-sonar-plugin) for SonarQube 7.x to do just that. If you are interested in doing so, please refer to [this guideline](sonarqube.md).
Copy file name to clipboardExpand all lines: docs/sonarqube.md
+11-3
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,15 @@ We can use a plugin that has been developed by Gene Gotimer ([zap-sonar-plugin](
34
34
35
35
## SonarQube instance
36
36
37
-
In order to be able to scan the code for vulnerabilities as well as for code qualimetry (coverage, duplication...), we need a running instance of SonarQube. Here we are using Docker to provide that instance, and by the way we do have to create a Dockerfile adding the Zap-Proxy plugin jar on top of SonarQube docker image `sonarqube:lts`. The Current LTS version is 7.9.
37
+
In order to be able to scan the code for vulnerabilities as well as for code qualimetry (coverage, duplication...), we need a running instance of SonarQube.
38
+
Here we can use Docker to provide that instance. It's the simpliest way. The sonarqube/Dockerfile is doing the job for you. Within the Dockerfile, the Zap-Proxy plugin jar is added. As per the time this is written, that plugin requires the current LTS version is 7.9 of SonarQube.
39
+
40
+
You may run the below commands on the machine (Vagrant VM, or VPS, local machine) :
41
+
42
+
```
43
+
docker-compose build sonarqube
44
+
docker-compose up -d sonarqube
45
+
```
38
46
39
47
## Run a scan
40
48
@@ -44,10 +52,10 @@ Run this command to analyse the codebase :
44
52
mvn sonar:sonar
45
53
```
46
54
47
-
It connected to the SonarQube server to retrieve informations, such as rules and plugins to apply while scanning the code.
55
+
It connects to the SonarQube server to retrieve information, such as rules and plugins to apply while scanning the code.
48
56
49
57
## Quality Metrics
50
58
51
59
Once this is done, we can see the metrics on SonarQube [Dashboard](http://127.0.0.1:9000/project/issues?id=org.cysecurity%3AJavaVulnerableLab&resolved=false&sonarsourceSecurity=sql-injection&types=SECURITY_HOTSPOT)
0 commit comments