RepoScanner
is a project composed of three microservices that work together to authenticate users, scan GitHub repositories, and send notifications based on scan results. This setup enables secure access control, automated scanning, and email notifications to streamline repository management and security analysis.
Before setting up the project, ensure the following are installed on your local machine:
- Trivy: A vulnerability scanner for containers and other artifacts, required to perform security scans.
- ZeroMQ: A high-performance messaging library, required for inter-service communication.
- Auth Service - Developed using NestJS, this service handles user authentication and provides JWT tokens for secure access to other services.
- Scan Service - Built with Golang, this service is responsible for scanning GitHub repositories using Trivy. It communicates with the Auth and Email services to perform secure scans and notify users of the results.
- Email Service - Another NestJS service, this service sends email notifications based on scan results, utilizing the results from the Scan Service.
To get started, clone the repoScanner repository to your local machine:
git clone https://github.com/jobayer12/repoScanner.git
cd repoScanner
The Auth Service handles user registration, login, and JWT authentication.
-
Navigate to the
auth-service
directory:cd auth-service
-
Rename
.env.sample
to.env
and configure the environment variables. -
Install the dependencies:
npm install
-
Start the Auth Service:
npm run start
The Scan Service performs repository scans using Trivy and interacts with other services via ZeroMQ.
-
Navigate to the
scan-service
directory:cd scan-service
-
Rename
.env.sample
to.env
and configure any necessary environment variables. -
Install any required Go dependencies:
go mod download
-
Ensure Trivy and ZeroMQ are properly installed, as they are required to run this service.
-
Start the Scan Service:
make run
The Email Service handles email notifications, alerting users based on scan results.
-
Navigate to the email-service directory:
cd email-service
-
Rename
.env.sample
to.env
and configure any necessary environment variables. -
Install the dependencies:
npm install
-
Start the Email Service:
npm run start
-
Go to http://localhost:3000/api#/ to see the list of available Auth Service endpoints.
-
Use the pre-created user:
- Email: [email protected]
- Password: v0N6OI8
-
Log in to retrieve a JWT token, which can then be used to authorize requests to the services.
-
Perform a Scan: Send a scan request through the Scan Service using the JWT token from the Auth Service.
-
Receive Email Notification: Once a scan completes, the Email Service will automatically send a notification based on the results.
Contributions are welcome! Please fork the repository and create a pull request for review.