signify-nz/composer-security-checker
Composer 安装命令:
composer require signify-nz/composer-security-checker
包简介
A security checker for your composer.lock
README 文档
README
Composer Security Checker
Inspired by sensiolabs/security-checker and fabpot/local-php-security-checker.
The Composer Security Checker provides an API for checking if your PHP application has dependencies with known security vulnerabilities. It uses the PHP Security Advisories Database - the same database used by fabpot/local-php-security-checker and the Symfony CLI.
It can be useful, for example, for applications that have a dashboard where you can display a clear warning if vulnerabilities are detected.
Install
Install via composer:
composer require signify-nz/composer-security-checker
Usage
Simply instantiate a SecurityChecker object and pass the absolute path to your composer.lock file in a call to check and it will return an array of vulnerabilities that apply to the dependencies of that lock file.
use Signify\SecurityChecker\SecurityChecker; $checker = new SecurityChecker(); $vulnerabilities = $checker->check('/path/to/composer.lock');
If you want to omit dev dependencies from the check, just pass false as the second argument.
use Signify\SecurityChecker\SecurityChecker; $checker = new SecurityChecker(); $vulnerabilities = $checker->check('/path/to/composer.lock', false);
If you have already parsed the composer.lock file into an associative array, you can pass that to the call to check instead:
use Signify\SecurityChecker\SecurityChecker; $checker = new SecurityChecker(); $composerLockArray = json_decode(file_get_contents('/path/to/composer.lock'), true); $vulnerabilities = $checker->check($composerLockArray);
Configuration Options
There are some configuration options you can pass into the constructor to determine how the checker behaves.
use Signify\SecurityChecker\SecurityChecker; $options = [ /* Set your configuration using below options */ ]; $checker = new SecurityChecker($options); $vulnerabilities = $checker->check('/path/to/composer.lock');
The options you can set are listed in this table.
| Option name | Purpose | Value type | Default |
|---|---|---|---|
| advisories-dir | A writable directory to store the PHP Security Advisories Database | string | A temporary directory (uses sys_get_temp_dir) |
| advisories-stale-after | Time in seconds that the stored advisories database is valid - it will be fetched again after this time expires. | int | 86400 (24 hours) |
| guzzle-options | Options to pass to the Guzzle client when fetching the advisories database. See the guzzle docs for options. | array | [] |
signify-nz/composer-security-checker 适用场景与选型建议
signify-nz/composer-security-checker 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 12 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「security」 「composer」 「checker」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 signify-nz/composer-security-checker 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 signify-nz/composer-security-checker 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 signify-nz/composer-security-checker 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A simple tool for checking that your PHP classes and methods use PHPDocs (PHP DocBlocks Checker fork).
This package provides null implementation for interactiv4/checker-contracts package.
Provide a way to secure accesses to all routes of an symfony application.
Auth checker for Laravel
PHP VAT checker based on the European Commission web service
It's a barebone security class written on PHP
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2021-12-22