アプリケーションセキュリティ(AppSec)と OWASP Top 10

アプリケーションセキュリティとは?

アプリケーションセキュリティ(AppSec)は、アプリケーションを脅威からより安全にする ためのすべての施策を網羅します。セキュアな設計、secure coding practices による開発、セキュリティ テストから、デプロイメントと継続的な保守までを対象とします。

OWASP Top 10 (2021)

A01 - Broken Access Control

リスク:ユーザーが認可されていないリソースにアクセスする

例:IDOR、privilege escalation、forced browsing

緩和策:すべての層で access control を実装し、deny by default にする

A02 - Cryptographic Failures

リスク:不適切な暗号化による機密データの漏えい

例:plain text のパスワード、weak algorithms、TLS なしの HTTP

緩和策:TLS everywhere、パスワードには bcrypt/Argon2、データには AES-256

A03 - Injection

リスク:SQL、NoSQL、OS command injection、LDAP、XPath

例:' OR '1'='1、shell command injection

緩和策:Prepared statements、ORMs、input validation、WAF

A04 - Insecure Design

リスク:アーキテクチャおよび脅威モデリングの不備

例:rate limiting の欠如、threat modeling なし

緩和策:Secure by design、threat modeling、secure design patterns

A05 - Security Misconfiguration

リスク:安全でない設定またはデフォルト設定

例:default の認証情報、露出した stack traces、CORS misconfiguration

緩和策:Hardening guides、automated configuration scanning

A06 - Vulnerable and Outdated Components

リスク:既知の脆弱性を持つライブラリの使用

例:Log4Shell (CVE-2021-44228)、Struts2 RCE

緩和策:Dependabot、Snyk、OWASP Dependency-Check、SCA tools

A07 - Identification and Authentication Failures

リスク:認証およびセッションの不備

例:Credential stuffing、session fixation、weak passwords

緩和策:MFA、rate limiting、secure session management、breach detection

A08 - Software and Data Integrity Failures

リスク:整合性検証のない CI/CD、安全でないデシリアライゼーション

例:Unsigned updates、insecure deserialization(Java、.NET)

緩和策:Code signing、integrity checks、secure serialization libraries

A09 - Security Logging and Monitoring Failures

リスク:攻撃や侵害に対する可視性の欠如

例:不十分なログ、アラートなし、保護されていないログ

緩和策:Centralized logging、SIEM integration、real-time alerting

A10 - Server-Side Request Forgery (SSRF)

リスク:サーバーが内部リソースに対して悪意あるリクエストを行う

例:Cloud metadata API access、internal port scanning

緩和策:URL のホワイトリスト、network segmentation、disable unnecessary protocols

AppSec ツール

SAST (Static Application Security Testing)

  • SonarQube:Code quality と security vulnerabilities
  • Checkmarx:Enterprise SAST platform
  • Semgrep:Lightweight static analysis、customizable rules
  • Bandit (Python)、Brakeman (Ruby):Language-specific scanners

DAST (Dynamic Application Security Testing)

  • OWASP ZAP:Open-source web app scanner
  • Burp Suite:Manual + automated testing
  • Acunetix、Netsparker:Enterprise DAST solutions
  • runtime environment での Black-box testing

IAST & RASP

  • IAST:ハイブリッド分析のためのコードのインストルメンテーション
  • RASP:Runtime Application Self-Protection - 本番環境での検出
  • Contrast Security、Sqreen:IAST/RASP platforms

SCA (Software Composition Analysis)

  • Snyk、WhiteSource、Mend:Dependency vulnerability scanning
  • OWASP Dependency-Check:Open-source SCA
  • third-party libraries の脆弱性を検出

Secure Coding Practices

  • [OK] Input validation:blacklist よりも whitelist
  • [OK] Output encoding:context-aware (HTML, JS, URL, CSS)
  • [OK] Parametrized queries:常に prepared statements を使用する
  • [OK] Least privilege:アプリケーションは必要最小限の権限で実行する
  • [OK] Defense in depth:複数の防御層
  • [OK] Fail securely:エラーは機密情報を漏らしてはならない
  • [OK] Security by design:アーキテクチャの段階からセキュリティを考慮する
  • [OK] Keep it simple:複雑さはリスクを増大させる

Web Application Firewall (WAF)

  • ModSecurity:Open-source WAF engine
  • Cloudflare WAF:Cloud-based protection
  • AWS WAF、Azure WAF:Cloud-native options
  • Imperva、F5:Enterprise WAF appliances
  • OWASP Top 10 に対する防御、bot management、rate limiting
  • 重大な脆弱性に対する Virtual patching

SDLC への統合

Shift-Left Security:セキュリティをサイクルのできるだけ早い段階で統合する

  • Design Phase:Threat modeling、secure architecture review
  • Development:IDE plugins (Snyk Code, SonarLint)、secure coding training
  • CI/CD:SAST、SCA、container scanning、pre-commit hooks
  • Testing:DAST、penetration testing、security regression tests
  • Deployment:IAST、infrastructure scanning、compliance checks
  • Production:RASP、WAF、monitoring、incident response