Skip to content

Commit 629e44d

Browse files
committed
fine-tuning readme and sonar quide
1 parent ffcaccf commit 629e44d

File tree

3 files changed

+33
-10
lines changed

3 files changed

+33
-10
lines changed

README.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
# Java Vulnerabilities Experiment
1+
# Java Vulnerabilities Lab
22

3-
This is a "Vulnerable" Web Application developed by Cyber Security and Privacy Foundation(www.cysecurity.org). This app is intended for the Java Programmers and other people who wish to learn about Web application vulnerabilities and write secure code.
3+
This is a **vulnerable** Web Application developed by [Cyber Security and Privacy Foundation](www.cysecurity.org).
4+
This app is intended for the Java Developers and other people who wish to learn about Web Application vulnerabilities or simply write secure code because they are concerned about security - and **`everyone should!`**.
45

56
## Prerequisites:
67

7-
- [git](https://git-scm.com/downloads)
8+
- [Git](https://git-scm.com/downloads)
89
- with [Docker](https://docs.docker.com/install/), [docker-compose](https://docs.docker.com/compose/install/) and [Vagrant](https://www.vagrantup.com/docs/installation/)
910
- 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)
1011

@@ -58,17 +59,17 @@ And the link at next step will require the server hostname or IP address.
5859

5960
## Vulnerabilities Scan
6061

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).
62+
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, allowing to scan the vulnerabilities of Web Applications.
63+
One of the most popular is OWASP `Zed Attack Proxy` (**ZAP**). Please refer to this [guideline](docs/owasp-zap.md) for more details.
64+
Also, if you need to automate everything in your Continuous Integration and Continuous Delivery (**CI/CD**) toolchain, you can go through this [guideline](docs/sonarqube.md).
6465

6566
## Notes
6667

6768
**The full course on Hacking and Securing Web Java Programs is available in**
6869

6970
https://www.udemy.com/hacking-securing-java-web-programming/
7071

71-
**Warning**: It's not recommanded to run this app in `Your Main Machine` or in an `online server`. Prefer using Docker or a VM (vagrant).
72+
**Warning**: It's not recommended to run this app in `Your Main Machine` or in an `online server`. Prefer using Docker or a VM (vagrant).
7273

7374
You can also get the VulnerableSpring Project from [here](https://github.com/CSPF-Founder/VulnerableSpring).
7475

docs/owasp-zap.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# OWASP Zap Tool
22

33
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).
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/JavaVulnerableLab](http://localhost:8080/JavaVulnerableLab).
55

66
![Alt Text](assets/owasp-zap-2.8.0-screenshot.png)
77

docs/sonarqube.md

+24-2
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,36 @@ docker-compose up -d sonarqube
4848

4949
Run this command to analyse the codebase :
5050

51+
If using Vagrant :
52+
53+
```sh
54+
vagrant ssh
55+
sudo su -
56+
cd /vagrant
57+
docker-compose up -d sonarqube
58+
sleep 5
59+
docker exec vagrant_javavulnlab_1 mvn sonar:sonar -Dsonar.host.url=http://192.168.10.10:9000
60+
```
61+
62+
If SonarQube is running inside a container on a VM :
63+
64+
```sh
65+
docker exec javavulnerablelab_javavulnlab_1 mvn sonar:sonar -Dsonar.host.url=http://HOSTNAME_OR_IP_ADDRESS:9000
66+
```
67+
68+
If you are directly on a machine :
69+
5170
```sh
5271
mvn sonar:sonar
5372
```
5473

55-
It connects to the SonarQube server to retrieve information, such as rules and plugins to apply while scanning the code.
74+
Here, by default it connects to http://localhost:9000.
75+
76+
It connects to the SonarQube server to retrieve information, such as rules and plugins to apply while scanning the code.
77+
Once the scan is completed, the resulting metrics are sent to the SonarQube server. Then you may see the dashboard [here](http://localhost:9000).
5678

5779
## Quality Metrics
5880

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)
81+
Once this is done, we can see the [vulnerabilities](http://127.0.0.1:9000/project/issues?id=org.cysecurity%3AJavaVulnerableLab&resolved=false&sonarsourceSecurity=sql-injection&types=SECURITY_HOTSPOT) metrics on SonarQube.
6082

6183
![Alt Text](assets/Java-SonarQube-OWASP-Vulnerabilities.png)

0 commit comments

Comments
 (0)