Skip to content

pulk17/Termi-Sec-Ops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ DevSecOps Security Pipeline

A production-ready, enterprise-grade security scanning platform with real-time vulnerability detection, AI-powered remediation, and terminal-style DevOps interface.

Next.js TypeScript React License Security


πŸ“– Table of Contents


🌟 Overview

DevSecOps Security Pipeline is a comprehensive security scanning platform designed for modern development teams. It integrates multiple industry-leading security tools into a unified, terminal-style interface that developers love.

What Makes This Different?

  • πŸ”΄ Real Security Scanning - No mocks, no simulations. Real API integrations with npm, OSV, Snyk, and AWS
  • πŸ€– AI-Powered Fixes - Google Gemini AI provides intelligent, context-aware remediation suggestions
  • πŸ’» Terminal-First UI - Beautiful, glitch-effect terminal interface that feels like home for developers
  • πŸ”’ Enterprise Security - Server-side operations, encrypted storage, and production-ready architecture
  • πŸ“Š Dynamic Scoring - Real-time security score calculation based on actual vulnerability severity
  • πŸš€ Production Ready - Docker, Nginx, and comprehensive deployment configurations included

✨ Key Features

πŸ” Multi-Source Vulnerability Scanning

Scanner Type Status Description
npm Audit Dependencies βœ… Live Official npm registry vulnerability database
OSV.dev Dependencies βœ… Live Google's Open Source Vulnerabilities database
Snyk Dependencies βœ… Live Enterprise security platform (requires API key)
Trivy Containers βœ… Live Container and filesystem vulnerability scanner
GitHub Actions CI/CD βœ… Live Workflow security analysis

πŸ€– AI-Powered Remediation

  • Intelligent Fix Suggestions - Gemini AI analyzes vulnerabilities and provides step-by-step fixes
  • Root Cause Analysis - Understand why vulnerabilities exist and how to prevent them
  • Code Examples - Ready-to-use code snippets and commands
  • Best Practices - Security recommendations aligned with industry standards

πŸ’» Terminal-Style Interface

  • Glitch Effects - Cyberpunk-inspired animations and hover effects
  • Real-Time Updates - Live scan progress with terminal output
  • Scanline Effects - Authentic CRT monitor aesthetics
  • Color-Coded Severity - Instant visual identification of critical issues

πŸ“Š Dynamic Security Scoring

The security score is dynamically calculated based on:

  • Critical vulnerabilities: -10 points each
  • High severity: -5 points each
  • Medium severity: -2 points each
  • Low severity: -1 point each
  • Base score: 100 points

Formula: Score = max(0, 100 - (10Γ—critical + 5Γ—high + 2Γ—medium + 1Γ—low))

πŸ” Enterprise Security Features

  • Server-Side Operations - All AWS SDK calls execute server-side
  • Encrypted Token Storage - AES-GCM encryption for sensitive data
  • CSP Headers - Strict Content Security Policy
  • Rate Limiting - Nginx-based request throttling
  • HTTPS Enforcement - TLS/SSL in production
  • No Credential Exposure - Secrets never sent to client

πŸ—οΈ Architecture

Technology Stack

Frontend:
β”œβ”€β”€ Next.js 15 (App Router)
β”œβ”€β”€ React 18.3
β”œβ”€β”€ TypeScript 5.6
β”œβ”€β”€ Tailwind CSS 4.0
β”œβ”€β”€ Framer Motion (Animations)
└── Zustand (State Management)

Backend:
β”œβ”€β”€ Next.js API Routes
β”œβ”€β”€ Node.js 18+
β”œβ”€β”€ Dexie (IndexedDB)
└── Server-Side Integrations

Security Tools:
β”œβ”€β”€ npm Audit API
β”œβ”€β”€ OSV.dev API
β”œβ”€β”€ Snyk API
β”œβ”€β”€ AWS SDK (ECR, ECS, Inspector2)
└── Google Gemini AI

Deployment:
β”œβ”€β”€ Docker
β”œβ”€β”€ Docker Compose
β”œβ”€β”€ Nginx (Reverse Proxy)
└── PM2 (Process Manager)

