Skip to content

SolanaRemix/GitAntivirus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GitAntivirus – CyberAi Ecosystem Service

GitAntivirus Version License

πŸ›‘οΈ Overview

GitAntivirus is an intelligent security scanning service that automatically detects and fixes vulnerabilities in your repositories. It can be triggered via comments and provides automated security scanning, leak detection, and auto-remediation capabilities.

✨ Key Features

  • πŸ” Automated Security Scanning - Detects security vulnerabilities, leaks, and exposed secrets
  • πŸ”‘ Credential Detection - Identifies exposed API keys, tokens, environment variables
  • πŸ› Black Hole Detection - Finds potential security holes and misconfigurations
  • πŸ“¦ Package Security - Scans package.json and dependencies for vulnerabilities
  • πŸ€– Auto-Fix Capability - Automatically creates PRs with security fixes
  • πŸ“Š Detailed Reports - Generates comprehensive scan reports
  • 🌍 Global Repository Support - Works on any public GitHub repository
  • πŸ’¬ Comment-Triggered - Simply mention @GitAntivirus or @GitAnt to trigger scans

πŸš€ Quick Start

Triggering a Scan

Simply mention the bot in a comment on any issue or pull request:

@GitAntivirus scan this repository

or use the shorter alias:

@GitAnt check for vulnerabilities

What Gets Scanned

GitAntivirus automatically scans for:

  • πŸ” Exposed Secrets

    • API keys (AWS, Google Cloud, Azure, etc.)
    • Access tokens and authentication credentials
    • Private keys and certificates
    • Database connection strings
  • πŸ“ Sensitive Files

    • .env files and environment configurations
    • Configuration files with credentials
    • Backup files with sensitive data
  • πŸ’» Code Vulnerabilities

    • JavaScript security issues
    • JSON structure problems
    • Dependency vulnerabilities in package.json
    • Known CVEs in packages
  • πŸ•³οΈ Security Holes

    • Insecure configurations
    • Exposed endpoints
    • Permission misconfigurations

πŸ“– User Guide

Basic Usage

  1. Scan a Repository

    @GitAntivirus scan
    
  2. Scan and Auto-Fix

    @GitAntivirus scan and fix
    
  3. Check Specific Files

    @GitAntivirus check package.json
    
  4. Generate Report

    @GitAntivirus report
    

Advanced Commands

  • @GitAntivirus full-scan - Deep scan of entire repository
  • @GitAntivirus check-dependencies - Scan package.json dependencies
  • @GitAntivirus fix-package - Auto-fix package.json issues
  • @GitAntivirus detect-leaks - Focus on credential/key detection
  • @GitAntivirus troubleshoot - Diagnose repository issues

Labels and Categorization

GitAntivirus automatically adds labels to issues and PRs:

  • security - Security vulnerabilities found
  • credentials-leak - Exposed credentials detected
  • auto-fix - Automated fix applied
  • needs-review - Manual review required
  • vulnerability-high - Critical security issue
  • vulnerability-medium - Medium severity issue
  • vulnerability-low - Low severity issue

πŸ”§ Developer Documentation

Architecture

GitAntivirus is built with a modular architecture:

GitAntivirus/
β”œβ”€β”€ scanner/          # Core scanning engine
β”‚   β”œβ”€β”€ secrets.js    # Secret detection
β”‚   β”œβ”€β”€ files.js      # File analysis
β”‚   β”œβ”€β”€ packages.js   # Package vulnerability scanning
β”‚   └── code.js       # Code analysis
β”œβ”€β”€ fixes/            # Auto-fix implementations
β”‚   β”œβ”€β”€ credentials.js
β”‚   β”œβ”€β”€ packages.js
β”‚   └── config.js
β”œβ”€β”€ reporters/        # Report generation
β”‚   β”œβ”€β”€ markdown.js
β”‚   └── json.js
└── web/              # Web interface
    └── index.html

Scanner Modules

1. Secret Scanner

Detects exposed credentials using pattern matching and entropy analysis:

// Example patterns detected:
- AWS Access Keys: AKIA[0-9A-Z]{16}
- GitHub Tokens: ghp_[a-zA-Z0-9]{36}
- API Keys: [a-zA-Z0-9]{32,}
- Private Keys: -----BEGIN.*PRIVATE KEY-----

2. File Scanner

Analyzes files for sensitive content:

// Scanned file types:
- .env, .env.local, .env.production
- config.json, secrets.json
- .aws/credentials
- .ssh/* keys

3. Package Scanner

Checks dependencies for known vulnerabilities:

// Checks against:
- npm audit database
- Snyk vulnerability database
- GitHub Security Advisories

4. Code Scanner

Analyzes code for security issues:

// Detects:
- Hardcoded credentials
- SQL injection vulnerabilities
- XSS vulnerabilities
- Insecure cryptography

Auto-Fix Capabilities

GitAntivirus can automatically fix:

  1. Remove exposed credentials - Replaces with environment variable references
  2. Update vulnerable packages - Updates to patched versions
  3. Fix configuration issues - Corrects insecure settings
  4. Add .gitignore entries - Prevents future exposure of sensitive files

API Integration

// Programmatic usage
const GitAntivirus = require('gitantivirus');

const scanner = new GitAntivirus({
  repo: 'owner/repo',
  token: process.env.GITHUB_TOKEN
});

// Run scan
const results = await scanner.scan();

// Apply fixes
await scanner.autoFix(results);

// Generate report
const report = scanner.generateReport(results);

🌍 Global Repository Support

GitAntivirus can scan any public GitHub repository:

  1. Fork or clone the repository
  2. Run GitAntivirus scan
  3. Review findings
  4. Create PR with fixes to original repository

Contributing to Other Projects

@GitAntivirus scan and contribute to owner/repo

This will:

  • Clone the target repository
  • Run security scan
  • Create a PR with fixes
  • Add detailed report of findings

πŸ” Security and Privacy

  • No Data Storage - Scan results are not stored permanently
  • Token Security - All tokens are encrypted and never logged
  • Private Repo Support - Requires proper authentication
  • Audit Logging - All actions are logged for transparency

πŸ“Š Scan Reports

GitAntivirus generates detailed reports including:

  • Executive Summary - High-level overview of findings
  • Vulnerability Details - Detailed description of each issue
  • Risk Assessment - Severity ratings and impact analysis
  • Remediation Steps - How to fix each issue
  • Code Snippets - Exact locations of vulnerabilities

Example Report

# Security Scan Report

## Summary
- Total Issues: 12
- Critical: 2
- High: 4
- Medium: 4
- Low: 2

## Critical Issues

### 1. Exposed AWS Credentials
**File:** `config/aws.js:15`
**Severity:** Critical
**Description:** AWS access key found in source code
**Remediation:** Move to environment variables

### 2. Vulnerable Package
**Package:** `lodash@4.17.15`
**Severity:** Critical
**CVE:** CVE-2020-8203
**Remediation:** Update to version 4.17.21

πŸ› οΈ Installation

For Repository Owners

  1. Install the GitAntivirus GitHub App
  2. Grant repository access
  3. Trigger scans via comments

For Contributors

  1. Fork this repository
  2. Install dependencies:
    npm install
  3. Set up environment variables:
    cp .env.example .env
    # Edit .env with your configuration
  4. Run locally:
    npm start

πŸ“ Configuration

Create a .gitantivirus.yml file in your repository root:

# GitAntivirus Configuration
version: 1.0

scanning:
  enabled: true
  auto_fix: true
  scan_dependencies: true
  scan_secrets: true
  
exclusions:
  paths:
    - node_modules/
    - dist/
    - build/
  files:
    - "*.test.js"
    - "*.spec.js"

severity_threshold: medium

notifications:
  enabled: true
  channels:
    - github_issues
    - pull_requests

auto_fix:
  enabled: true
  create_pr: true
  require_approval: false

🀝 Contributing

We welcome contributions! Please see our contributing guidelines:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

πŸ“„ License

MIT License - see LICENSE file for details

πŸ†˜ Support

πŸ™ Acknowledgments

GitAntivirus is part of the CyberAi Ecosystem, providing automated security solutions for the open-source community.


Made with ❀️ by the CyberAi Team

Keeping your code secure, one commit at a time.

About

GitAntivirus

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors