security advisories checker on travis/circle ci

Post on 09-Jan-2017

3.227 Views

Category:

Internet

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Security Advisories Checker on (Travis|Circle) CIPHP BLT#2 @serima

@serima

• PHP Developer @ Zappallas • mag2 -> GREE -> Zappallas

• http://serima.co/blog • Recent topics

• WordPress on PHP 7, HTTP/2 • Setup Sakura-VPS with Ansible

• 最近の興味 • 二酸化炭素濃度の計測(まだやってない!)

SensioLabs Security Advisories Checker

• SensioLabs 社製のライブラリ脆弱性チェッカー

SensioLabs

• Symfony / Twig / Silex などを開発しているフランスの

会社 • 最近だと、プロファイラツール blackfire.io をリリース

した

composer.lock で判定

• Online Checker • ウェブ上で composer.lock をアップロード

• CLI Checker • CLI Tool をダウンロードしてコマンドライン実行

• Web API • SensioLabs 上にエンドポイントが用意されている

継続的脆弱性チェック

• 各種インタフェースが提供されているので、CI に組み

込み、継続的脆弱性チェックが簡単に可能

How to integrate

• composer require sensiolabs/security-checker • composer update • git add composer.json composer.lock • git commit -m ‘Integrate security-checker’

TravisCI - .travis.yml

language: php php: - 5.6

before_script: - composer self-update - composer install - chmod -R 777 storage

script: - vendor/bin/security-checker security:check - phpunit

CircleCI - circle.yml

machine: timezone: Asia/Tokyo php: version: 5.6.14

test: override: - vendor/bin/security-checker security:check - vendor/bin/phpunit

Test

• swiftmailer/swiftmailer は 5.2.1 未満のバージョンに脆

弱性がある • ためしに 5.0.0 を

インストールするよう

指定してみる

Test

• ちゃんと fail しました

• 脆弱性の内容も表示されています

Test

• 最新版を入れるように設定して再度チャレンジ • ちゃんと green になりました

脆弱性データベース

• このリポジトリに登録されているものが脆弱性データベースとして使われている • https://github.com/FriendsOfPHP/security-

advisories • This database must not serve as the primary

source of information for security issues, it is not authoritative for any referenced software, but it allows to centralize information for convenience and easy consumption.

まとめ

• ほぼコストゼロでライブラリの脆弱性チェックが可能になるので、入れておいて損はないです

• が、先程も言ったとおり完全に信頼してしまわないように注意🃏

• JVN など他のデータベースは別途チェックしましょう

• https://github.com/serima/security-checker-on-lumen • サンプルを置いておきました

おわり🍔

top related