Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pulling Latest changes to frontend #40

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ec6b984
Template added for the login page.
May 10, 2022
73f624d
Template for the main page that appears when you sign up.
May 12, 2022
32a5bc2
Frontend in progresss
May 13, 2022
1418452
Frontend in progress
May 17, 2022
c82840a
Frontend in progress.
May 17, 2022
ff1254b
Frontend in progress.
May 18, 2022
f8c268f
IPFS upload + Routing fix from main page
May 23, 2022
9e7f652
backend for the registration
May 23, 2022
e02f943
Merge branch 'master' of https://github.com/cerenyildirim/blockchain_…
May 23, 2022
ff51295
integration of login page with backend (gets error)
simgedemir May 26, 2022
05e4f08
Connection with Axios.
May 26, 2022
7c6edef
Login page
May 27, 2022
543031d
Login page integrated.
May 28, 2022
a0db051
Registration is done.
May 29, 2022
5ab5fcc
Metamask Connection + Truffle Smart Contract Deployment (GANACHE)
Jun 8, 2022
903ea9d
Add Signature To Blockchain Through Smart Contract
Jun 8, 2022
2934e69
getAllFiles Method Added In Smart Contract
Jun 9, 2022
1fb6f8a
Added Check To See If Signature Is Already Uploaded
Jun 9, 2022
2801663
Voting page integrated with blockchain.
Jun 9, 2022
c9001da
Voting added (user can cast multiple votes)
Jun 12, 2022
ffaec07
voting bug fixed
Jun 12, 2022
420630d
limited user to vote once through smart contract
Jun 12, 2022
6c47900
final version
simgedemir Jun 15, 2022
c48083c
fixed main page
Jun 20, 2022
667e59d
adding README
simgedemir Jun 20, 2022
c4e8828
updated readme.md
Jun 20, 2022
97e4286
slight changes to readme.md
Jun 20, 2022
fe79e55
added ipfs config commands to readme.md
Jun 20, 2022
2576be8
handled disconnection from metamask + displayed signature # when file…
Jun 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
## What is Blockchain Based CIDS?

Collavorative intrusion detection systems (CIDS) are developed to allow single IDS nodes to exchange signatures and alerts for performance improvement reasons. CIDSs combine the knowledge of different IDSs and improve the accuracy of attack detection. These systems still have major challenges such as authenticity and maintaining trust. Combining blockchain with CIDS is proposed to overcome these challenges.

Our blockchain based CIDS system is a web application where single IDSs can add suspicious signatures using smart contracts and vote for the signatures based on the result of their ML-based IDSs.

### System Requirements


| React Dependencies (npm install) | |
| :---: | :---: |
axios | babel-preset-es2015
babel-polyfill | babel-preset-env
babel-preset-stage-2 | babel-preset-stage-3
babel-register | bootstrap
fs | react
chai | chai-as-promised
chai-bignumber | express-fileupload
ipfs-http-client | js-sha256
react-bootstrap | ejs
react-dom | react-router-dom
react-scripts | react-uploader
truffle | web3

| Backend Dependencies (pip install) |
| :---: |
| django |
| djangorestframework |
| mysqlclient |


### Note
* Ganache should be installed on your system. You can download it from the following URL: https://trufflesuite.com/ganache/
* IPFS should be installed on your system as a command line tool. Follow the following tutorial: https://docs.ipfs.io/install/command-line/#official-distributions




### How to run the system

Run the following commands to allow the web3 app to use IPFS

```
$ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin "["""http://localhost:3000""", """http://127.0.0.1:5001""", """https://webui.ipfs.io""", """http://127.0.0.1:3000"""]"
```

```
$ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods "["""PUT""", """POST"""]"
```

Run the following command to run IPFS

```
$ ipfs daemon
```

Go to the "src\backend" directory and run the following command to run the backend
```
$ python manage.py runserver
```
Open the Ganache app and create a new workspace. Link truffle-config.js file in the project's main directory to the Ganache workspace.
Go to the project's main directory and run the following commands to deploy the smart contract on the blockchain for the first time
```
$ truffle compile
```
```
$ truffle migrate
```
Go to the project's main directory and run the following command to run the web3 app
```
$ npm start
```


### Servers
* Ganache: http://127.0.0.1:7545
* Django backend: http://127.0.0.1:8000/api
* IPFS: http://127.0.0.1:5001/webui
* Web3 App: http://127.0.0.1:3000
5 changes: 5 additions & 0 deletions migrations/2_deploy_contracts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const Signatures = artifacts.require("Signatures");

module.exports = function(deployer) {
deployer.deploy(Signatures);
};
Loading