├── README.md ├── vulnerability-backend ├── Procfile ├── Procfile.windows ├── main.py ├── model.py ├── requirements.txt ├── runtime.txt ├── user.py └── vulnerability.py └── vulnerability-frontend ├── .gitattributes ├── .gitignore ├── README.md ├── package-lock.json ├── package.json ├── public ├── _redirects │ ├── favicon.ico │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── robots.txt ├── favicon.ico ├── index.html ├── logo192.png ├── logo512.png ├── manifest.json ├── netlify.toml └── robots.txt └── src ├── App.css ├── App.js ├── auth ├── auth.js ├── login.js ├── protected-route.js └── register.js ├── images └── logo.svg ├── index.css ├── index.js └── pages ├── Home.js ├── Login.js ├── Signup.js └── editForm.js /README.md: -------------------------------------------------------------------------------- 1 | # Vulnerability 2 | 3 | 4 | 5 | ## Getting started 6 | 7 | To make it easy for you to get started with GitLab, here's a list of recommended next steps. 8 | 9 | Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! 10 | 11 | ## Add your files 12 | 13 | - [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files 14 | - [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: 15 | 16 | ``` 17 | cd existing_repo 18 | git remote add origin https://gitlab.com/ITopGun/vulnerability.git 19 | git branch -M main 20 | git push -uf origin main 21 | ``` 22 | 23 | ## Integrate with your tools 24 | 25 | - [ ] [Set up project integrations](https://gitlab.com/ITopGun/vulnerability/-/settings/integrations) 26 | 27 | ## Collaborate with your team 28 | 29 | - [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) 30 | - [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) 31 | - [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) 32 | - [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) 33 | - [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) 34 | 35 | ## Test and Deploy 36 | 37 | Use the built-in continuous integration in GitLab. 38 | 39 | - [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) 40 | - [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) 41 | - [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) 42 | - [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) 43 | - [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) 44 | 45 | *** 46 | 47 | # Editing this README 48 | 49 | When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template. 50 | 51 | ## Suggestions for a good README 52 | Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. 53 | 54 | ## Name 55 | Choose a self-explaining name for your project. 56 | 57 | ## Description 58 | Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. 59 | 60 | ## Badges 61 | On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. 62 | 63 | ## Visuals 64 | Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. 65 | 66 | ## Installation 67 | Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. 68 | 69 | ## Usage 70 | Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. 71 | 72 | ## Support 73 | Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. 74 | 75 | ## Roadmap 76 | If you have ideas for releases in the future, it is a good idea to list them in the README. 77 | 78 | ## Contributing 79 | State if you are open to contributions and what your requirements are for accepting them. 80 | 81 | For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. 82 | 83 | You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. 84 | 85 | ## Authors and acknowledgment 86 | Show your appreciation to those who have contributed to the project. 87 | 88 | ## License 89 | For open source projects, say how it is licensed. 90 | 91 | ## Project status 92 | If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. 93 | -------------------------------------------------------------------------------- /vulnerability-backend/Procfile: -------------------------------------------------------------------------------- 1 | web: gunicorn -w 4 -k uvicorn.workers.UvicornWorker main:app -------------------------------------------------------------------------------- /vulnerability-backend/Procfile.windows: -------------------------------------------------------------------------------- 1 | web: uvicorn main:app --reload -------------------------------------------------------------------------------- /vulnerability-backend/main.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from fastapi.middleware.cors import CORSMiddleware 5 | from fastapi import FastAPI, Request, Depends, HTTPException 6 | from user import User, UserCreate, UserUpdate, UserDB, auth_backends, fastapi_users 7 | from vulnerability import ( 8 | create_vulnerability, 9 | fetch_all_vulnerabilities, 10 | update_vulnerability, 11 | fetch_one_vulnerability, 12 | remove_vulnerability, 13 | ) 14 | from model import VulnerabilityOutput, VulnerabilityInput 15 | 16 | # Initiating FastAPI Server 17 | app = FastAPI() 18 | 19 | # Managing CORS for the React Frontend connections 20 | origins = ["*"] 21 | 22 | app.add_middleware( 23 | CORSMiddleware, 24 | allow_origins=origins, 25 | allow_credentials=True, 26 | allow_methods=["*"], 27 | allow_headers=["*"] 28 | ) 29 | 30 | 31 | # --- User Authentication Routes ---------------------------------------------- 32 | 33 | # Learn more at https://frankie567.github.io/fastapi-users/configuration/routers/ 34 | 35 | # Add route for Login POST "/auth/login", "/auth/register" 36 | app.include_router( 37 | fastapi_users.get_auth_router(auth_backends[0]), 38 | prefix="/auth", 39 | tags=["auth"] 40 | ) 41 | 42 | 43 | def on_after_register(user: UserDB, request: Request): 44 | print("User {user.id} has registered.") 45 | 46 | 47 | app.include_router( 48 | # fastapi_users.get_register_router(), 49 | fastapi_users.get_register_router(on_after_register), 50 | prefix="/auth", 51 | tags=["auth"] 52 | ) 53 | 54 | # Add route for User utilities "/auth/users/*" 55 | 56 | """ 57 | Get current logged in user profile GET "/auth/users/me" 58 | Update current logged in user profile PATCH "/auth/users/me" 59 | Get "_id" user profile GET "/auth/users/" 60 | Update "_id" user profile PATCH "/auth/users/{id}" 61 | Delete "_id" user profile DELETE "/auth/users/{id}" 62 | """ 63 | 64 | app.include_router( 65 | fastapi_users.get_users_router(), 66 | prefix="/auth/users", 67 | tags=["auth"] 68 | ) 69 | 70 | # Add route for Reset Password utility 71 | 72 | """ 73 | Forgot Password POST /auth/users/forgot-password 74 | Reset Password POST /auth/users/reset-password 75 | """ 76 | 77 | app.include_router( 78 | fastapi_users.get_reset_password_router("SECRET"), 79 | prefix="/auth/users", 80 | tags=["auth"] 81 | ) 82 | 83 | # ----------------- Vulnerability CRUD urls -------------------------------- 84 | 85 | 86 | @app.get("/api/vulnerability", tags=["vulnerability solution crud"]) 87 | async def get_vulnerability(user: User = Depends(fastapi_users.get_current_user)): 88 | response = await fetch_all_vulnerabilities() 89 | return response 90 | 91 | 92 | @app.post("/api/vulnerability/", response_model=VulnerabilityOutput, tags=["vulnerability solution crud"]) 93 | async def post_vulnerability(vulnerability: VulnerabilityInput, user: User = Depends(fastapi_users.get_current_user)): 94 | response = await create_vulnerability(vulnerability.dict()) 95 | if not user.is_superuser: 96 | HTTPException(400, "You are not admin.") 97 | if response: 98 | return response 99 | raise HTTPException(400, "Something went wrong") 100 | 101 | 102 | @app.put("/api/vulnerability/{id}/", response_model=VulnerabilityOutput, tags=["vulnerability solution crud"]) 103 | async def put_vulnerability(id: str, body: VulnerabilityInput, user: User = Depends(fastapi_users.get_current_user)): 104 | response = await update_vulnerability(id, body) 105 | if not user.is_superuser: 106 | HTTPException(400, "You are not admin.") 107 | if response: 108 | return response 109 | raise HTTPException( 110 | 404, f"There is no vulnerability with the id {id}") 111 | 112 | 113 | @app.get("/api/vulnerability/{id}", response_model=VulnerabilityOutput, tags=["vulnerability solution crud"]) 114 | async def get_vulnerability_by_id(id, user: User = Depends(fastapi_users.get_current_user)): 115 | response = await fetch_one_vulnerability(id) 116 | if response: 117 | return response 118 | raise HTTPException( 119 | 404, f"There is no vulnerability with the id {id}") 120 | 121 | 122 | @app.delete("/api/vulnerability/{id}", tags=["vulnerability solution crud"]) 123 | async def delete_vulnerability(id, user: User = Depends(fastapi_users.get_current_user)): 124 | response = await remove_vulnerability(id) 125 | if not user.is_superuser: 126 | HTTPException(400, "You are not admin.") 127 | if response: 128 | return {"result": True, "msg": "Successfully deleted vulnerability", "_id": id} 129 | raise HTTPException( 130 | 404, f"There is no vulnerability with the id {id}") 131 | -------------------------------------------------------------------------------- /vulnerability-backend/model.py: -------------------------------------------------------------------------------- 1 | from pydantic import BaseModel, Field 2 | from typing import Dict, Optional 3 | from bson import ObjectId 4 | 5 | 6 | class PyObjectId(ObjectId): 7 | 8 | @classmethod 9 | def __get_validators__(cls): 10 | yield cls.validate 11 | 12 | @classmethod 13 | def validate(cls, v): 14 | if not ObjectId.is_valid(v): 15 | raise ValueError('Invalid objectid') 16 | return ObjectId(v) 17 | 18 | @classmethod 19 | def __modify_schema__(cls, field_schema): 20 | field_schema.update(type='string') 21 | 22 | 23 | class VulnerabilityInput(BaseModel): 24 | type: str 25 | cve: str 26 | name: str 27 | solution: str 28 | 29 | 30 | class VulnerabilityOutput(BaseModel): 31 | id: Optional[PyObjectId] = Field(alias='_id') 32 | type: str 33 | cve: str 34 | name: str 35 | solution: str 36 | 37 | class Config: 38 | arbitrary_types_allowed = True 39 | json_encoders = { 40 | ObjectId: str 41 | } 42 | -------------------------------------------------------------------------------- /vulnerability-backend/requirements.txt: -------------------------------------------------------------------------------- 1 | fastapi==0.61.1 2 | fastapi-users==3.0.5 3 | uvicorn==0.11.8 4 | motor==2.2.0 5 | gunicorn 6 | -------------------------------------------------------------------------------- /vulnerability-backend/runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.8.13 -------------------------------------------------------------------------------- /vulnerability-backend/user.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | import motor.motor_asyncio 5 | from fastapi_users import FastAPIUsers, models 6 | from fastapi_users.db import MongoDBUserDatabase 7 | from fastapi_users.authentication import JWTAuthentication 8 | 9 | # --- MongoDB Setup ----------------------------------------------------------- 10 | 11 | # MongoDB Configurations 12 | DATABASE_URL = "mongodb://localhost:27017" 13 | client = motor.motor_asyncio.AsyncIOMotorClient( 14 | DATABASE_URL, uuidRepresentation="standard" 15 | ) 16 | database = client["vulnerability_db"] 17 | 18 | # MongoDB users collection instance ("users" by default, can be changed) 19 | collection = database["users"] 20 | 21 | 22 | # --- Users Collection Schema Setup ------------------------------------------- 23 | 24 | # Pydantic models for MongoDB "User" collection schema 25 | # Learn more at https://frankie567.github.io/fastapi-users/configuration/model/ 26 | 27 | class User(models.BaseUser): 28 | firstName: str 29 | lastName: str 30 | 31 | 32 | class UserCreate(models.BaseUserCreate): 33 | firstName: str 34 | lastName: str 35 | 36 | 37 | class UserUpdate(User, models.BaseUserUpdate): 38 | pass 39 | 40 | 41 | class UserDB(User, models.BaseUserDB): 42 | pass 43 | 44 | # --- Authentication Method Setup --------------------------------------------- 45 | 46 | 47 | # Secret Key (must be changed from "SECRET") 48 | SECRET = "SECRET" 49 | 50 | # Authentication Method JWT 51 | auth_backends = [] 52 | authentication = JWTAuthentication(secret=SECRET, lifetime_seconds=3600) 53 | auth_backends.append(authentication) 54 | 55 | 56 | # --- FastAPIUsers Object Declaration ----------------------------------------- 57 | 58 | # MongoDB "users" collection adaptor for API calls 59 | user_db = MongoDBUserDatabase(UserDB, collection) 60 | 61 | # FastAPI Users helper class with all the configurations from above 62 | # It provides us all the routes 63 | fastapi_users = FastAPIUsers( 64 | user_db, 65 | auth_backends, 66 | User, 67 | UserCreate, 68 | UserUpdate, 69 | UserDB 70 | ) 71 | -------------------------------------------------------------------------------- /vulnerability-backend/vulnerability.py: -------------------------------------------------------------------------------- 1 | import motor.motor_asyncio 2 | from model import VulnerabilityOutput 3 | from bson import ObjectId 4 | 5 | 6 | DATABASE_URL = "mongodb://localhost:27017" 7 | client = motor.motor_asyncio.AsyncIOMotorClient( 8 | DATABASE_URL, uuidRepresentation="standard" 9 | ) 10 | 11 | db = client['vulnerability_db'] 12 | vulnerability_tb = db['vulnerability'] 13 | 14 | 15 | async def fetch_all_vulnerabilities(): 16 | vulnerabilities = [] 17 | cursor = vulnerability_tb.find({}) 18 | async for document in cursor: 19 | vulnerabilities.append(VulnerabilityOutput(**document)) 20 | 21 | print(vulnerabilities) 22 | return vulnerabilities 23 | 24 | 25 | async def create_vulnerability(vulnerability): 26 | document = vulnerability 27 | result = await vulnerability_tb.insert_one(document) 28 | return document 29 | 30 | 31 | async def update_vulnerability(id, body): 32 | print(body, body.cve) 33 | await vulnerability_tb.update_one({"_id": ObjectId(id)}, {"$set": { 34 | "type": body.type, "cve": body.cve, "name": body.name, "solution": body.solution}}) 35 | document = await vulnerability_tb.find_one({"_id": ObjectId(id)}) 36 | return document 37 | 38 | 39 | async def fetch_one_vulnerability(id): 40 | document = await vulnerability_tb.find_one({"_id": ObjectId(id)}) 41 | return document 42 | 43 | 44 | async def remove_vulnerability(id): 45 | await vulnerability_tb.delete_one({"_id": ObjectId(id)}) 46 | return True 47 | -------------------------------------------------------------------------------- /vulnerability-frontend/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /vulnerability-frontend/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | build/ -------------------------------------------------------------------------------- /vulnerability-frontend/README.md: -------------------------------------------------------------------------------- 1 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 2 | 3 | ## Available Scripts 4 | 5 | In the project directory, you can run: 6 | 7 | ### `npm start` 8 | 9 | Runs the app in the development mode.
10 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 11 | 12 | The page will reload if you make edits.
13 | You will also see any lint errors in the console. 14 | 15 | ### `npm test` 16 | 17 | Launches the test runner in the interactive watch mode.
18 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 19 | 20 | ### `npm run build` 21 | 22 | Builds the app for production to the `build` folder.
23 | It correctly bundles React in production mode and optimizes the build for the best performance. 24 | 25 | The build is minified and the filenames include the hashes.
26 | Your app is ready to be deployed! 27 | 28 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 29 | 30 | ### `npm run eject` 31 | 32 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 33 | 34 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 35 | 36 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 37 | 38 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 39 | 40 | ## Learn More 41 | 42 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 43 | 44 | To learn React, check out the [React documentation](https://reactjs.org/). 45 | 46 | ### Code Splitting 47 | 48 | This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting 49 | 50 | ### Analyzing the Bundle Size 51 | 52 | This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size 53 | 54 | ### Making a Progressive Web App 55 | 56 | This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app 57 | 58 | ### Advanced Configuration 59 | 60 | This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration 61 | 62 | ### Deployment 63 | 64 | This section has moved here: https://facebook.github.io/create-react-app/docs/deployment 65 | 66 | ### `npm run build` fails to minify 67 | 68 | This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify 69 | -------------------------------------------------------------------------------- /vulnerability-frontend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "frontend", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@progress/kendo-data-query": "^1.5.6", 7 | "@progress/kendo-drawing": "^1.16.3", 8 | "@progress/kendo-licensing": "^1.2.2", 9 | "@progress/kendo-react-animation": "^5.3.0", 10 | "@progress/kendo-react-buttons": "^5.3.0", 11 | "@progress/kendo-react-data-tools": "^5.3.0", 12 | "@progress/kendo-react-dateinputs": "^5.3.0", 13 | "@progress/kendo-react-dialogs": "^5.3.0", 14 | "@progress/kendo-react-dropdowns": "^5.3.0", 15 | "@progress/kendo-react-excel-export": "^5.3.0", 16 | "@progress/kendo-react-form": "^5.3.0", 17 | "@progress/kendo-react-grid": "^5.3.0", 18 | "@progress/kendo-react-inputs": "^5.3.0", 19 | "@progress/kendo-react-intl": "^5.3.0", 20 | "@progress/kendo-react-notification": "^5.3.0", 21 | "@progress/kendo-react-pdf": "^5.3.0", 22 | "@progress/kendo-react-treeview": "^5.3.0", 23 | "@progress/kendo-theme-default": "^5.3.0", 24 | "@testing-library/jest-dom": "^5.16.4", 25 | "@testing-library/react": "^9.5.0", 26 | "@testing-library/user-event": "^7.2.1", 27 | "bootstrap": "^5.1.3", 28 | "jwt-decode": "^2.2.0", 29 | "react": "^16.14.0", 30 | "react-bootstrap": "^2.3.1", 31 | "react-csv": "^2.2.2", 32 | "react-dom": "^16.14.0", 33 | "react-icons": "^3.11.0", 34 | "react-router-dom": "^5.3.1", 35 | "react-scripts": "^4.0.1" 36 | }, 37 | "overrides": { 38 | "autoprefixer": "10.4.5" 39 | }, 40 | "resolutions": { 41 | "autoprefixer": "10.4.5" 42 | }, 43 | "scripts": { 44 | "start": "react-scripts start", 45 | "build": "react-scripts build", 46 | "test": "react-scripts test", 47 | "eject": "react-scripts eject" 48 | }, 49 | "browserslist": { 50 | "production": [ 51 | ">0.2%", 52 | "not dead", 53 | "not op_mini all" 54 | ], 55 | "development": [ 56 | "last 1 chrome version", 57 | "last 1 firefox version", 58 | "last 1 safari version" 59 | ] 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /vulnerability-frontend/public/_redirects/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITopGun/Vulnerability-Hub/f8fc5d8eab264b52433b51d8492793132932c06b/vulnerability-frontend/public/_redirects/favicon.ico -------------------------------------------------------------------------------- /vulnerability-frontend/public/_redirects/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | React Application 28 | 29 | 30 | 31 |
32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /vulnerability-frontend/public/_redirects/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITopGun/Vulnerability-Hub/f8fc5d8eab264b52433b51d8492793132932c06b/vulnerability-frontend/public/_redirects/logo192.png -------------------------------------------------------------------------------- /vulnerability-frontend/public/_redirects/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITopGun/Vulnerability-Hub/f8fc5d8eab264b52433b51d8492793132932c06b/vulnerability-frontend/public/_redirects/logo512.png -------------------------------------------------------------------------------- /vulnerability-frontend/public/_redirects/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React", 3 | "name": "React", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /vulnerability-frontend/public/_redirects/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /vulnerability-frontend/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITopGun/Vulnerability-Hub/f8fc5d8eab264b52433b51d8492793132932c06b/vulnerability-frontend/public/favicon.ico -------------------------------------------------------------------------------- /vulnerability-frontend/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | React Application 28 | 29 | 30 | 31 |
32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /vulnerability-frontend/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITopGun/Vulnerability-Hub/f8fc5d8eab264b52433b51d8492793132932c06b/vulnerability-frontend/public/logo192.png -------------------------------------------------------------------------------- /vulnerability-frontend/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITopGun/Vulnerability-Hub/f8fc5d8eab264b52433b51d8492793132932c06b/vulnerability-frontend/public/logo512.png -------------------------------------------------------------------------------- /vulnerability-frontend/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React", 3 | "name": "React", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /vulnerability-frontend/public/netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | command = "npm run build" 3 | publish = "/build" 4 | base = "/" 5 | 6 | [[redirects]] 7 | from = "/*" 8 | to = "/index.html" 9 | status = 200 -------------------------------------------------------------------------------- /vulnerability-frontend/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /vulnerability-frontend/src/App.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITopGun/Vulnerability-Hub/f8fc5d8eab264b52433b51d8492793132932c06b/vulnerability-frontend/src/App.css -------------------------------------------------------------------------------- /vulnerability-frontend/src/App.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { BrowserRouter, Route } from 'react-router-dom'; 3 | import 'bootstrap/dist/css/bootstrap.min.css'; 4 | import '@progress/kendo-theme-default/dist/all.css'; 5 | import { Home } from './pages/Home'; 6 | import { LoginPage } from './pages/Login'; 7 | import { SignupPage } from './pages/Signup'; 8 | import { ProtectedRoute } from './auth/protected-route'; 9 | import './App.css'; 10 | 11 | function App() { 12 | return ( 13 | // Router Code 14 | 15 |
16 | {/* */} 17 | 23 | 29 | 35 |
36 |
37 | ); 38 | }; 39 | export default App; 40 | -------------------------------------------------------------------------------- /vulnerability-frontend/src/auth/auth.js: -------------------------------------------------------------------------------- 1 | import decodeJwt from 'jwt-decode'; 2 | 3 | // const API = 'http://localhost:8000'; 4 | const API = 'https://vulnerability-backend.herokuapp.com'; 5 | 6 | class Auth { 7 | login = async (email, password) => { 8 | // Assert email is not empty 9 | if (!(email.length > 0)) { 10 | throw new Error('Email was not provided'); 11 | } 12 | // Assert password is not empty 13 | if (!(password.length > 0)) { 14 | throw new Error('Password was not provided'); 15 | } 16 | // Create data JSON 17 | const formData = new FormData(); 18 | formData.append('username', email); 19 | formData.append('password', password); 20 | // Create request 21 | const request = new Request(`${API}/auth/login`, { 22 | method: 'POST', 23 | body: formData, 24 | }); 25 | // Fetch request 26 | const response = await fetch(request); 27 | // 500 error handling 28 | if (response.status === 500) { 29 | throw new Error('Internal server error'); 30 | } 31 | // Extracting response data 32 | const data = await response.json(); 33 | console.log(data) 34 | // 400 error handling 35 | if (response.status >= 400 && response.status < 500) { 36 | if (data.detail) { 37 | throw data.detail; 38 | } 39 | throw data; 40 | } 41 | // Successful login handling 42 | if ('access_token' in data) { 43 | // eslint-disable-next-line 44 | const decodedToken = decodeJwt(data['access_token']); 45 | // console.log(decodedToken) 46 | localStorage.setItem('token', data['access_token']); 47 | localStorage.setItem('permissions', 'user'); 48 | } 49 | return data 50 | }; 51 | 52 | register = async (firstName, lastName, email, password, passwordConfirmation) => { 53 | // Assert firstName, lastName and phone not empty 54 | if (!((firstName.length) > 0)) { 55 | throw new Error('First Name was not provided'); 56 | } 57 | // Assert firstName, lastName and phone not empty 58 | if (!((lastName.length) > 0)) { 59 | throw new Error('Last Name was not provided'); 60 | } 61 | // Assert email is not empty 62 | if (!(email.length > 0)) { 63 | throw new Error('Email was not provided'); 64 | } 65 | // Assert password is not empty 66 | if (!(password.length > 0)) { 67 | throw new Error('Password was not provided'); 68 | } 69 | // Assert password confirmation is not empty 70 | if (!(passwordConfirmation.length > 0)) { 71 | throw new Error('Password confirmation was not provided'); 72 | } 73 | // Assert email or password or password confirmation is not empty 74 | if (password !== passwordConfirmation) { 75 | throw new Error('Passwords do not match') 76 | } 77 | // Create data JSON 78 | const formData = { 79 | "email": email, 80 | "password": password, 81 | "firstName": firstName, 82 | "lastName": lastName, 83 | } 84 | // Create request 85 | const request = new Request(`${API}/auth/register`, { 86 | method: 'POST', 87 | body: JSON.stringify(formData), 88 | }); 89 | // Fetch request 90 | const response = await fetch(request); 91 | // 500 error handling 92 | if (response.status === 500) { 93 | throw new Error('Internal server error'); 94 | } 95 | // 400 error handling 96 | const data = await response.json(); 97 | if (response.status >= 400 && response.status < 500) { 98 | if (data.detail) { 99 | throw data.detail; 100 | } 101 | throw data; 102 | } 103 | // Successful login handling 104 | if ('access_token' in data) { 105 | // eslint-disable-next-line 106 | const decodedToken = decodeJwt(data['access_token']); 107 | // console.log(decodedToken) 108 | localStorage.setItem('token', data['access_token']); 109 | localStorage.setItem('permissions', 'user'); 110 | } 111 | return data; 112 | }; 113 | 114 | logout = (callback) => { 115 | localStorage.removeItem('token'); 116 | localStorage.removeItem('permissions'); 117 | // Using a callback to load '/' when logout is called 118 | callback(); 119 | }; 120 | 121 | getUser = async () => { 122 | const token = localStorage.getItem('token'); 123 | // Create request 124 | const request = new Request(`${API}/auth/users/me`, { 125 | method: 'GET', 126 | headers: {'Authorization': `Bearer ${token}`} 127 | }); 128 | // Fetch request 129 | const response = await fetch(request); 130 | const data = await response.json(); 131 | return data 132 | }; 133 | 134 | getVulnerabilities = async () => { 135 | const token = localStorage.getItem('token'); 136 | // Create request 137 | const request = new Request(`${API}/api/vulnerability`, { 138 | method: 'GET', 139 | headers: {'Authorization': `Bearer ${token}`} 140 | }); 141 | // Fetch request 142 | const response = await fetch(request); 143 | const data = await response.json(); 144 | console.log(data); 145 | return data 146 | }; 147 | 148 | saveVulnerability = async (formVulnerability) => { 149 | const token = localStorage.getItem('token'); 150 | // Create request 151 | const request = new Request(`${API}/api/vulnerability/${formVulnerability._id}/`, { 152 | method: 'PUT', 153 | headers: { 154 | 'Content-Type': 'application/json', 155 | 'Authorization': `Bearer ${token}` 156 | }, 157 | body: JSON.stringify({type: formVulnerability.type, cve: formVulnerability.cve, name: formVulnerability.name, solution: formVulnerability.solution}) 158 | }); 159 | // Fetch request 160 | const response = await fetch(request); 161 | const data = await response.json(); 162 | console.log(data); 163 | return data 164 | } 165 | 166 | addVulnerability = async (formVulnerability) => { 167 | const token = localStorage.getItem('token'); 168 | // Create request 169 | const request = new Request(`${API}/api/vulnerability/`, { 170 | method: 'POST', 171 | headers: { 172 | 'Content-Type': 'application/json', 173 | 'Authorization': `Bearer ${token}` 174 | }, 175 | body: JSON.stringify({type: formVulnerability.type, cve: formVulnerability.cve, name: formVulnerability.name, solution: formVulnerability.solution}) 176 | }); 177 | // Fetch request 178 | const response = await fetch(request); 179 | const data = await response.json(); 180 | console.log(data); 181 | return data 182 | } 183 | 184 | deleteVulnerability = async (formVulnerability) => { 185 | const token = localStorage.getItem('token'); 186 | // Create request 187 | const request = new Request(`${API}/api/vulnerability/${formVulnerability._id}`, { 188 | method: 'Delete', 189 | headers: { 190 | 'Authorization': `Bearer ${token}` 191 | } 192 | }); 193 | // Fetch request 194 | const response = await fetch(request); 195 | const data = await response.json(); 196 | console.log(data); 197 | return data 198 | } 199 | 200 | isAuthenticated = () => { 201 | const permissions = localStorage.getItem('permissions'); 202 | console.log(permissions); 203 | if (!permissions) { 204 | return false; 205 | } 206 | if(permissions === 'user') { 207 | // var currentUser = await this.getUser(); 208 | // if(currentUser.id) return true; 209 | // else return false; 210 | return true; 211 | } else { 212 | return false; 213 | } 214 | }; 215 | } 216 | 217 | export default new Auth(); 218 | -------------------------------------------------------------------------------- /vulnerability-frontend/src/auth/login.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | import { useHistory } from 'react-router'; 3 | import { Form, Button, Alert, Nav } from 'react-bootstrap'; 4 | import auth from './auth'; 5 | 6 | export const Login = () => { 7 | // History hook 8 | const history = useHistory(); 9 | 10 | // User information hook 11 | const [email, setEmail] = useState(''); 12 | const [password, setPassword] = useState(''); 13 | const [error, setError] = useState(''); 14 | 15 | // Function to call submit 16 | const callSubmit = async (e) => { 17 | // Prevents page reload on wrongs creds 18 | e.preventDefault(); 19 | setError(''); 20 | try { 21 | const data = await auth.login(email, password); 22 | // Executes only when there are no 400 and 500 errors, else they are thrown as errors 23 | // Callbacks can be added here 24 | if (data) { 25 | history.push('/'); 26 | } 27 | } 28 | catch (err) { 29 | if (err instanceof Error) { 30 | // Handle errors thrown from frontend 31 | setError(err.message); 32 | } 33 | else { 34 | // Handle errors thrown from backend 35 | if (err === 'LOGIN_BAD_CREDENTIALS') { 36 | setError('Incorrect credentials'); 37 | } 38 | else { 39 | setError('Error occured in the API.'); 40 | } 41 | } 42 | } 43 | }; 44 | 45 | return ( 46 | <> 47 |
48 | 55 |
56 |

Login

57 |
58 | 59 | Email 60 | setEmail(e.currentTarget.value)} /> 61 | 62 | 63 | Password 64 | setPassword(p.currentTarget.value)}/> 65 | 66 | 67 | {error} 68 | 69 | Haven't you got account? 70 | Sign Up 71 |
72 | 75 |
76 | 77 | ); 78 | }; 79 | -------------------------------------------------------------------------------- /vulnerability-frontend/src/auth/protected-route.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Route, Redirect } from 'react-router-dom'; 3 | import auth from './auth'; 4 | 5 | // ProtectedRoute template to define any new protected routes 6 | export const ProtectedRoute = ({component: Component, ...rest}) => { 7 | return ( 8 | { 11 | // Goto the concerned route when authenticated 12 | if (auth.isAuthenticated()){ 13 | return () 14 | } 15 | // Goto the default login page when not authenticated 16 | else { 17 | return ( 18 | 19 | ) 20 | } 21 | }} 22 | /> 23 | ); 24 | }; 25 | -------------------------------------------------------------------------------- /vulnerability-frontend/src/auth/register.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | import { useHistory } from 'react-router'; 3 | import { Form, Button, Alert, Nav } from 'react-bootstrap'; 4 | import auth from './auth'; 5 | 6 | export const Register = () => { 7 | // History hook 8 | const history = useHistory(); 9 | 10 | // User information hook 11 | const [firstName, setFirstName] = useState(''); 12 | const [lastName, setLastName] = useState(''); 13 | const [email, setEmail] = useState(''); 14 | const [password, setPassword] = useState(''); 15 | const [passwordConfirmation, setPasswordConfirmation] = useState(''); 16 | const [error, setError] = useState(''); 17 | 18 | // Function to call submit 19 | const callSubmit = async (e) => { 20 | // Prevents page reload on wrongs creds 21 | e.preventDefault(); 22 | setError(''); 23 | try { 24 | const data = await auth.register(firstName, lastName, email, password, passwordConfirmation); 25 | // Executes only when there are no 400 and 500 errors, else they are thrown as errors 26 | // Callbacks can be added here 27 | if (data) { 28 | await auth.login(email, password); 29 | history.push('/'); 30 | } 31 | } 32 | catch (err) { 33 | if (err instanceof Error) { 34 | // Handle errors thrown from frontend 35 | setError(err.message); 36 | } 37 | else { 38 | // Handle errors thrown from backend 39 | if (err === 'REGISTER_USER_ALREADY_EXISTS') { 40 | setError('Email ID is already registered. Please use your credentials to login.'); 41 | } 42 | else { 43 | setError('Error occured in the API.'); 44 | } 45 | } 46 | } 47 | }; 48 | 49 | return ( 50 | <> 51 |
52 | 59 |
60 |

Sign Up

61 |
62 | 63 | First Name 64 | setFirstName(f.currentTarget.value)} /> 65 | 66 | 67 | Last Name 68 | setLastName(l.currentTarget.value)} /> 69 | 70 | 71 | Email 72 | setEmail(e.currentTarget.value)} /> 73 | 74 | 75 | Password 76 | setPassword(p.currentTarget.value)}/> 77 | 78 | 79 | Confirm Password 80 | setPasswordConfirmation(p.currentTarget.value)}/> 81 | 82 | 83 | {error} 84 | 85 | Haven you got account? 86 | Login 87 |
88 | 91 |
92 | 93 | ); 94 | }; 95 | -------------------------------------------------------------------------------- /vulnerability-frontend/src/images/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /vulnerability-frontend/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /vulnerability-frontend/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | ReactDOM.render( 6 | 7 | 8 | , 9 | document.getElementById('root') 10 | ); 11 | -------------------------------------------------------------------------------- /vulnerability-frontend/src/pages/Home.js: -------------------------------------------------------------------------------- 1 | import React, { useState, useEffect, useRef } from 'react'; 2 | import { useHistory } from 'react-router'; 3 | import { Navbar, Container, Nav } from 'react-bootstrap'; 4 | import auth from '../auth/auth'; 5 | import { Grid, GridColumn, GridToolbar } from "@progress/kendo-react-grid"; 6 | import { ExcelExport } from "@progress/kendo-react-excel-export"; 7 | import { GridPDFExport } from "@progress/kendo-react-pdf"; 8 | import EditForm from "./editForm"; 9 | import { filterBy } from "@progress/kendo-data-query"; 10 | import { Notification } from "@progress/kendo-react-notification"; 11 | import { Slide } from "@progress/kendo-react-animation"; 12 | import { CSVLink } from "react-csv"; 13 | 14 | export const Home = (props) => { 15 | const [user, setUser] = useState({ 16 | "id": "", 17 | "email": "", 18 | "is_active": true, 19 | "is_superuser": false, 20 | "firstName": "", 21 | "lastName": "" 22 | }); 23 | 24 | const [vulnerabilities, setVulnerabilities] = useState([]); 25 | const [isEdit, setIsEdit] = useState(0); 26 | const [notifyStatus, setNotifyStatus] = useState('error'); 27 | const [notifyMessage, setNotifyMessage] = useState(''); 28 | // History hook 29 | const history = useHistory(); 30 | 31 | // Function to call logout 32 | const callLogout = async () => { 33 | auth.logout(() => { 34 | history.push('/'); 35 | }); 36 | }; 37 | 38 | // Fetch user information on page load 39 | useEffect(() => { 40 | const fetchData = async () => { 41 | if (auth.isAuthenticated()){ 42 | const result = await auth.getUser(); 43 | if(!result.id) callLogout(); 44 | setUser(result); 45 | const vulnerabilities_result = await auth.getVulnerabilities(); 46 | for(var i=1;i<=vulnerabilities_result.length;i++){ 47 | vulnerabilities_result[i-1]['numid'] = i; 48 | } 49 | setVulnerabilities(vulnerabilities_result) 50 | }; 51 | }; 52 | fetchData(); 53 | // eslint-disable-next-line 54 | }, []); 55 | 56 | // ================= Kendo Grid Section ======================== 57 | 58 | const initialFilter = { 59 | logic: "and", 60 | filters: [ 61 | { 62 | field: "type", 63 | operator: "contains", 64 | value: "", 65 | }, 66 | ], 67 | }; 68 | 69 | const [openForm, setOpenForm] = useState(false); 70 | const [editItem, setEditItem] = useState({ 71 | ProductID: 1, 72 | }); 73 | const [notifyShow, setNotifyShow] = useState(false) 74 | const [filter, setFilter] = useState(initialFilter); 75 | 76 | const csvHeaders = [ 77 | { label: "Type", key: "type" }, 78 | { label: "CVE", key: "cve" }, 79 | { label: "Vulnerability Name", key: "name" }, 80 | { label: "Vulnerability solution", key: "solution" } 81 | ]; 82 | 83 | const _export = useRef(null); 84 | 85 | const showNotification = (nst, msg) => { 86 | setNotifyShow(true); 87 | setNotifyStatus(nst); 88 | setNotifyMessage(msg); 89 | setTimeout(() => { 90 | setNotifyShow(false); 91 | }, 5000); 92 | } 93 | 94 | const excelExport = () => { 95 | if (_export.current !== null) { 96 | _export.current.save(); 97 | } 98 | }; 99 | 100 | let gridPDFExport; 101 | 102 | const exportPDF = () => { 103 | if (gridPDFExport !== null) { 104 | gridPDFExport.save(); 105 | } 106 | }; 107 | 108 | const enterEdit = (item) => { 109 | setIsEdit(1); 110 | item['headerTxt'] = 'Edit'; 111 | item['btnTxt'] = "Update"; 112 | setOpenForm(true); 113 | setEditItem(item); 114 | console.log(item) 115 | }; 116 | 117 | const enterAdd = () => { 118 | setIsEdit(0); 119 | setOpenForm(true); 120 | var item = {_id: '', type: '', cve: '', name: '', solution: '', headerTxt: 'Add New', btnTxt: 'Add'} 121 | setEditItem(item); 122 | console.log(item) 123 | } 124 | 125 | const handleSubmit = async (event) => { 126 | if(isEdit === 1){ 127 | const updateResult = await auth.saveVulnerability(event); 128 | if(updateResult._id){ 129 | let newData = vulnerabilities.map((item) => { 130 | if (event._id === item._id) { 131 | item = { ...event }; 132 | } 133 | 134 | return item; 135 | }); 136 | console.log(newData) 137 | setVulnerabilities(newData); 138 | setOpenForm(false); 139 | showNotification('success', 'Data is updated successfully.'); 140 | } else { 141 | showNotification('error', 'Updating data is failed.'); 142 | } 143 | } else { 144 | var tempVulnerabilities = vulnerabilities.slice(); 145 | const addResult = await auth.addVulnerability(event); 146 | if(addResult._id){ 147 | addResult['numid'] = tempVulnerabilities.length + 1; 148 | tempVulnerabilities.push(addResult) 149 | setVulnerabilities(tempVulnerabilities) 150 | setOpenForm(false); 151 | showNotification('success', 'Data is added successfully.'); 152 | } else { 153 | showNotification('error', 'Adding data is failed.'); 154 | } 155 | } 156 | }; 157 | 158 | const handleCancelEdit = () => { 159 | setOpenForm(false); 160 | }; 161 | 162 | const onRemoveClick = async (item) => { 163 | const deleteResult = await auth.deleteVulnerability(item); 164 | if(deleteResult.result){ 165 | var tempVulnerabilities = vulnerabilities.slice() 166 | for(var i=0; i { 183 | return ( 184 | 185 | 191 | 197 | 198 | ); 199 | }; 200 | 201 | const MyEditCommandCell = (props) => ( 202 | 203 | ); 204 | 205 | const notification = ( 206 | 214 | {notifyShow && ( 215 | setNotifyShow(false)} 222 | > 223 | {notifyMessage} 224 | 225 | )} 226 | 227 | ) 228 | 229 | const grid = ( 230 | setFilter(e.filter)} 235 | > 236 | 237 | {( 238 | user.is_superuser && 239 | <> 240 | 247 | 248 | )} 249 | 254 | Export to CSV 255 | 256 | 263 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | {( 277 | user.is_superuser && 278 | 279 | )} 280 | 281 | ) 282 | 283 | return ( 284 | <> 285 | 286 | 287 | 288 | 295 | Vulnerability Solutions 296 | 297 | 298 | 299 | 304 | 305 | 306 | 307 | 308 | 309 | {grid} 310 | 311 | (gridPDFExport = pdfExport)}> 312 | {grid} 313 | 314 | {openForm && ( 315 | 320 | )} 321 | {notification} 322 | 323 | 324 | ); 325 | }; 326 | -------------------------------------------------------------------------------- /vulnerability-frontend/src/pages/Login.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Container, Row, Col } from 'react-bootstrap'; 3 | import { Login } from '../auth/login'; 4 | 5 | export const LoginPage = (props) => { 6 | return ( 7 | <> 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | ); 17 | }; 18 | -------------------------------------------------------------------------------- /vulnerability-frontend/src/pages/Signup.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Container, Row, Col } from 'react-bootstrap'; 3 | import { Register } from '../auth/register'; 4 | 5 | export const SignupPage = (props) => { 6 | return ( 7 | <> 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | ); 17 | }; 18 | -------------------------------------------------------------------------------- /vulnerability-frontend/src/pages/editForm.js: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { Dialog } from "@progress/kendo-react-dialogs"; 3 | import { Form, Field, FormElement } from "@progress/kendo-react-form"; 4 | import { Input } from "@progress/kendo-react-inputs"; 5 | 6 | const EditForm = props => { 7 | return 8 |
( 9 | 12 |
13 |
14 | 15 |
16 |
17 | 18 |
19 |
20 | 21 |
22 |
23 | 24 |
25 |
26 |
27 | 30 | 33 |
34 |
)} /> 35 |
; 36 | }; 37 | 38 | export default EditForm; --------------------------------------------------------------------------------