npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, πŸ‘‹, I’m Ryan HefnerΒ  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you πŸ™

Β© 2026 – Pkg Stats / Ryan Hefner

devsecops-git-guardian

v1.4.0

Published

πŸ›‘οΈ Block secrets, misconfigurations, and vulnerabilities before they reach your repository. Real-time security scanning with inline diagnostics.

Readme

πŸ›‘οΈ DevSecOps Git Guardian

Autonomous Security Enforcement for Git Workflows & CI/CD Pipelines

npm version Downloads License Node TypeScript Docker

Block insecure code before it reaches your repository. A comprehensive security scanning tool that prevents secrets, misconfigurations, and vulnerabilities from entering your codebase. Available as a VS Code Extension, npm Package, and Docker Image for seamless integration into any development workflow.


✨ Features

πŸ” Multi-Scanner Security Engine

  • Secret Scanner: Detects 50+ patterns (AWS keys, API tokens, database credentials, SSH keys)
  • Docker Scanner: Finds security issues in Dockerfiles (root user, exposed ports, hardcoded secrets)
  • Config Scanner: Scans YAML/JSON for misconfigurations (debug mode, insecure settings)

πŸ›‘οΈ Autonomous Enforcement

  • Git Hook Integration: Blocks git push when violations found
  • CI/CD Pipeline Integration: Fails builds on security issues
  • Policy Engine: Configurable severity thresholds (CRITICAL, HIGH, MEDIUM, LOW)

πŸ“Š Comprehensive Reporting

  • HTML Reports with visual dashboard
  • JSON/CSV exports for automation
  • Real-time VS Code webview
  • CI/CD artifact generation

πŸ”§ Auto-Remediation

  • Automatically secures .gitignore files
  • Prevents accidental secret commits
  • Suggests fixes for violations

πŸš€ Installation

Choose what you need:

Method 1: npm Package - CLI + Git Hooks

# Install globally
npm install -g devsecops-git-guardian

# Or use without installation
npx devsecops-git-guardian

What you get:

  • βœ… CLI scanner with full reports
  • βœ… Git hooks (blocks insecure commits/pushes)
  • βœ… CI/CD integration
  • βœ… Works in any terminal/editor

Auto-setup:

  • Git hooks install automatically if .git folder exists
  • No VS Code required!

Method 2: VS Code Extension - Inline Diagnostics

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X)
  3. Search for "DevSecOps Git Guardian"
  4. Click Install

Or install from VS Code Marketplace

What you get:

  • βœ… Real-time inline warnings (red squiggly lines)
  • βœ… Hover to see security details
  • βœ… Auto-scan as you type
  • βœ… Quick fix suggestions

Note: Extension works standalone OR with npm package for git hooks


Method 3: Docker Container - Universal CI/CD

docker pull vijaydevsecops/git-guardian:latest
docker run -v $(pwd):/workspace vijaydevsecops/git-guardian:latest

What you get:

  • βœ… Platform-independent scanning
  • βœ… Perfect for Jenkins, GitLab CI, Azure Pipelines
  • βœ… No Node.js required

πŸ’‘ Which Method Should I Use?

| Use Case | Recommended Method | |----------|-------------------| | Node.js developer | npm package (CLI + hooks) | | VS Code user | Extension only (or both!) | | Want git protection | npm package (for hooks) | | Want inline warnings | VS Code extension | | CI/CD pipeline | npm package OR Docker | | Full experience | npm package + VS Code extension |

🎯 Smart Auto-Setup (npm package only):

  • Automatically installs git hooks if .git exists
  • Shows VS Code extension instructions if VS Code detected (optional)
  • No forced installations - you choose what you want!

🎯 Quick Start

CLI Usage

# Scan current directory
devsecops-scan

# Only critical issues

# Scan specific path
devsecops-scan /path/to/your/project

# Only show critical issues
devsecops-scan --severity CRITICAL

# Generate HTML report
devsecops-scan --format html --output security-report.html

# Auto-fix .gitignore security issues
devsecops-scan --fix

VS Code Extension

  1. Open your project in VS Code
  2. The extension automatically scans files as you edit
  3. View security issues inline with red squiggly lines
  4. Open Command Palette (Ctrl+Shift+P) β†’ DevSecOps: Scan Repository
  5. Ignore specific issues with // @devsecops-ignore or @devsecops-ignore-file

Docker Usage

# Basic scan
docker run -v $(pwd):/workspace vijaydevsecops/git-guardian:latest

# With custom options
docker run -v $(pwd):/workspace vijaydevsecops/git-guardian:latest \
  --severity MEDIUM --format json --output /workspace/report.json

πŸ”„ CI/CD Integration

GitHub Actions

name: Security Scan
on: [push, pull_request]

jobs:
  security:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Security Scan
        run: npx devsecops-scan --severity MEDIUM

GitLab CI

security-scan:
  image: vijaydevsecops/git-guardian:latest
  script:
    - scan $CI_PROJECT_DIR --severity MEDIUM

Jenkins

pipeline {
  agent {
    docker { image 'vijaydevsecops/git-guardian:latest' }
  }
  stages {
    stage('Security') {
      steps {
        sh 'scan . --severity MEDIUM'
      }
    }
  }
}

πŸ“Š What It Detects

πŸ”‘ Secrets & Credentials (50+ patterns)

  • AWS Access Keys & Secret Keys
  • GitHub/GitLab Personal Access Tokens
  • API Keys (Stripe, Google Cloud, Twilio, SendGrid, etc.)
  • Database Connection Strings
  • SSH Private Keys & PEM files
  • JWT Tokens & OAuth credentials
  • Hardcoded passwords

🐳 Docker Security Issues

  • Running as root user
  • Missing USER directive
  • Exposed sensitive ports (SSH, MySQL, PostgreSQL, MongoDB, Redis)
  • Using latest tag instead of pinned versions
  • Missing HEALTHCHECK
  • Hardcoded secrets in RUN commands

βš™οΈ Configuration Misconfigurations

  • Hardcoded passwords in YAML/JSON
  • Debug mode enabled in production
  • SSL/HTTPS disabled
  • Insecure default values
  • API keys in config files

βš™οΈ Configuration

CLI Options

OPTIONS:
  -p, --path <path>          Path to scan (default: current directory)
  -s, --severity <level>     Minimum severity (LOW|MEDIUM|HIGH|CRITICAL)
  -f, --format <format>      Output format (text|json|html|csv)
  -o, --output <file>        Save report to file
  --no-block                 Don't exit with error code on violations
  -v, --verbose              Verbose output
  --fix                      Auto-fix .gitignore security issues
  -h, --help                 Show help
  --version                  Show version

VS Code Settings

{
  "devsecops.autoInstallHooks": true,
  "devsecops.blockOnViolation": true,
  "devsecops.severityThreshold": "medium",
  "devsecops.scanExclusions": [
    "node_modules/**",
    "dist/**",
    "build/**"
  ]
}

πŸ“ˆ Exit Codes

  • 0 - No security violations found βœ…
  • 1 - Security violations found (blocks CI/CD) ❌
  • 2 - Scan error occurred ⚠️

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         Security Scanner                β”‚
β”‚        (Orchestrator)                   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
             β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚        β”‚        β”‚
    β–Ό        β–Ό        β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚Secret  β”‚ β”‚Docker  β”‚ β”‚Config  β”‚
β”‚Scanner β”‚ β”‚Scanner β”‚ β”‚Scanner β”‚
β””β”€β”€β”€β”€β”¬β”€β”€β”€β”˜ β””β”€β”€β”€β”¬β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”¬β”€β”€β”€β”€β”˜
     β”‚         β”‚          β”‚
     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β–Ό
      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
      β”‚ Policy Engine  β”‚
      β”‚ (BLOCK/ALLOW)  β”‚
      β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
               β–Ό
      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
      β”‚ Report         β”‚
      β”‚ Generator      β”‚
      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“š Documentation

For detailed information, see:


πŸ› οΈ Development

# Clone repository
git clone https://github.com/vijay-devsecops/git-guardian.git
cd git-guardian

# Install dependencies
npm install

# Build VS Code extension
npm run package

# Build CLI for npm
npm run build:cli

# Build everything
npm run build:all

# Test locally
npm test

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Please ensure your code:

  • Follows the existing code style
  • Includes appropriate tests
  • Updates documentation as needed

πŸ“ License

MIT License - Free to use for personal and commercial projects.


πŸ†˜ Support & Community


⭐ Show Your Support

If DevSecOps Git Guardian helped secure your codebase, please consider:

  • ⭐ Starring the repository on GitHub
  • πŸ“¦ Sharing it with your team
  • πŸ› Reporting bugs to help improve the tool
  • πŸ’‘ Suggesting new features

πŸ”’ Security

This tool is designed to find security vulnerabilities, but no tool is perfect. If you discover a security issue in DevSecOps Git Guardian itself, please email [email protected] directly rather than opening a public issue.


Built with dedication for the DevSecOps community πŸ›‘οΈ