enlightn/security-checker
CLI security checker for PHP/Laravel projects. Scans your composer.lock against FriendsOfPHP Security Advisories to detect vulnerable dependencies. Install via Composer or PHAR, run security:check, get ANSI/JSON output, optional no-dev filtering and allowlisting.
## Technical Evaluation
### **Architecture Fit**
- **Purpose Alignment**:
- Remains aligned with **lightweight, automated vulnerability scanning** for PHP/Laravel dependency stacks.
- **Shift-Left Security** and **compliance automation** use cases unchanged.
- **Laravel Ecosystem** compatibility remains intact (no Laravel-specific changes).
- **Non-Functional Fit**:
- **Stateless Design** and **low overhead** characteristics preserved.
- **Extensible Outputs** (JSON/CLI) remain unchanged.
- **New Contribution**:
- **Symfony-Specific Fix**: Addresses a **missing `int` return type** in Symfony components (see [#35](https://github.com/enlightn/security-checker/pull/35)).
- **Impact**: Improves **type safety** for projects using Symfony components (e.g., Laravel’s Symfony-based internals).
- **No Breaking Changes**: Fix is **backward-compatible** (no API or CLI modifications).
### **Integration Feasibility**
- **Laravel Compatibility**:
- **Pros**:
- **Symfony Fix**: Enhances compatibility with **Laravel’s Symfony dependencies** (e.g., `symfony/console`, `symfony/http-kernel`).
- **No CLI/Artisan Changes**: Existing integration paths (e.g., custom Artisan commands) remain valid.
- **Cons**:
- **No New Laravel-Specific Features**: Still requires manual CLI invocation or wrapper commands.
- **Symfony Focus**: Fix is **niche** (primarily benefits projects using Symfony components).
- **Dependency Conflicts**:
- **Low Risk**: Fix is **isolated to Symfony** and does not affect other dependencies.
- **Overlap**: Still may conflict with `roave/security-advisories` if run in the same stage.
### **Technical Risk**
| **Risk Area** | **Severity** | **Mitigation Strategy** |
|-----------------------------|-------------|-----------------------------------------------------------------------------------------|
| **False Positives/Negatives** | Medium | Cross-validate with Snyk/GitHub Advisories; unchanged from v1.x. |
| **Symfony-Specific Issues** | Low | Test with projects using Symfony components (e.g., Laravel + Symfony bundles). |
| **CI/CD Flakiness** | Medium | Unchanged; cache results and run in dedicated stages. |
| **Laravel-Specific Gaps** | Low | Wrap in custom Artisan command for tighter integration (no new features in v2.0.0). |
| **Performance Bottlenecks** | Low | Unchanged; exclude `vendor/` directories for monorepos. |
### **Key Questions**
1. **Strategic Fit**:
- Should this **replace** `roave/security-advisories` or **complement** it? *(Unchanged)*
- Does the **Symfony fix** justify adoption for teams using Symfony components? *(New)*
2. **Output Handling**:
- How will results be **actionable**? *(Unchanged)*
- Are there needs for **custom severity thresholds**? *(Unchanged)*
3. **CI/CD Integration**:
- Where in the pipeline should it run? *(Unchanged)*
- Should it **fail builds** on critical/high-severity issues? *(Unchanged)*
4. **Long-Term Roadmap**:
- Will this be the **sole scanner** or part of a broader toolchain? *(Unchanged)*
- Are there plans for **Laravel testing tool integration**? *(Unchanged)*
5. **Maintenance**:
- Who will **own updates**? *(Unchanged)*
- How will **false positives** be triaged? *(Unchanged)*
6. **Symfony-Specific**:
- **New**: Does your project use **Symfony components** (e.g., beyond Laravel’s defaults)? If so, does this fix address a critical gap?
- **New**: Should this tool be **prioritized** for projects with heavy Symfony dependencies?
---
## Integration Approach
### **Stack Fit**
- **Ideal Use Cases** *(Unchanged)*:
- PHP 8.0+/Laravel 8+ projects with Composer-managed dependencies.
- Teams using **GitHub Actions/GitLab CI** for automated security gates.
- Organizations requiring **SOC2/ISO 27001 compliance**.
- **Enhanced Fit** *(New)*:
- Projects using **Symfony components** (e.g., Laravel + custom Symfony bundles, standalone Symfony apps).
- **Less Ideal For** *(Unchanged)*:
- Non-Composer dependency management.
- Teams without CI/CD pipelines.
### **Migration Path**
1. **Pilot Phase** *(Unchanged)*:
- **Installation**:
```bash
composer require --dev enlightn/security-checker:^2.0
```
- **Test Run**:
```bash
vendor/bin/security-checker security:check composer.lock
```
- **Validation**: Compare results with `roave/security-advisories` or Snyk.
2. **Symfony-Specific Validation** *(New)*:
- Test with projects using **Symfony components** (e.g., `symfony/console`, `symfony/http-client`).
- Verify no **regressions** in Symfony-based functionality.
3. **CI/CD Integration** *(Unchanged)*:
- Example GitHub Actions workflow remains identical.
4. **Laravel-Specific Integration** *(Unchanged)*:
- Artisan command wrapper example remains valid.
### **Compatibility**
- **PHP Versions**: 8.0–8.3 *(Unchanged)*.
- **Composer**: 2.x *(Unchanged)*.
- **Laravel**: No hard dependency *(Unchanged)*.
- **Symfony Components**: **Improved** with v2.0.0 fix *(New)*.
- **Existing Tools**:
- **Complementary**: Works alongside `phpstan`, `psalm` *(Unchanged)*.
- **Overlap**: Avoid running multiple scanners in the same stage *(Unchanged)*.
### **Sequencing** *(Unchanged)*
1. **Developer Workflow**: Add to `composer.json` scripts.
2. **CI Pipeline**: Run after `composer install`, before tests.
3. **Post-Deploy**: Schedule periodic scans.
---
## Operational Impact
### **Maintenance**
- **Update Cadence**:
- **v2.0.0**: **Critical for Symfony users** (test immediately if using Symfony components).
- **Monthly**: Continue updating for latest advisories *(Unchanged)*.
- **Dependency Management**:
- **Symfony Fix**: No breaking changes; update to `^2.0` for the patch *(New)*.
- **Tooling**:
- **No Changes**: Existing wrappers/alerting setups remain compatible *(Unchanged)*.
### **Support**
- **Troubleshooting**:
- **Symfony-Specific Issues**:
- If using Symfony components, verify the fix resolves **missing `int` return type warnings**.
- Debug with:
```bash
vendor/bin/security-checker security:check --verbose
```
- **Common Issues** *(Unchanged)*: False positives, permission errors, slow scans.
- **Community**:
- **GitHub Activity**: Low open issues; fix is **targeted and stable** *(Unchanged)*.
- **Alternatives**: `roave/security-advisories` (more maintained), `snyk` *(Unchanged)*.
### **Scaling**
- **Performance** *(Unchanged)*:
- Small/medium projects: <10s.
- Large monorepos: Optimize with `--exclude`.
- **Symfony Impact** *(New)*:
- **No Performance Changes**: Fix is **runtime-safe** and does not affect scan speed.
- **Type Safety**: May reduce **PHPStan/Psalm warnings** for Symfony users.
### **Failure Modes**
- **Symfony-Specific Risks** *(New)*:
- **False Negatives**: If a Symfony component vulnerability exists but is not yet in the advisory database.
- **Mitigation**: Cross-check with [Symfony Security Advisories](https://symfony.com/security).
- **Unchanged Risks**:
- False positives, CI flakiness, outdated advisories.
### **Ramp-Up**
- **For Symfony Users**:
- **Action**: Update to `^2.0` and test with Symfony-heavy projects.
- **Validation**: Compare results with `symfony/security:checker` (if used).
- **For Non-Symfony Users**:
- **Action**: No urgent update needed; v2.0.0 is a **backward-compatible patch**.
- **Consideration**: Adopt if using Symfony components or planning to.
- **Documentation**:
- **New**: Highlight the Symfony fix in internal runbooks for relevant teams.
NO_UPDATE_NEEDED would not apply here due to the Symfony-specific fix, which warrants updates to the Technical Evaluation, Integration Approach, and Operational Impact sections. The above is the fully revised assessment.
How can I help you explore Laravel packages today?