- Saved searches
- Use saved searches to filter your results more quickly
- License
- fabpot/local-php-security-checker
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- PHP: инструменты для тестирования, отладки, защиты и мониторинга
- Тестирование
- Отладка
- Безопасность
- Мониторинг
- 9 Best PHP Code Security Scanner to Find Vulnerabilities
- PMF
- RIPS
- SonarPHP
- Exakat
- PHPStan
- Psalm
- Progpilot
- Grabber
- Symfony
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
PHP security vulnerabilities checker
License
fabpot/local-php-security-checker
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Move value computation out of a loop
Git stats
Files
Failed to load latest commit information.
README.md
Local PHP Security Checker
The Local PHP Security Checker is a command line tool that checks if your PHP application depends on PHP packages with known security vulnerabilities. It uses the Security Advisories Database behind the scenes.
Download a binary from the Releases page on Github, rename it to local-php-security-checker and make it executable.
From a directory containing a PHP project that uses Composer, check for known vulnerabilities by running the binary without arguments or flags:
You can also pass a —path to check a specific directory:
$ local-php-security-checker --path=/path/to/php/project $ local-php-security-checker --path=/path/to/php/project/composer.lock
By default, the output is optimized for terminals, change it via the —format flag (supported formats: ansi , markdown , json , junit , and yaml ):
$ local-php-security-checker --format=json
All packages are checked for security vulnerabilities by default. You can skip the checks for packages listed in require-dev by passing the no-dev flag:
$ local-php-security-checker --no-dev
When running the command, it checks for an updated vulnerability database and downloads it from Github if it changed since the last run. If you want to avoid the HTTP round-trip, use —local . To force a database update without checking for a project, use —update-cache .
If you want to continuously check for security issues on your applications in production, you can use this tool in combination with croncape to get an email whenever a new security issue is detected:
MAILTO=sysadmins@example.com 50 23 * * * croncape php-security-checker --path=/path/to/php/project
PHP: инструменты для тестирования, отладки, защиты и мониторинга
Продолжаем обсуждать инструменты, которые будут полезны тем, кто ведет разработку на языке PHP. Предыдущая статья была посвящена средам разработки и текстовым редакторам, в этой я расскажу об инструментах, которые используются для тестирования, отладки, защиты и мониторинга.
Тестирование
PHPUnit — инструмент для тестирования, похожий на JUnit (который используется для тестирования Java). Он дает возможность создавать собственные юнит-тесты и выводить результаты в нескольких форматах. Сейчас это один из самых популярных фреймворков для юнит-тестирования в PHP. PHPUnit отлично подойдет для тестирования масштабируемости.
Selenium — это легковесный фреймворк для тестирования с открытым исходным кодом. Он позволяет создавать UI-тесты на любом языке программирования. Совместим с большинством браузеров и отлично работает на Windows, Linux и macOS.
Отладка
Начиная с 2002 года (года запуска), Xdebug является одним из самых надежных инструментов PHP-разработчика. Он позволяет профилировать и отлаживать PHP-скрипты. Xdebug доступен в качестве плагина для Eclipse, PHPDesigner, а также совместим с многими другими инструментами разработки.
DebugBar — опенсорс-инструмент, который будет полезен любому разработчику, так как позволяет отслеживать в том числе ошибки в HTML и JS. Также DebugBar дает возможность мониторить сетевой трафик, оценивать качество JS-кода и инспектировать стили.
Как понятно уже из названия, MacGDBp используется для отладки PHP на Маке. Вместе с расширением Xdebug дает возможность работать с локальными переменными и выводить стеки в интерфейсе macOS.
Безопасность
Проект изначально представлял собой утилиту с открытым исходным кодом для выявления уязвимостей в приложениях на PHP, но позже превратился в полноценный сервис мониторинга за безопасностью. Ранее существовала бесплатная версия, а сейчас можно запросить тестовый период для того, чтобы оценить функционал утилиты.
Утилита имеет открытый исходный код и позволяет создавать капчу для защиты разных форм для заполнения в PHP-приложениях. Особенно полезно ее использовать для форм регистрации, она позволит отфильтровать спам и угрозы безопасности.
Мониторинг
Retrace используется для отслеживания производительности. Также имеет функцию, позволяющую оперативно отслеживать ошибки и баги. Решить, стоит ли платить за этот продукт, можно в течение бесплатного 14-дневного периода.
New Relic APM
New Relic похож на Retrace и тоже дает возможность отслеживать производительность вашего PHP-приложения. Помимо этого, New Relic позволяет собирать данные пользователей, которые можно использовать для улучшения UX.
Если вы когда-нибудь использовали TraceView, то быстро сможете освоить и работу с AppOptics, т.к. компания-разработчик Solarwinds приобрела TraceView и внедрила все его функции в свой собственный инструмент мониторинга. Помимо PHP, AppOprics также поддерживает Java, Python и .NET. Сервис в реальном времени показывает работу приложений, а также отслеживает все ошибки и проблемные места, которые напрямую влияют на производительность.
9 Best PHP Code Security Scanner to Find Vulnerabilities
Invicti Web Application Security Scanner – the only solution that delivers automatic verification of vulnerabilities with Proof-Based Scanning™.
Find security risk and code quality in your PHP application.
PHP rules the web, with around 80% of the market share. It’s everywhere – WordPress, Joomla, Lavarel, Drupal, etc.
PHP core is secure, but there are a lot more on top of this, which you might be using, and that might be vulnerable. After the development of a site or complex web application, most of the developers and site owners focus on functionality, design, SEO, and they forget the essential component – security.
As a best practice, you should consider performing a security scan against your application before going live. This applies to any site – small or big. There are some tools to help you with that.
PMF
PHP Malware Finder (PMF) is a self-hosted solution to help you find possible malicious codes in the files. It is known to detect dodgy, encoders, obfuscators, web shellcode.
PMF leverage YARA, so you need that as a pre-requisite to run the test.
RIPS
RIPS is one of the popular PHP static code analysis tools to be integrated through the development lifecycle to find security issues in real-time. You can categorize the finding by industry compliance and standard to prioritize the fixes.
- OWASP Top 10
- SANS Top 25
- PCI-DSS
- HIPPA
Let’s take a look at some of the following features.
- Pinpoint risk based on severity and option to define weights for critical, high, medium, and low.
- Collaborate the investigation and prioritize the issue
- Understand the vulnerability impact
- Evaluate security risk between old and new code
- Create a to-do list and assign tasks using the ticketing system
RIPS lets you export scan results report into multiple formats – PDF, CSV, and others by using RESTful API.
It is available as a self-hosted and SaaS model. So choose what works for you.
SonarPHP
SonarPHP by SonarSource uses pattern matching, data flow techniques to find vulnerabilities in PHP codes. It is a static code analyzer and integrates with Eclipse, IntelliJ.
SonarSource checks the code against more than 140 rules, and it also supports custom rules written in Java.
Exakat
A real-time static code analyzer engine to check compliance, risk, and reinforce best practices. Exakat got more than 450 analyzers dedicated to PHP. There are framework-specific analyzers like WordPress, CakePHP, Zend, etc.
If you have your PHP application code in GitHub, then you can use their public analyzer else you can choose to download or use the cloud-based online.
With the help of Exakat, you can integrate eternal security into your application and the following.
- Code review automated with more than 100 rules
- Compliance ready
- Automate your code documentation
- PHP 7 migration made easy
With the robust reporting, you can prioritize the remediation.
PHPStan
PHPStan is a fantastic tool to find bugs as you write the code. You don’t need to run anything.
You can try the online version here.
PHPStan requires 7.1 or higher version and composer to use it. However, it is capable of discovering bugs from an older version.
Psalm
Built on top of PHP Parser, Psalm is good to find errors and help to maintain consistency for a better and secure application.
Progpilot
Progpilot static analyzer lets you specify the analysis type like GET, POST, COOKIE, SHELL_EXEC, etc. It supports suiteCRM and CodeIgniter framework at the moment.
Grabber
Grabber, a python based tool to perform hybrid analysis on a PHP-based application using PHP-SAT.
Symfony
Security Monitoring by Symfony works with any PHP project using the composer. It is a PHP security advisory database for known vulnerabilities. You can either use PHP-CLI, Symfony-CLI, or web-based to check composer.lock for any known issues with the libraries you are using in the project.
Symfony also offers a security notification service. That means you can upload your composer.lock file, and whenever in future any used libraries found to be vulnerable, you will get notified.
I hope by using the above tools, you make your PHP applications more secure. All of the listed tools focus on analyzing source code, and if you need more, then check out an open-source security scanner.
Once your application is ready, then don’t forget to add a cloud-based WAF for continuous security from the edge network.