WebApp Project

March 10, 2025 ยท View on GitHub

Overview

This repository contains the source code for the WebApp project, covering both frontend and backend components. The project is integrated with a comprehensive CI/CD pipeline, secret scanning, and DevSecOps best practices.

Table of Contents

  1. GitHub Actions CI/CD
  2. Tech Stack
  3. Running the Application
  4. Secret Scanning
  5. MongoDB Database
  6. How to Contribute
  7. Troubleshooting & Logs
  8. DevSecOps Details
  9. Subfolders Information

GitHub Actions CI/CD

Automated pipelines are set up to build, test, and deploy the application using GitHub Actions.

Build Status Test Status

Access Application

You can access the live application at:

Quality Gate Status

Tech Stack

TechnologyDescription
Node.jsBackend development
React.jsFrontend development
PostgreSQLDatabase

Secret Scanning

The project uses tools like Trufflehog and Gitleaks to scan for sensitive data leaks in the codebase. Regular secret scans help ensure security.

9900

SonarQube

Security Scanning Tools

In a DevSecOps environment, integrating various security scanning tools into the CI/CD pipeline is essential. This section details the types of scans implemented in this project, as well as recommended open-source tools for each.

Security LevelTools UsedOptionsDescription
Secret ScanGitleaksTruffleHog, GitGuardianScans source code and history to detect sensitive information like secrets and tokens.
Infrastructure as Code (IaC) ScanCheckov, TFLintTerrascanScans Terraform code to detect security vulnerabilities, compliance violations, and misconfigurations.
Application Code Scan (SAST)SonarQubeBandit, SemgrepStatic analysis tools to detect code quality issues, vulnerabilities, and potential security flaws in the source code.
Container/Image ScanTrivyClair, GrypeScans Docker images for vulnerabilities and compliance issues.
Deployment Code ScanKube-bench, Kube-hunter, KubescapeScans Kubernetes deployments for security risks, best practices, and compliance checks.

Usage Example:

Trufflehog:

trufflehog filesystem .

Gitleaks:

gitleaks dir backend
gitleaks dir frontend

Troubleshooting and Logs

DevSecOps Details

This project adheres to DevSecOps practices to ensure security is integrated throughout the development lifecycle. Below are some key components:

Security Practices

  • Static Application Security Testing (SAST) using GitHub Actions.
  • Dynamic Application Security Testing (DAST) to verify the deployed applications.
  • Integration of OWASP security scanning.
  • Code quality and security scanning using pylint and bandit.
  • Implementing container signing with tools like Notary and Sigstore to ensure the integrity of containers.

Automated Pipeline Features

  • CI/CD pipeline automatically scans for vulnerabilities at every stage (Dev, QA, Prod).
  • Manual approval required for production deployments.
  • Slack notifications to update deployment status.

Subfolders Information

Each subfolder contains a README.md file with detailed information on how to run and configure the respective service:

  • Terrafrom Folder:

    • Contains instructions for creating Infra for this project.
    • Backend README
  • Database Folder:

    • Contains instructions for running the database service.
    • Backend README
  • Backend Folder:

    • Contains instructions for running the backend service.
    • Backend README
  • Frontend Folder:

    • Contains instructions for setting up and running the frontend.
    • Frontend README
  • Deploy Folder:

    • Contains instructions for deploying this application.
    • Backend README

Build

  • Successfully genreated kbom file

Trivy

trivy k8s arn:aws:eks:ap-southeast-1:851725219470:cluster/sit-cmts --scanners vuln --skip-check-update --format json -o kbom.json
trivy fs --attest --predicate vuln --output predicate.json kbom.json
trivy fs --skip-update --cache-dir /root/.cache/trivy --format json --output scan-results.json kbom.json

Start server

docker-compose --env-file .env up db