← PHP / Laravel · 目次

PHP-100 / 初級

開発用依存関係・テストファイルの本番デプロイへの混入

A05:2021 Security Misconfiguration · CWE-489 Active Debug Code · A06:2021 (範囲の縮小)

なぜ問題になるのか?

tests/、.git/、phpunit.xml が Web から開けたり、攻撃対象領域を広げたりします。

修正方法

bash
composer install --no-dev --optimize-autoloader
rsync -a --exclude '.git' --exclude 'tests' ./ /var/www/app/
# Web サーバーで .git、tests を遮断し、public のみドキュメントルート

参考資料