This repository is to scan, store and query json vulnerability scan files from https://github.com/velancio/vulnerability_scans
-
Clone the GitHub repository:
git clone https://github.com/sarthakgoel1997/parse-github-files.git -
Download Docker: https://docs.docker.com/desktop/setup/install/mac-install/
-
Go to
Makefileand updatePERSONAL_ACCESS_TOKENwith your GitHub personal access token to query repositories -
Go to the root of the repository and run:
make dev -
Import the below endpoint curls in Postman for testing
Fetches all .json files from the specified GitHub path and stores data in SQLite database
curl --location 'http://localhost:9000/scan' \
--header 'Content-Type: application/json' \
--data '{
"repo": "https://github.com/velancio/vulnerability_scans",
"files": ["vulnscan1011.json", "vulnscan1213.json", "vulnscan15.json", "vulnscan16.json", "vulnscan18.json", "vulnscan19.json"]
}'
Returns all payloads matching any one filter key (exact matches)
curl --location 'http://localhost:9000/query' \
--header 'Content-Type: application/json' \
--data '{
"filters": {
"severity": "HIGH"
}
}'
-
make build: Builds the docker image -
make run: Runs a docker container with the built image -
make stop: Stops and deletes any running container -
make dev: Builds the docker image, stops any running containers and starts up a new container -
make logs: Starts up docker container logs for debugging -
make query-db: Opens sqlite database in the terminal -
make test: Run all unit tests and generate coverage report -
make coverage: View file-based coverage report -
make clean: Stops any running containers and deletes the built docker image
-
.tables: Displays all tables present in the database -
PRAGMA table_info (<table_name>): Displays all columns and types present in the table -
.mode line: To display select query results in a readable format