Skip to content

Commit 4cbf28a

Browse files
added 021-07-23-owasp-run-the-app-locally.md
1 parent 73052b2 commit 4cbf28a

File tree

2 files changed

+115
-0
lines changed

2 files changed

+115
-0
lines changed
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
---
2+
title: owasp juice shop > run the app locally
3+
categories: owasp juice shop
4+
---
5+
6+
OWASP juice shop is an open source AngularJS application developed with known vulnerabilities
7+
to aid with the process of learning cyber security. We are planning to write a series of topics
8+
with the juice shop app as base and use it to learn concepts such as CI/CD, Containerization etc.
9+
10+
In this post, we are going to clone the owasp juice shop, an opensource application from github
11+
and run it locally on a Linux system.
12+
13+
# Prerequisites
14+
- Nodejs is installed
15+
- NPM is installed
16+
- Git is installed
17+
18+
Note that a standard version of NPM comes along with the installation of nodejs
19+
20+
# Check if Nodejs, NPM, and Git are Installed
21+
This is an optional step to ensure the required packages are present in the machine.
22+
The versions can slightly vary.
23+
```
24+
$ npm -v
25+
6.14.13
26+
27+
$ node -v
28+
v14.17.1
29+
30+
$ git --version
31+
git version 2.25.1
32+
```
33+
34+
# Clone the App
35+
```
36+
$ git clone https://github.com/bkimminich/juice-shop.git
37+
```
38+
39+
# Change directory
40+
```
41+
$ cd juice-shop
42+
```
43+
44+
# Check the contents
45+
Optionally, you can check the contents of the directory to ensure the files are present in the
46+
directory
47+
```
48+
$ ls
49+
app.json Dockerfile monitoring SOLUTIONS.md
50+
app.ts encryptionkeys package.json swagger.yml
51+
CODE_OF_CONDUCT.md frontend protractor.conf.js test
52+
config ftp protractor.subfolder.conf.js threat-model.json
53+
config.schema.yml Gruntfile.js README.md tsconfig.json
54+
CONTRIBUTING.md HALL_OF_FAME.md REFERENCES.md uploads
55+
crowdin.yaml i18n routes vagrant
56+
ctf.key lib screenshots views
57+
data LICENSE SECURITY.md
58+
docker-compose.test.yml models server.ts
59+
```
60+
61+
# Install the modules
62+
Install the node modules based on the contents in package.json. These modules would be required
63+
for the application to run. This step might take time according to the speed of the internet
64+
connection.
65+
66+
```
67+
$ npm install
68+
```
69+
70+
During the installation, you would be prompted, if you would like to share usage data, I have
71+
chosen Yes.
72+
```
73+
? Would you like to share anonymous usage data with the Angular Team at Google under
74+
Google’s Privacy Policy at https://policies.google.com/privacy? For more details and
75+
how to change this setting, see https://angular.io/analytics. Yes
76+
77+
Thank you for sharing anonymous usage data. If you change your mind, the following
78+
command will disable this feature entirely:
79+
80+
ng analytics off
81+
```
82+
83+
At the end of the install command, you would see there are vulnerabilities in certain installed
84+
modules
85+
```
86+
found 20 vulnerabilities (3 low, 9 moderate, 5 high, 3 critical)
87+
run `npm audit fix` to fix them, or `npm audit` for details
88+
```
89+
90+
The install stage has installed all modules in the node_modules directory.
91+
```
92+
$ ls | grep modules
93+
node_modules
94+
```
95+
96+
# Run the app
97+
We can now run the app locally
98+
````
99+
$ npm start
100+
```
101+
102+
If successful, we should get the following
103+
```
104+
info: Port 3000 is available (OK)
105+
info: Server listening on port 3000
106+
```
107+
108+
# Access the App
109+
The app can now be accessed on the browser
110+
![OWASP Juice Shop](/assets/owasp-juice-shop-home-page.png)
111+
112+
# Recap
113+
So we saw how to clone the open source juice shop and deployed it locally on our system
114+
115+
--end-of-post--
91.1 KB
Loading

0 commit comments

Comments
 (0)