System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        Client Browser                       β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚  Next.js Frontend (React + TypeScript)                 β”‚ β”‚
β”‚  β”‚  - Terminal UI Components                              β”‚ β”‚
β”‚  β”‚  - Zustand State Management                            β”‚ β”‚
β”‚  β”‚  - Encrypted Local Storage                             β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              ↕ HTTPS
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      Nginx Reverse Proxy                    β”‚
β”‚  - Rate Limiting                                            β”‚
β”‚  - SSL Termination                                          β”‚
β”‚  - Security Headers                                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              ↕
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   Next.js Server (Node.js)                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚  API Routes                                            β”‚ β”‚
β”‚  β”‚  β”œβ”€β”€ /api/scan/snyk     (Snyk Integration)             β”‚ β”‚
β”‚  β”‚  β”œβ”€β”€ /api/scan/trivy    (Trivy Integration)            β”‚ β”‚
β”‚  β”‚  β”œβ”€β”€ /api/scan/aws      (AWS SDK Operations)           β”‚ β”‚
β”‚  β”‚  └── /api/ai/suggest-fix (Gemini AI)                   β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚  Security Scanner Engine                               β”‚ β”‚
β”‚  β”‚  β”œβ”€β”€ npm Audit Client                                  β”‚ β”‚
β”‚  β”‚  β”œβ”€β”€ OSV Client                                        β”‚ β”‚
β”‚  β”‚  β”œβ”€β”€ GitHub Client                                     β”‚ β”‚
β”‚  β”‚  └── Vulnerability Aggregator                          β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              ↕
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    External Services                        β”‚
β”‚  β”œβ”€β”€ npm Registry API                                       β”‚
β”‚  β”œβ”€β”€ OSV.dev API                                            β”‚
β”‚  β”œβ”€β”€ Snyk API                                               β”‚
β”‚  β”œβ”€β”€ AWS Services (ECR, ECS, Inspector2)                    β”‚
β”‚  β”œβ”€β”€ Google Gemini AI                                       β”‚
β”‚  └── GitHub API                                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“‹ Prerequisites

Required

  • Node.js 18.0.0 or higher
  • npm 9.0.0 or higher (or yarn 1.22.0+)
  • Git 2.0.0 or higher

Optional (for full functionality)

  • Docker 20.10.0+ and Docker Compose 2.0.0+ (for containerized deployment)
  • Snyk Account (for Snyk scanning)
  • AWS Account (for AWS security scanning)
  • Google Cloud Account (for Gemini AI suggestions)
  • GitHub OAuth App (for private repository scanning)

πŸš€ Installation

Quick Start (5 minutes)

# 1. Clone the repository
git clone https://github.com/yourusername/devsecops-pipeline.git
cd devsecops-pipeline

# 2. Install dependencies
npm install

# 3. Create environment file
cp .env.example .env.local

# 4. Start development server
npm run dev

Open http://localhost:3000 to see the application.

Detailed Installation

Step 1: Clone Repository

git clone https://github.com/yourusername/devsecops-pipeline.git
cd devsecops-pipeline

Step 2: Install Dependencies

# Using npm
npm install

# Or using yarn
yarn install

This will install all required dependencies including:

  • Next.js framework
  • React and React DOM
  • TypeScript
  • Tailwind CSS
  • Security scanning libraries
  • AWS SDK
  • And more...

Step 3: Verify Installation

# Check Node.js version
node --version  # Should be 18.0.0 or higher

# Check npm version
npm --version   # Should be 9.0.0 or higher

# Run type checking
npm run type-check

# Run linting
npm run lint:check

βš™οΈ Configuration

Environment Variables

Create a .env.local file in the project root:

# =============================================================================
# GITHUB CONFIGURATION (Optional - for private repositories)
# =============================================================================
NEXT_PUBLIC_GITHUB_CLIENT_ID=your_github_oauth_client_id

# =============================================================================
# SECURITY SCANNING APIS (Server-side only - NEVER use NEXT_PUBLIC_ prefix!)
# =============================================================================

# Snyk API Token (Get from: https://app.snyk.io/account)
SNYK_TOKEN=your_snyk_api_token

# AWS Credentials (For ECR, ECS, Inspector2 scanning)
AWS_ACCESS_KEY_ID=your_aws_access_key_id
AWS_SECRET_ACCESS_KEY=your_aws_secret_access_key
AWS_REGION=us-east-1

# Google Gemini AI API Key (Get from: https://makersuite.google.com/app/apikey)
GEMINI_API_KEY=your_gemini_api_key

# =============================================================================
# APPLICATION CONFIGURATION
# =============================================================================

# Application URL (for OAuth callbacks)
NEXT_PUBLIC_APP_URL=http://localhost:3000

