jaydeep/laravel-guarddog

Laravel GuardDog โ€” Scan your Laravel project for common security vulnerabilities and generate beautiful HTML reports.

Maintainers

Package info

github.com/JaydeepGadhiya/laravel-guarddog

pkg:composer/jaydeep/laravel-guarddog

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 0

v1.0.0 2026-04-04 09:53 UTC

This package is auto-updated.

Last update: 2026-04-04 09:56:43 UTC


README

Laravel PHP License Stars

Laravel GuardDog is a security scanner for Laravel applications that detects common vulnerabilities and generates a beautiful HTML security report with a security score.

GuardDog helps developers quickly identify security risks before deploying their applications.

โœจ Features

  • ๐Ÿ”Ž Automatic Laravel security scanning
  • ๐Ÿ“Š Security Score (0โ€“100)
  • ๐Ÿงพ Beautiful HTML report generation
  • โšก Fast and lightweight scanning engine
  • ๐Ÿ” Detects common Laravel security risks
  • ๐Ÿงฉ Supports Laravel 8 โ†’ 13
  • ๐Ÿš€ CI/CD friendly

๐Ÿ“ธ Screenshots

Console Output

Console Scan

HTML Security Report

HTML Report

๐Ÿ” What GuardDog Detects

Laravel GuardDog scans your project and detects:

  • Raw SQL queries (possible SQL injection)
  • Routes without authentication middleware
  • File uploads without validation
  • Missing CSRF tokens in forms
  • Unsafe environment configurations

๐Ÿ“ธ Example HTML Report

GuardDog generates a clean HTML report stored inside:

storage/guarddog-security-report.html

Example information inside the report:

  • Security score with circular progress indicator
  • Total files scanned
  • Total issues detected
  • Detailed vulnerability list with severity badges

๐Ÿ“ฆ Installation

Install via Composer:

composer require jaydeep/laravel-guarddog

Laravel will automatically discover the package.

โš™๏ธ Publish Configuration (Optional)

php artisan vendor:publish --tag=guarddog-config

This will create config/guarddog.php in your project.

๐Ÿš€ Usage

Run the security scanner:

php artisan guarddog:scan

Command Options

Option Description
--no-html Skip HTML report generation
--output= Custom output path for HTML report

Examples

# Full scan with HTML report
php artisan guarddog:scan

# Console output only, no HTML file
php artisan guarddog:scan --no-html

# Custom report location
php artisan guarddog:scan --output=public/security-report.html

Example Console Output

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘         ๐Ÿ• Laravel GuardDog Security Report              โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

  Files scanned:  142
  Issues found:   5

  Security Score: 83 / 100 (Good)

  โ— CRITICAL: 1
  โ— WARNING:  3
  โ— NOTICE:   1

โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

  CRITICAL
  Raw SQL with variable interpolation in DB::statement()
  File: app/Repositories/UserRepository.php:54

  WARNING
  Route without auth middleware
  File: routes/web.php:23

โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

๐Ÿ“Š Security Score System

GuardDog calculates a security score starting from 100.

Points are deducted based on detected issues:

Severity Points Deducted
Critical -15
Warning -7
Notice -3

Score Meaning:

Score Status
90โ€“100 Excellent
70โ€“89 Good
50โ€“69 Risky
Below 50 Critical

๐Ÿ“„ HTML Report

After running the scan, GuardDog generates a report:

storage/guarddog-security-report.html

The report includes:

  • Security Score with circular progress bar
  • Scan date
  • Total files scanned
  • List of vulnerabilities with file paths and line numbers
  • Severity indicators

Severity colors:

  • ๐Ÿ”ด Critical
  • ๐ŸŸ  Warning
  • ๐Ÿ”ต Notice

โš™๏ธ Configuration

Configuration file: config/guarddog.php

Example configuration:

return [

    'scan_paths' => [
        'app/',
        'routes/',
        'resources/views/',
        'config/',
    ],

    'ignore_paths' => [
        'vendor/',
        'node_modules/',
        'storage/',
    ],

    'report_output_path' => storage_path('guarddog-security-report.html'),

];

๐Ÿ›  Planned Features

Upcoming improvements:

  • Dependency vulnerability scanner
  • Automatic security fix suggestions
  • GitHub Actions integration
  • Historical security tracking
  • Dashboard UI

๐Ÿค Contributing

Contributions are welcome!

If you find a bug or want to add a new security scanner, feel free to open a Pull Request.

๐Ÿ“œ License

This package is open-sourced software licensed under the MIT license.

๐Ÿ‘จโ€๐Ÿ’ป Author

Developed by Jaydeep Gadhiya

If you find this package useful, please consider giving it a โญ on GitHub.