Skip to content

26 false positive laravelhorizon classified as a development package#27

Merged
dgtlss merged 2 commits into
mainfrom
26-false-positive-laravelhorizon-classified-as-a-development-package
May 21, 2026
Merged

26 false positive laravelhorizon classified as a development package#27
dgtlss merged 2 commits into
mainfrom
26-false-positive-laravelhorizon-classified-as-a-development-package

Conversation

@dgtlss

@dgtlss dgtlss commented May 21, 2026

Copy link
Copy Markdown
Owner

This PR fixes false positives around Laravel Horizon in the debug-mode audit and adds a general suppression mechanism for accepted findings.

Related issue: #26

Previously, Warden treated laravel/horizon as a development package and flagged any horizon/* route as an exposed testing route. That produced incorrect results for normal production Horizon setups. This change removes Horizon from both of those checks while keeping existing Telescope and Dusk behavior unchanged.

To make this more durable going forward, the PR also adds a new top-level ignore_findings configuration option. Findings can now be suppressed centrally before output formatting, notifications, and exit-code calculation. Rules match when all provided fields match, and string values support wildcard matching.

Summary by CodeRabbit

  • New Features

    • Added support for ignoring previously reviewed or accepted audit findings via configurable rules in the application settings.
  • Documentation

    • Added documentation explaining how to suppress specific findings using ignore rules.
  • Chores

    • Bumped package version from 1.5.1 to 1.5.3.

Review Change Stack

dgtlss added 2 commits May 21, 2026 23:28
Introduce an 'ignore_findings' config to allow suppressing accepted/context-specific findings via match rules (supports wildcard strings). WardenAuditCommand now filters findings before reporting/notifications (added filterIgnoredFindings and helper methods using Str::is). Updated config and readme with usage examples. Refine DebugModeAuditService to stop flagging laravel/horizon and its routes as development/testing artifacts. Added tests for ignore rules, JSON output behavior, cached-findings filtering, and debug-mode expectations.
Update composer.json version from 1.5.1 to 1.5.3 to reflect a new patch release. No other changes were made in this commit.
@dgtlss dgtlss linked an issue May 21, 2026 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This release introduces a configurable ignore-findings mechanism to suppress accepted audit results, refines debug-mode detection for specific packages and routes, and adds comprehensive test coverage. The version is bumped to 1.5.3.

Changes

Ignore findings feature and debug mode audit refinements

Layer / File(s) Summary
Ignore findings configuration and command integration
src/config/warden.php, src/Commands/WardenAuditCommand.php, readme.md
New ignore_findings configuration array enables rule-based filtering of audit findings by matching finding payload keys. The WardenAuditCommand applies this filtering before notifications via filterIgnoredFindings() and supporting helpers (shouldIgnoreFinding(), findingMatchesIgnoreRule(), findingValueMatchesRule()) that support string wildcard patterns using Str::is() and strict equality fallback.
Ignore findings command tests
tests/Commands/WardenAuditCommandTest.php
Three new test cases verify that findings matching warden.ignore_findings rules are suppressed before webhook/email notifications are sent, wildcard rules work in JSON output, and cached findings are filtered in sequential execution mode.
Debug mode audit service refinements
src/Services/Audits/DebugModeAuditService.php, tests/Services/Audits/DebugModeAuditServiceTest.php
Horizon is removed from the development-package detection list; Laravel/dusk and beyondcode/laravel-dump-server are added. Testing-route detection now includes telescope and _dusk whilst removing horizon. New test class verifies Horizon is no longer flagged as a dev package or testing route in production, whilst Telescope and Dusk routes remain flagged.
Version bump and formatting
composer.json, readme.md
Package version updated from 1.5.1 to 1.5.3; README footer formatting adjusted.

Sequence Diagram(s)

The diagram in the hidden review stack illustrates how the ignore-findings filtering integrates into the audit command's result processing pipeline, showing the sequential evaluation of ignore rules against each finding via pattern and equality matching.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Poem

🐰 A rabbit hops through warden's halls,
Ignoring findings that once called,
With wildcard rules in config's glow,
And debug routes refined just so.
Version bumped to 1.5.3,
Security audits, clean and free! 🐇

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 27.27% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title directly addresses the main issue: false positives with Laravel Horizon being classified as a development package.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 26-false-positive-laravelhorizon-classified-as-a-development-package

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dgtlss dgtlss merged commit c392c3e into main May 21, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False positive: laravel/horizon classified as a development package

1 participant