# Database Configuration (Optional - uses IndexedDB by default)
# DATABASE_URL=postgresql://user:password@localhost:5432/devsecops

# =============================================================================
# SECURITY CONFIGURATION
# =============================================================================

# Encryption key for sensitive data (auto-generated if not provided)
# ENCRYPTION_KEY=your_32_character_encryption_key

# Session secret (auto-generated if not provided)
# SESSION_SECRET=your_session_secret_key

Getting API Keys

1. Snyk API Token

  1. Sign up at https://snyk.io
  2. Navigate to Account Settings β†’ API Token
  3. Generate a new token
  4. Copy and paste into .env.local

2. AWS Credentials

  1. Log in to AWS Console
  2. Navigate to IAM β†’ Users β†’ Create User
  3. Attach policies:
    • AmazonEC2ContainerRegistryReadOnly
    • AmazonECS_ReadOnlyAccess
    • AmazonInspector2ReadOnlyAccess
  4. Create access key
  5. Copy credentials to .env.local

3. Google Gemini API Key

  1. Visit https://makersuite.google.com/app/apikey
  2. Create a new API key
  3. Copy and paste into .env.local

4. GitHub OAuth (Optional)

  1. Go to GitHub Settings β†’ Developer settings β†’ OAuth Apps
  2. Create a new OAuth App
  3. Set Authorization callback URL: http://localhost:3000/api/auth/callback/github
  4. Copy Client ID to .env.local

Configuration Files

next.config.js

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  swcMinify: true,
  
  // Security headers
  async headers() {
    return [
      {
        source: '/:path*',
        headers: [
          {
            key: 'X-Frame-Options',
            value: 'DENY',
          },
          {
            key: 'X-Content-Type-Options',
            value: 'nosniff',
          },
          {
            key: 'X-XSS-Protection',
            value: '1; mode=block',
          },
        ],
      },
    ];
  },
};

module.exports = nextConfig;

πŸ“š Usage Guide

Starting a Security Scan

1. Navigate to Scan Page

Click "New Scan" or navigate to /scan

2. Enter Repository Information

Repository URL: https://github.com/owner/repository

Supported formats:

  • https://github.com/owner/repo
  • github.com/owner/repo
  • owner/repo

3. Configure Scan Options

Dependency Scanning:

  • βœ… Enable npm Audit (recommended)
  • βœ… Enable OSV Database (recommended)
  • βœ… Enable Snyk (requires API key)

Advanced Scanning:

  • βœ… Scan Dependencies
  • βœ… Scan Code Security
  • βœ… Scan Containers (requires Docker)
  • βœ… Scan GitHub Actions

4. Start Scan

Click "Start Security Scan" button

5. Monitor Progress

Watch real-time terminal output:

$ INITIALIZING
  Loading security scanner modules...
  [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ] 100%

$ SCANNING
  Running npm audit scan...
  πŸ” Running npm audit...
  βœ“ npm audit found 5 vulnerabilities
  
$ COMPLETED
  Security scan completed successfully
  Total vulnerabilities: 5
  Security Score: 75/100

Viewing Scan Results

Dashboard Overview

The DevSecOps dashboard displays:

  1. Security Score - Dynamic score (0-100) based on vulnerabilities
  2. Risk Level - Critical, High, Medium, or Low
  3. Vulnerability Breakdown - Count by severity
  4. Scan Timeline - Historical scan data
  5. Detailed Vulnerability List - Expandable cards with full details

Vulnerability Details

Click any vulnerability to see:

  • Description - What the vulnerability is
  • Severity - Critical, High, Medium, Low
  • CVSS Score - Industry-standard severity rating
  • Affected Package - Package name and version
  • Fix Available - Upgrade version if available
  • References - Links to CVE, advisories, etc.
  • AI Fix Suggestion - Click to get Gemini AI remediation

Getting AI Fix Suggestions

  1. Click on a vulnerability
  2. Click "Get AI Fix Suggestion (Gemini)"
  3. Wait for AI analysis (5-10 seconds)
  4. Review the suggestion:
    • Root cause explanation
    • Step-by-step fix instructions
    • Code examples
    • Prevention tips

Example AI suggestion:

πŸ€– AI-Powered Fix Suggestion

Root Cause:
The vulnerability exists because package 'lodash' version 4.17.15 
contains a prototype pollution vulnerability (CVE-2020-8203).

Fix Steps:
1. Update lodash to version 4.17.21 or higher
2. Run: npm install lodash@^4.17.21
3. Test your application thoroughly
4. Commit the updated package-lock.json

Prevention:
- Enable automated dependency updates (Dependabot)
- Run security scans in CI/CD pipeline
- Use npm audit regularly

Exporting Reports

Click "Export" button and choose format:

  • JSON - Machine-readable format for automation
  • CSV - Spreadsheet format for analysis
  • HTML - Standalone report for sharing

πŸ”Œ API Documentation

Scan API

Start Scan

POST /api/scan/start

Request Body:
{
  "repoUrl": "https://github.com/owner/repo",
  "scanOptions": {
    "enableOSV": true,
    "enableNpmAudit": true,
    "enableSnyk": true,
    "enableTrivy": false,
    "enableGitHubActions": true,
    "scanDependencies": true,
    "scanCode": true,
    "scanContainers": false
  }
}

Response:
{
  "scanId": "uuid-v4-scan-id",
  "status": "queued",
  "message": "Scan started successfully"
}

Get Scan Status

GET /api/scan/status/:scanId

Response:
{
  "scanId": "uuid-v4-scan-id",
  "status": "running" | "completed" | "failed",
  "progress": {
    "stage": "scanning",
    "percentage": 45,
    "message": "Running npm audit...",
    "currentTask": "npm-audit"
  }
}

Get Scan Results

GET /api/scan/results/:scanId

Response:
{
  "scanId": "uuid-v4-scan-id",
  "status": "completed",
  "summary": {
    "totalVulnerabilities": 10,
    "criticalCount": 2,
    "highCount": 3,
    "mediumCount": 4,
    "lowCount": 1,
    "securityScore": 65,
    "riskLevel": "high"
  },
  "vulnerabilities": [...]
}

AI Suggestion API

POST /api/ai/suggest-fix

Request Body:
{
  "vulnerability": {
    "id": "CVE-2020-8203",
    "title": "Prototype Pollution",
    "severity": "high",
    "packageName": "lodash",
    "version": "4.17.15",
    "description": "..."
  }
}

Response:
{
  "suggestion": "AI-generated fix suggestion..."
}

πŸ”’ Security

Security Best Practices

  1. Never commit .env.local - Add to .gitignore
  2. Use server-side API routes - Never expose API keys to client
  3. Enable HTTPS in production - Use SSL/TLS certificates
  4. Rotate API keys regularly - Update keys every 90 days
  5. Use environment-specific configs - Different keys for dev/staging/prod
  6. Enable rate limiting - Prevent abuse
  7. Monitor logs - Watch for suspicious activity

Encryption

All sensitive data is encrypted using AES-GCM:

import { encrypt, decrypt } from '@/lib/encryption';

// Encrypt sensitive data
const encrypted = await encrypt('sensitive-data');

// Decrypt when needed
const decrypted = await decrypt(encrypted);

Security Headers

Nginx configuration includes:

add_header X-Frame-Options "DENY";
add_header X-Content-Type-Options "nosniff";
add_header X-XSS-Protection "1; mode=block";
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
add_header Content-Security-Policy "default-src 'self'";

🐳 Deployment

Docker Deployment (Recommended)

Quick Deploy

# Build and start all services
docker-compose up -d

# View logs
docker-compose logs -f

# Stop services
docker-compose down

Manual Docker Build

# Build image
docker build -t devsecops-pipeline:latest .

# Run container
docker run -d \
  -p 3000:3000 \
  --env-file .env.local \
  --name devsecops \
  devsecops-pipeline:latest

Production Deployment

Prerequisites

  • Ubuntu 20.04+ or similar Linux distribution
  • Docker and Docker Compose installed
  • Domain name with DNS configured
  • SSL certificate (Let's Encrypt recommended)

Step 1: Server Setup

# Update system
sudo apt update && sudo apt upgrade -y

# Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

# Install Docker Compose
sudo apt install docker-compose -y

# Create application directory
sudo mkdir -p /opt/devsecops
cd /opt/devsecops

Step 2: Clone and Configure

# Clone repository
git clone https://github.com/yourusername/devsecops-pipeline.git .

# Create production environment file
sudo nano .env.production

# Add production environment variables

Step 3: SSL Certificate (Let's Encrypt)

# Install Certbot
sudo apt install certbot python3-certbot-nginx -y

# Get certificate
sudo certbot --nginx -d yourdomain.com

Step 4: Deploy

# Build and start
sudo docker-compose -f docker-compose.prod.yml up -d

# Check status
sudo docker-compose ps

# View logs
sudo docker-compose logs -f

Step 5: Configure Nginx

server {
    listen 443 ssl http2;
    server_name yourdomain.com;

    ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;

    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

Vercel Deployment

# Install Vercel CLI
npm i -g vercel

# Deploy
vercel --prod

AWS Deployment

See detailed AWS deployment guide in docs/AWS_DEPLOYMENT.md


πŸ§ͺ Testing

Unit Tests

# Run all tests
npm test

# Run with coverage
npm test -- --coverage

# Run specific test file
npm test -- src/lib/security-scanner.test.ts

# Watch mode
npm test -- --watch

E2E Tests

# Run Playwright tests
npm run test:e2e

# Run with UI
npm run test:e2e -- --ui

# Run specific test
npm run test:e2e -- tests/scan.spec.ts

Type Checking

# Check types
npm run type-check

# Watch mode
npm run type-check -- --watch

Linting

# Check for issues
npm run lint:check

# Fix issues automatically
npm run lint

πŸ› Troubleshooting

Common Issues

Issue: "Module not found" errors

Solution:

# Clear node_modules and reinstall
rm -rf node_modules package-lock.json
npm install

Issue: Scan fails with "API key invalid"

Solution:

  1. Check .env.local file exists
  2. Verify API key is correct
  3. Ensure no extra spaces or quotes
  4. Restart development server

Issue: Docker container won't start

Solution:

# Check logs
docker-compose logs

# Rebuild container
docker-compose down
docker-compose build --no-cache
docker-compose up -d

Issue: Security score shows 0

Solution: The security score is dynamically calculated. If it shows 0, it means:

  • No vulnerabilities found (score = 100), OR
  • Too many vulnerabilities (score capped at 0)

Check the vulnerability counts to verify.

Issue: AI suggestions not working

Solution:

  1. Verify GEMINI_API_KEY is set in .env.local
  2. Check API key is valid at Google AI Studio
  3. Ensure you have API quota remaining
  4. Check browser console for errors

Debug Mode

Enable debug logging:

# Add to .env.local
DEBUG=devsecops:*
NODE_ENV=development

Getting Help


🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/amazing-feature
  3. Make your changes
  4. Run tests
    npm test
    npm run lint
    npm run type-check
  5. Commit your changes
    git commit -m 'feat: add amazing feature'
  6. Push to your fork
    git push origin feature/amazing-feature
  7. Open a Pull Request

Commit Convention

We use Conventional Commits:

  • feat: - New feature
  • fix: - Bug fix
  • docs: - Documentation changes
  • style: - Code style changes (formatting)
  • refactor: - Code refactoring
  • test: - Test changes
  • chore: - Build process or auxiliary tool changes

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License

Copyright (c) 2024 DevSecOps Pipeline Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

πŸ™ Acknowledgments

Technologies

  • Next.js - The React Framework for Production
  • React - A JavaScript library for building user interfaces
  • TypeScript - JavaScript with syntax for types
  • Tailwind CSS - A utility-first CSS framework
  • Framer Motion - Production-ready animation library

Security Tools

AI & APIs


πŸ—ΊοΈ Roadmap

Version 2.0 (Q1 2025)

  • GitLab integration
  • Bitbucket support
  • SARIF report export
  • Slack/Discord notifications
  • Custom scanning rules engine

Version 2.1 (Q2 2025)

  • Multi-language support (i18n)
  • Kubernetes security scanning
  • Terraform/IaC scanning
  • SBOM (Software Bill of Materials) generation

Version 3.0 (Q3 2025)

  • Machine learning-based vulnerability prediction
  • Automated PR creation for fixes
  • Team collaboration features
  • Advanced analytics and reporting
  • Compliance reporting (SOC2, ISO 27001)

πŸ“Š Project Stats

  • Lines of Code: ~15,000+
  • Components: 50+
  • API Routes: 15+
  • Test Coverage: 85%+
  • Security Scanners: 7
  • Supported Languages: JavaScript, TypeScript, Python, Go, Java, Ruby

Built with ❀️ by the DevSecOps ke Khapeetar community

⬆ Back to Top

About

"Hunts vulnerabilities faster than you can git push --force. It uses DevSecOps tools to find bugs and judge your security practices silently, so the hackers (and your boss) don't have to loudly."

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors