sansec/composer-integrity-plugin
Composer 安装命令:
composer require sansec/composer-integrity-plugin
包简介
README 文档
README
Check your installed composer packages against a list of known correct checksums (provided by Sansec).
This plugin calculates a one-way hash of:
- composer.json and composer.lock
- package name and package versions
- file contents of the installed packages (checksum)
These hashes are then tested against a larger database hosted at Sansec. The use of one-way hashing provides a secure way to test your setup, without sharing file contents with a third party. The Sansec API does not store your hashes.
Installation & Usage
Composer Plugin
composer require sansec/composer-integrity-plugin
You can then run it:
composer integrity
PHAR
Head over to the releases page and download the latest PHAR.
You can then run it:
php composer-integrity.phar
Configuration
Both the plugin as well as the PHAR take the following optional options:
--skip-match: shows only non-matching checksums--json: output is in json format instead of a table
Why did we make this?
Sansec specializes in forensic investigations of breached Magento stores. We noticed an increase of cases where malware was hidden in legitimate libraries under vendor. Most package managers provide some sort of integrity check for installed software, but composer does not. So, we made this plugin in order to quickly verify the integrity of an installation.
Alternatively, you could clone the composer files, recreate vendor and run a diff against your installation. But this takes much more time and original dependencies are not always available on production servers.
Caveats
The plugin does not consider patches, such as those applied through composer-patches, via a post-install-cmd composer script, or editing in vendor outright.
In such instances, it is the user's responsibility to assess the situation and take appropriate action.
License
MIT License - Copyright (c) 2023 Sansec
sansec/composer-integrity-plugin 适用场景与选型建议
sansec/composer-integrity-plugin 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 27.12k 次下载、GitHub Stars 达 57, 最近一次更新时间为 2023 年 04 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 sansec/composer-integrity-plugin 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sansec/composer-integrity-plugin 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 27.12k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 57
- 点击次数: 22
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-04-18
