Code Monkey home page Code Monkey logo

cve-database-api's Introduction

CVE-Database-API

The CVE Database API is a Flask-based web service that allows users to interact with a database containing information about Common Vulnerabilities and Exposures (CVEs). This API provides endpoints for retrieving details of specific CVEs, fetching all CVE data, adding new CVE records, updating existing records, and deleting CVEs from the database.

1. Installation and Setup

To run the CVE Database API locally, follow these steps:

2. Clone the Repository:

Clone this repository to your local machine using the following command:

https://github.com/Yakuta110/CVE-Database-API.git

3. Install Dependencies:

Navigate to the project directory and install the required dependencies using pip:

cd CVE-Database-API

pip install -r requirements.txt

4. Set Up the Database:

Ensure you have SQLite installed on your system. The SQLite database file (database.db) is included in the repository. If you need to create a new database, you can modify the connection string in flaskCveApi.py to point to your desired SQLite database file.

5. Run the Application:

Execute the Flask application by running the following command:

flaskCveApi.py

6. Access the API:

Once the application is running, you can access the API endpoints using a tool like Postman or by making HTTP requests using curl or Python's requests library.

API Endpoints

1. GET /cve/<cve_id>:

Retrieves details of a particular CVE identified by its CVE-ID.

1. Parameters: <cve_id> (path parameter)

2. Response Format: JSON

image

3. Error Handling: Returns an appropriate error response if the specified CVE ID does not exist.

image

2. GET /cve/all:

Retrieves all CVE data from the database.

1. Response Format: JSON

image

2. Error Handling: Returns an appropriate response if any error occurs while fetching the details.

3. POST /cve/addCVE:

Adds a new CVE record to the database with the provided data in the payload.

1. Payload Format: JSON

image

2. Response Format: JSON

image

3. Error Handling: Provides appropriate error responses for validation errors in the payload data.

4. DELETE /cve/<cve_id>:

Deletes the CVE record identified by its CVE-ID from the database.

1. Parameters: <cve_id> (path parameter)

2. Response Format: JSON

image

3. Error Handling: Returns an appropriate error response if the specified CVE ID does not exist.

image

5. PUT /cve/<cve_id>:

(Optional) Modifies the details of a CVE identified by its ID with the provided data in the payload.

1. Parameters: <cve_id> (path parameter)

2. Payload Format: JSON

image

3. Response Format: JSON

image

4. Error Handling: Provides appropriate error responses if the specified CVE ID does not exist or if there are validation errors in the payload data.

Dependencies

Flask: Web framework for building the API endpoints.

SQLite: Lightweight relational database management system.

cve-database-api's People

Contributors

yakuta110 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.