{"id":13588897,"url":"https://github.com/luke-feng/MAP","last_synced_at":"2025-04-08T06:33:02.769Z","repository":{"id":52106066,"uuid":"317218702","full_name":"luke-feng/MAP","owner":"luke-feng","description":"This is a master project takes place in CSG at UZH.","archived":false,"fork":false,"pushed_at":"2021-05-07T11:54:13.000Z","size":27523,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-06T08:43:23.335Z","etag":null,"topics":["cybersecurity","data-visualization"],"latest_commit_sha":null,"homepage":"","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luke-feng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-30T12:36:02.000Z","updated_at":"2021-11-30T19:38:54.000Z","dependencies_parsed_at":"2022-09-06T07:54:43.951Z","dependency_job_id":null,"html_url":"https://github.com/luke-feng/MAP","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luke-feng%2FMAP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luke-feng%2FMAP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luke-feng%2FMAP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luke-feng%2FMAP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luke-feng","download_url":"https://codeload.github.com/luke-feng/MAP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247792244,"owners_count":20996880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cybersecurity","data-visualization"],"created_at":"2024-08-01T15:07:00.722Z","updated_at":"2025-04-08T06:32:57.759Z","avatar_url":"https://github.com/luke-feng.png","language":"Vue","funding_links":[],"categories":["Vue"],"sub_categories":[],"readme":"# SHINE\n\u003e A collaborative system for sharing information and economic impacts of cyberattacks\n\n[![SHINE](https://res.cloudinary.com/marcomontalbano/image/upload/v1620053813/video_to_markdown/images/youtube--xXJiNNBJznY-c05b58ac6eb4c4700831b2b3070cd403.jpg)](https://www.youtube.com/watch?v=xXJiNNBJznY \"SHINE\")\n\n## Table of Contents\n\n   * [SHINE](#SHINE)\n      * [Introduction](#SHINE)\n   * [Front End](#front-end)\n      * [miner](#miner)\n      * [api](#api)\n      * [frontend](#frontend)\n   * [Back End](#Back-End)\n      * [Installing required third-party packages](#Installing-required-third-party-packages)\n      * [Configure the path](#Configure-the-path)\n      * [Add IP address to the white list](#Add-IP-address-to-the-white-list)\n      * [Start the server](#Start-the-server)\n   * [Reference](#Reference)\n\n## SHINE\n\nThis project consist of two parts:\n* The `Front End` is mainly inherited from DDoSGrid project, which used Vue.js as their developing language, and containts three parts, the `miner`, the `api` and the `frontend`.\n\t* The `miner` subproject is a packet decoder and feature extractor that produces output as JSON files and communicates over stdout or an IPC channel if available.\n\t* The `api` is a RESTful api based on Express.js which orchestrates the `miner` package if required.\n\t* The `frontend` is a Vue.js based SPA that renders visualizations obtained from the api.\n* The `Back End` is responsible for data processing, data management, and applications communication. Our Back End system is based on Django.  There are 10 applications functioning in the back-end. \n   * The `application` application is used to process the join in application of interested persons.\n   * The `attack_feature` application is used to handle some data extracted from the PCAP files.\n   * The `attack_information` application is responsible for process single incidents related data, such as the financial loss caused by the incident and the technical detail about the incident. This application also in charge of providing data for `Incident Statistic` part and `Ecomonic Impact` part of system.  \n   * The `city_country` application provides the city and country options for users to choose.\n   * The `information_sharing` application manages the options for technical related multiple choices and provide users with those options to choose from.\n   * The `measure` application deals with the countermeasures set by users against cyberattacks.\n   * The `measure_type` application manages the predefined countermeasures for users to select from.\n   * The `organization` application is used to handle organization related data and provide users with options.\n   * The `sector` application is used to handle sector related information and provide options as well.\n   * The `user_info` application is used to process the user related information.\n\n   And within each application, there are six python files been used to make sure the system functioning as designed.\n   \n   * `admin.py` is related to the settings of Django admin site.\n   * `app.py` is where the application configuration metadata for an application being stored.\n   * `model.py` is the place where data models are defined matching with the tables in the database.\n   * `serializers.py` is the place to define serializers for data models which are reponsible for data validation and conversion.\n   * `urls.py` is where the URLs configurations being set to dispatch requests to appropriate methods for processing.\n   * `views.py` is where all the `views` belong to, and each `view` contains concrete implementations of methods to handle requests.\n\nThe following shows the outline structure of the SHINE system.\n   ```bash\n      |—— api \n      |—— application\n      |—— attack_features\n      |—— attack_information \n      |—— city_country \n      |—— docker-compose.ysl \n      |—— Dockerfile \n      |—— Economic.db \n      |—— frontend \n      |—— information_sharing \n      |—— LICENSE \n      |—— manage.py \n      |—— measure \n      |—— measure_type \n      |—— miner \n      |—— models.py \n      |—— organization \n      |—— README.md \n      |—— sector \n      |—— SHINE \n      |—— user_info \n   ```\n\nThe following applications and programs must be installed on the target machine before the installation. \n```bash\n      * Node.js\n      * npm\n      * git\n      * Python, Version \u003e= 3.6\n      * pip\n      * Django 3\n      * libpcap\n      * SSH Client\n```\n\n# Front End\n\nClone the project from github:\n```\ngit clone git@github.com:luke-feng/MAP.git\n```\n\n## miner\nEnter the `miner` subproject and install the necessary dependencies. Make sure you are running Node.JS version 10 and that you lave libpcap installed.\n```bash\ncd miner\nnpm i\n```\nAfter that the miner package can be imported as an NPM module or it can be run manually through the shell. \nFor details of this part, please refer to the DDoSGrid project. (https://github.com/ddosgrid/ddosgrid-v2)\n\n## api\nSetting up the api is straightforward simply fetch the dependencies and start the main javascript file. Make sure that you have previously installed the dependencies of the miner!\n```bash\ncd miner; npm i; cd ..;\ncd api; npm i\n```\nNow simply run it and optionally pass the port where it should listen:\n```bash\nnode index.js\n```\nor\n```bash\nexport PORT=1234; node index.js\n```\nor by using the scripts(recommended)\n```bash\n./scripts/start_dev_server.sh\n```\nYou may need to change  `CLIENT_APP_ORIGIN `, ` OAUTH2_SUCCESS_FORWARD`, `OAUTH2_CALLBACK ` to your own IP and service port in the `api/scripts/start_dev_server.sh` script file.\n\nIt will automaticly listen on `8080` port. And you can change the technical details in `api/scripts/start_dev_server.sh`, like the `port` and `CLIENT_APP_ORIGIN`.\n\n\n## frontend\nEnter the `frontend` subproject and run it after fetching its dependencies\n```bash\nnpm i\n```\nThis will automatically rebuild the project if a file changes. \nTo use the application you will need to let it connect to an api instance.\nTo connect it with our `Back End`, you can run the build commend\n\n```bash\nnpm run build\n```\nIt will packet the frontend project, and connect with Django backend.\n\n# Back End\n## Installing required third-party packages\nWith the `pip` being installed, you can use this command to install packages. Run the following commands to install required third-party packages for the SHINE system.\n```bash\npip install djangorestframework\npip install django-filter\npip install django-smart-selects\npip install django-cors-headers\npip install django-unixtimestampfield\npip install geonamescache\n```\nIf you would like to install other packages, please do not forget to add them to the `INSTALLED_APP` list inside the `settings.py` file.\n\n## Configure the path\nFor this step, you need have your server IP address and the port number that provides service for the DDoSGrid system in hand. Fine the hidden file `.env.production`, open the file and locate yourself to the line that sets `VUE_APP_APIBASEURL` and `VUE_APP_SHINEBASEURL`, and modify it follow the following format.\n```bash\nVUE_APP_APIBASEURL = http://`your server IP address`:`DDoSGrid service port`\nVUE_APP_SHINEBASEURL = http://`your server IP address`:`BackEnd service port`\n```\n\n## Add IP address to the white list\nBefore you can start run the service, you need to add the server IP address to the trusted white list. To do so, you need go find the file `settings.py` under the SHINE folder. Open the file and find the place where the `ALLOWED_HOSTS` and `CORS_ORIGIN_WHITELIST`, and append your server IP address to the end of the list.\n\n## Start the server\nTo start the server, run the following command within the folder that stores the `manage.py` file.\n```bash\npython manage.py runsever\n```\nAnd the terminal will tell you the which port is currently carrying the service.\n\n# Reference\n* Chao Feng, Qiaowen Wang, Xianxiao Xu: SHINE: a Collaborative System for Sharing Insights and Information of Economic Impacts of Cyberattacks; Universität Zürich, Communication Systems Group, Department of Informatics, Zürich, Switzerland, May 2021, URL: https://files.ifi.uzh.ch/CSG/staff/franco/extern/theses/MAP-SHINE.pdf.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluke-feng%2FMAP","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluke-feng%2FMAP","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluke-feng%2FMAP/lists"}