Skip to content

Commit 1085cf5

Browse files
committed
test
1 parent 69447dc commit 1085cf5

1 file changed

Lines changed: 1 addition & 162 deletions

File tree

README.md

Lines changed: 1 addition & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -1,162 +1 @@
1-
# NodeGoat
2-
3-
Being lightweight, fast, and scalable, Node.js is becoming a widely adopted platform for developing web applications. This project provides an environment to learn how OWASP Top 10 security risks apply to web applications developed using Node.js and how to effectively address them.
4-
5-
## Getting Started
6-
7-
OWASP Top 10 for Node.js web applications:
8-
9-
### Know it!
10-
11-
This application bundled a tutorial page that explains the OWASP Top 10 vulnerabilities and how to fix them.
12-
13-
Once the application is running, you can access the tutorial page at [http://localhost:4000/tutorial](http://localhost:4000/tutorial) (or the port you have configured).
14-
15-
### Do it!
16-
17-
[A Vulnerable Node.js App for Ninjas](http://nodegoat.herokuapp.com/) to exploit, toast, and fix. You may like to [set up your own copy](#how-to-set-up-your-copy-of-nodegoat) of the app to fix and test vulnerabilities. Hint: Look for comments in the source code.
18-
19-
##### Default user accounts
20-
21-
The database comes pre-populated with these user accounts created as part of the seed data -
22-
* Admin Account - u:`admin` p:`Admin_123`
23-
* User Accounts (u:`user1` p:`User1_123`), (u:`user2` p:`User2_123`)
24-
* New users can also be added using the sign-up page.
25-
26-
## How to Set Up Your Copy of NodeGoat
27-
28-
### OPTION 1 - Run NodeGoat on your machine
29-
30-
1) Install [Node.js](http://nodejs.org/) - NodeGoat requires Node v8 or above
31-
32-
2) Clone the github repository:
33-
```
34-
git clone https://github.com/OWASP/NodeGoat.git
35-
```
36-
37-
3) Go to the directory:
38-
```
39-
cd NodeGoat
40-
```
41-
42-
4) Install node packages:
43-
```
44-
npm install
45-
```
46-
47-
5) Set up MongoDB. You can either install MongoDB locally or create a remote instance:
48-
49-
* Using local MongoDB:
50-
1) Install [MongoDB Community Server](https://docs.mongodb.com/manual/administration/install-community/)
51-
2) Start [mongod](http://docs.mongodb.org/manual/reference/program/mongod/#bin.mongod)
52-
53-
* Using remote MongoDB instance:
54-
1) [Deploy a MongoDB Atlas free tier cluster](https://docs.atlas.mongodb.com/tutorial/deploy-free-tier-cluster/) (M0 Sandbox)
55-
2) [Enable network access](https://docs.atlas.mongodb.com/security/add-ip-address-to-list/) to the cluster from your current IP address
56-
3) [Add a database user](https://docs.atlas.mongodb.com/tutorial/create-mongodb-user-for-cluster/) to the cluster
57-
4) Set the `MONGODB_URI` environment variable to the connection string of your cluster, which can be viewed in the cluster's
58-
[connect dialog](https://docs.atlas.mongodb.com/tutorial/connect-to-your-cluster/#connect-to-your-atlas-cluster). Select "Connect your application",
59-
set the driver to "Node.js" and the version to "2.2.12 or later". This will give a connection string in the form:
60-
```
61-
mongodb://<username>:<password>@<cluster>/<dbname>?ssl=true&replicaSet=<rsname>&authSource=admin&retryWrites=true&w=majority
62-
```
63-
The `<username>` and `<password>` fields need filling in with the details of the database user added earlier. The `<dbname>` field sets the name of the
64-
database nodegoat will use in the cluster (eg "nodegoat"). The other fields will already be filled in with the correct details for your cluster.
65-
66-
6) Populate MongoDB with the seed data required for the app:
67-
```
68-
npm run db:seed
69-
```
70-
By default this will use the "development" configuration, but the desired config can be passed as an argument if required.
71-
72-
7) Start the server. You can run the server using node or nodemon:
73-
* Start the server with node. This starts the NodeGoat application at [http://localhost:4000/](http://localhost:4000/):
74-
```
75-
npm start
76-
```
77-
* Start the server with nodemon, which will automatically restart the application when you make any changes. This starts the NodeGoat application at [http://localhost:5000/](http://localhost:5000/):
78-
```
79-
npm run dev
80-
```
81-
82-
#### Customizing the Default Application Configuration
83-
84-
By default the application will be hosted on port 4000 and will connect to a MongoDB instance at localhost:27017. To change this set the environment variables `PORT` and `MONGODB_URI`.
85-
86-
Other settings can be changed by updating the [config file](https://github.com/OWASP/NodeGoat/blob/master/config/env/all.js).
87-
88-
### OPTION 2 - Run NodeGoat on Docker
89-
90-
The repo includes the Dockerfile and docker-compose.yml necessary to set up the app and db instance, then connect them together.
91-
92-
1) Install [docker](https://docs.docker.com/installation/) and [docker compose](https://docs.docker.com/compose/install/)
93-
94-
2) Clone the github repository:
95-
```
96-
git clone https://github.com/OWASP/NodeGoat.git
97-
```
98-
99-
3) Go to the directory:
100-
```
101-
cd NodeGoat
102-
```
103-
104-
4) Build the images:
105-
```
106-
docker-compose build
107-
```
108-
109-
5) Run the app, this starts the NodeGoat application at http://localhost:4000/:
110-
```
111-
docker-compose up
112-
```
113-
114-
### OPTION 3 - Deploy to Heroku
115-
116-
This option uses a free ($0/month) Heroku node server.
117-
118-
Though not essential, it is recommended that you fork this repository and deploy the forked repo.
119-
This will allow you to fix vulnerabilities in your own forked version, then deploy and test it on Heroku.
120-
121-
1) Set up a publicly accessible MongoDB instance:
122-
1) [Deploy a MongoDB Atlas free tier cluster](https://docs.atlas.mongodb.com/tutorial/deploy-free-tier-cluster/) (M0 Sandbox)
123-
2) [Enable network access](https://docs.atlas.mongodb.com/security/ip-access-list/#add-ip-access-list-entries) to the cluster from anywhere (CIDR range 0.0.0.0/0)
124-
3) [Add a database user](https://docs.atlas.mongodb.com/tutorial/create-mongodb-user-for-cluster/) to the cluster
125-
126-
2) Deploy NodeGoat to Heroku by clicking the button below:
127-
128-
[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)
129-
130-
In the Create New App dialog, set the `MONGODB_URI` config var to the connection string of your MongoDB Atlas cluster.
131-
This can be viewed in the cluster's [connect dialog](https://docs.atlas.mongodb.com/tutorial/connect-to-your-cluster/#connect-to-your-atlas-cluster).
132-
Select "Connect your application", set the driver to "Node.js" and the version to "2.2.12 or later".
133-
This will give a connection string in the form:
134-
```
135-
mongodb://<username>:<password>@<cluster>/<dbname>?ssl=true&replicaSet=<rsname>&authSource=admin&retryWrites=true&w=majority
136-
```
137-
The `<username>` and `<password>` fields need filling in with the details of the database user added earlier. The `<dbname>` field sets the name of the
138-
database nodegoat will use in the cluster (eg "nodegoat"). The other fields will already be filled in with the correct details for your cluster.
139-
140-
## Report bugs, Feedback, Comments
141-
142-
* Open a new [issue](https://github.com/OWASP/NodeGoat/issues) or contact team by joining chat at [Slack](https://owasp.slack.com/messages/project-nodegoat/) or [![Join the chat at https://gitter.im/OWASP/NodeGoat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/OWASP/NodeGoat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
143-
144-
## Contributing
145-
146-
Please Follow [the contributing guide](CONTRIBUTING.md)
147-
148-
## Code Of Conduct (CoC)
149-
150-
This project is bound by a [Code of Conduct](CODE_OF_CONDUCT.md).
151-
152-
## Contributors
153-
154-
Here are the amazing [contributors](https://github.com/OWASP/NodeGoat/graphs/contributors) to the NodeGoat project.
155-
156-
## Supports
157-
158-
- Thanks to JetBrains for providing licenses to fantastic [WebStorm IDE](https://www.jetbrains.com/webstorm/) to build this project.
159-
160-
## License
161-
162-
Code licensed under the [Apache License v2.0.](http://www.apache.org/licenses/LICENSE-2.0)
1+
readme2

0 commit comments

Comments
 (0)