Coder Social home page Coder Social logo

patrol's Introduction

Patrol logo

Patrol

Total Downloads License


Patrol is an elegant command-line tool that keeps your PHP Project's dependencies in check.

Installation / Usage

Requires PHP 8.2+

First, install Patrol via the Composer package manager:

composer require nunomaduro/patrol --dev

Then, use the patrol binary:

./vendor/bin/patrol

You may also specify the directory that should be inspected:

./vendor/bin/patrol inspect ../another/project-directory

License

Patrol is an open-sourced software licensed under the MIT license.

patrol's People

Contributors

caneco avatar nunomaduro avatar rogervila avatar seriquynh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

patrol's Issues

Patrol can not find anything in definitely vulnerable file

Introduction

In my case, patrol can not check any dependencies, even with security vulnerabilities. I hope, author of tool fix this behavior at near future.
definitely vurnelable file for scan
image

My versions

$ uname -a
Linux WhiteBlockAtCorner 5.15.0-33-generic #34-Ubuntu SMP Wed May 18 13:34:26 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
$ php --version
PHP 8.1.2 (cli) (built: Apr  7 2022 17:46:26) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.2, Copyright (c), by Zend Technologies
$ patrol --version
Patrol 1.1.0

https://gist.github.com/elzekool/0bcda55400a12bae43710fbda0430af9

Steps to reproduce

$ cd ~/Downloads
$ wget --output-document=composer.lock https://gist.githubusercontent.com/elzekool/0bcda55400a12bae43710fbda0430af9/raw/deb2d2ba5d4e3fb34af9ff02a997961ed4630017/composer.lock
[...]
Length: 89930 (88K) [text/plain]
Saving to: ‘composer.lock’
$ cd /path/to/patrol

image
image

Conclusion:

I can not directly scan target file, I must give as argument parent folder of it. But even when patrol scan file, then as output: "no problems".

Unable to launch a new process.

This error occurs when running patrol, I'm not sure where to start debugging, -vvv did not give much more output but just the stack trace which might tell you something :D

simulise git:develop ❯ patrol inspect -vvv   

In Process.php line 350:
                                                          
  [Symfony\Component\Process\Exception\RuntimeException]  
  Unable to launch a new process.                                                                                   

Exception trace:
  at /Users/alexbouma/.composer/vendor/symfony/process/Process.php:350
 Symfony\Component\Process\Process->start() at /Users/alexbouma/.composer/vendor/nunomaduro/patrol/src/Support/ComposerBinary.php:141
 NunoMaduro\Patrol\Support\ComposerBinary->NunoMaduro\Patrol\Support\{closure}() at n/a:n/a
 array_map() at /Users/alexbouma/.composer/vendor/nunomaduro/patrol/src/Support/Collection.php:169
 NunoMaduro\Patrol\Support\Collection->map() at /Users/alexbouma/.composer/vendor/nunomaduro/patrol/src/Support/ComposerBinary.php:144
 NunoMaduro\Patrol\Support\ComposerBinary->run() at /Users/alexbouma/.composer/vendor/nunomaduro/patrol/src/Support/ComposerBinary.php:90
 NunoMaduro\Patrol\Support\ComposerBinary->why() at /Users/alexbouma/.composer/vendor/nunomaduro/patrol/src/Repositories/Composer.php:106
 NunoMaduro\Patrol\Repositories\Composer->mutate() at /Users/alexbouma/.composer/vendor/nunomaduro/patrol/src/Repositories/Composer.php:65
 NunoMaduro\Patrol\Repositories\Composer->all() at /Users/alexbouma/.composer/vendor/nunomaduro/patrol/src/Handlers/Score.php:53
 NunoMaduro\Patrol\Handlers\Score->__invoke() at /Users/alexbouma/.composer/vendor/nunomaduro/patrol/src/Commands/InspectCommand.php:70
 NunoMaduro\Patrol\Commands\InspectCommand->NunoMaduro\Patrol\Commands\{closure}() at /Users/alexbouma/.composer/vendor/nunomaduro/patrol/src/Support/Collection.php:142
 NunoMaduro\Patrol\Support\Collection->each() at /Users/alexbouma/.composer/vendor/nunomaduro/patrol/src/Commands/InspectCommand.php:70
 NunoMaduro\Patrol\Commands\InspectCommand->execute() at /Users/alexbouma/.composer/vendor/symfony/console/Command/Command.php:288
 Symfony\Component\Console\Command\Command->run() at /Users/alexbouma/.composer/vendor/symfony/console/Application.php:974
 Symfony\Component\Console\Application->doRunCommand() at /Users/alexbouma/.composer/vendor/symfony/console/Application.php:291
 Symfony\Component\Console\Application->doRun() at /Users/alexbouma/.composer/vendor/symfony/console/Application.php:167
 Symfony\Component\Console\Application->run() at /Users/alexbouma/.composer/vendor/nunomaduro/patrol/bin/patrol:35
 {closure}() at /Users/alexbouma/.composer/vendor/nunomaduro/patrol/bin/patrol:36

inspect [--min MIN] [--] [<directory>]

PHP:

PHP 8.0.7 (cli) (built: Jun  4 2021 03:56:55) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.7, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.7, Copyright (c), by Zend Technologies
    with blackfire v1.59.2~mac-x64-non_zts80, https://blackfire.io, by Blackfire

Composer:

Composer version 2.1.3 2021-06-09 16:31:20

I installed patrol globally by doing composer global require nunomaduro/patrol, and for good measure also did a composer global update to make sure everything is up-to-date.

Output only found security vulnerabilities?

Is there a way to run patrol to just output found security vulnerabilities, if there are any, otherwise be quiet? Would be useful for automatic checks from crontab, which would send e-mail only if there is security updates that should be applied.

Implement a progress bar while scanning

Hi guys, while i scanning my project with patrol, this take a long time to complete run.
My project has 191 dependencies, and I think it would be really cool to have a progress bar during analysis.

image

What do you guys think about?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.