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.
To run the CVE Database API locally, follow these steps:
Clone this repository to your local machine using the following command:
https://github.com/Yakuta110/CVE-Database-API.git
Navigate to the project directory and install the required dependencies using pip:
cd CVE-Database-API
pip install -r requirements.txt
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.
Execute the Flask application by running the following command:
flaskCveApi.py
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.
Retrieves details of a particular CVE identified by its CVE-ID.
1. Parameters: <cve_id> (path parameter)
2. Response Format: JSON
3. Error Handling: Returns an appropriate error response if the specified CVE ID does not exist.
Retrieves all CVE data from the database.
1. Response Format: JSON
2. Error Handling: Returns an appropriate response if any error occurs while fetching the details.
Adds a new CVE record to the database with the provided data in the payload.
1. Payload Format: JSON
2. Response Format: JSON
3. Error Handling: Provides appropriate error responses for validation errors in the payload data.
Deletes the CVE record identified by its CVE-ID from the database.
1. Parameters: <cve_id> (path parameter)
2. Response Format: JSON
3. Error Handling: Returns an appropriate error response if the specified CVE ID does not exist.
(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
3. Response Format: JSON
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.
Flask: Web framework for building the API endpoints.
SQLite: Lightweight relational database management system.