セキュリティレビュー
チェック項目
1. 認証・認可
- エンドポイントに適切な認証チェックがあるか
- AuthenticatedUser extractor が正しく使用されているか
- セッション管理が適切か
2. 入力検証
- ユーザー入力のバリデーションが実装されているか
- SQLインジェクション対策(パラメータバインディング使用)
- XSS対策(出力エスケープ)
3. 機密情報管理
- APIキー、シークレットがハードコードされていないか
- .env ファイルが.gitignore に含まれているか
- ログに機密情報が出力されていないか
4. CORS設定
5. エラーハンドリング
- スタックトレースがユーザーに露出していないか
- エラーメッセージが過度に詳細でないか
確認コマンド
機密情報の検索
grep -r "password\|secret\|api_key\|token" --include="*.rs" --include="*.ts" --include="*.tsx" | grep -v "test\|\.d\.ts"
ハードコードされた認証情報
grep -rn "Bearer \|Authorization:" --include="*.rs" --include="*.ts"
参考: OWASP API Security Top 10
- Broken Object Level Authorization
- Broken Authentication
- Broken Object Property Level Authorization
- Unrestricted Resource Consumption
- Broken Function Level Authorization
- Unrestricted Access to Sensitive Business Flows
- Server Side Request Forgery
- Security Misconfiguration
- Improper Inventory Management
- Unsafe Consumption of APIs