ReconDB is a project written in Go which provides APIs for managing companies, scopes, assets, and outscopes data.
The project uses MongoDB as a backend to store and retrieve data.
The following endpoints are available in the project:
Scope Endpoint
-
POST /api/scope: Add a new scope
-
GET /api/scope/:companyname: Get scopes for a specific company
-
GET /api/scope: Get all scopes
-
DELETE /api/scope/:companyname: Delete scopes for a specific company
Out of Scope Endpoint
-
POST /api/outscope: Add a new outscope
-
GET /api/outscope/:companyname: Get out of scope for a specific company
-
GET /api/outscope: Get all out of scopes
-
DELETE /api/outscope/:companyname: Delete out of scope for a specific company
Company Endpoint
-
POST /api/company: Add a new company
-
GET /api/company/:companyname: Get a specific company
-
GET /api/company: Get all companies
-
DELETE /api/company/:companyname: Delete a specific company
Asset Endpoint
-
POST /api/asset: Add a new asset
-
GET /api/asset/:asset: Get a specific asset
-
GET /api/asset: Get all assets
-
DELETE /api/asset/:asset: Delete a specific asset
The project requires a configuration file in JSON format to specify the authorization token, the port number to listen on, the Gin mode, and the MongoDB URI.
Here is an example of the configuration file:
{
"authorization": "<token>",
"gin_mode": "debug",
"port": ":8080",
"mongo_uri": "mongodb://recondb-mongodb-1:27017"
}
authorization
: The authorization token to be used for API requestsgin_mode
: The mode for the Gin web frameworkport
: The port number to listen onmongo_uri
: The URI for the MongoDB instance to connect to
For generating token simply use the following command in python3 :
import os
os.urandom(32).hex()
You can get the latest release of ReconDB from Releases section
Make sure to properly set configuration file and run MongoDB instance on your server
Use the following command to compile the program and then run the compiled binary :
go build -o ReconDB -ldflags "-s -w -buildid=" -buildvcs=false .
./ReconDB
To run the project with docker , you can use the docker-compose file :
docker-compose up -d
Note : make sure to set the MongoDB URI to name of docker name of the mongodb ex:
{
...
"mongo_uri": "mongodb://recondb-mongodb-1:27017"
}
Use this ReconDB.postman_collection.json file for testing endpoints with postman.