security について
セキュリティや開発チーム向けの情報セキュリティリファレンスで、サイバーセキュリティ、インシデント対応、セキュリティアーキテクチャを扱います。脆弱性管理、アクセス制御、OWASP のリスク、アプリケーションおよびサプライチェーンの安全対策をまとめています。
主な機能
- 01セキュリティアーキテクチャとクラウド制御
- 02脆弱性評価とパッチ管理
- 03ID・特権アクセス管理
- 04OWASP Top 10 の例
- 05SAST、DAST、サプライチェーン対策
活用シーン
- 01組織のセキュリティアーキテクチャ策定
- 02脆弱性修正プロセスの構築
- 03アプリケーションコードの一般的なリスク確認
- 04セキュリティ研修と指標の計画
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ travisjneuman/ .claude --skill securityインストール後、Claude Code で/securityを入力して読み込まれたか確認します。
同梱ファイル
SKILL.md と一緒にインストールされる参考資料やスクリプト。
references/fortune50-information-security.mdincident-response.mdsecurity-frameworks.md詳細
情報セキュリティ専門家
サイバーセキュリティ、インシデント対応、セキュリティアーキテクチャのための包括的なセキュリティフレームワークです。
セキュリティアーキテクチャ
ゼロトラストアーキテクチャ
ZERO TRUST PRINCIPLES:
- Never trust, always verify
- Assume breach
- Verify explicitly
- Least privilege access
- Micro-segmentation
ZERO TRUST COMPONENTS:
IDENTITY:
- Strong authentication (MFA)
- Identity governance
- Privileged access management
- Continuous validation
DEVICES:
- Device health verification
- Endpoint detection and response
- Mobile device management
- Asset inventory
NETWORK:
- Micro-segmentation
- Software-defined perimeter
- Encrypted communications
- Network access control
APPLICATIONS:
- Application-level authentication
- API security
- Web application firewall
- Secure coding practices
DATA:
- Data classification
- Encryption at rest and in transit
- Data loss prevention
- Access controls
多層防御
SECURITY LAYERS:
PHYSICAL:
- Data center security
- Badge access
- Surveillance
- Environmental controls
PERIMETER:
- Firewalls
- IDS/IPS
- DMZ
- VPN
NETWORK:
- Segmentation
- Encryption
- Network monitoring
- NAC
HOST:
- Endpoint protection
- Host-based firewall
- Hardening
- Patch management
APPLICATION:
- WAF
- Secure coding
- Input validation
- Authentication
DATA:
- Encryption
- DLP
- Access controls
- Backup/recovery
クラウドセキュリティ
| ドメイン | 対策 |
|---|---|
| ID | SSO、MFA、PAM、IAM ポリシー |
| コンピュート | 強化済みイメージ、コンテナーセキュリティ |
| ネットワーク | VPC、セキュリティグループ、WAF |
| ストレージ | 暗号化、アクセス ポリシー、バックアップ |
| ロギング | CloudTrail、SIEM 連携 |
| コンプライアンス | Config ルール、自動修復 |
詳細なセキュリティフレームワーク(NIST、ISO 27001、CIS Controls、MITRE ATT&CK)については、セキュリティフレームワークリファレンスを参照してください。
脆弱性管理
脆弱性管理プロセス
LIFECYCLE:
1. DISCOVERY
- Asset inventory
- Vulnerability scanning
- Penetration testing
- Code analysis
2. PRIORITIZATION
- CVSS scoring
- Asset criticality
- Exploit availability
- Business context
3. REMEDIATION
- Patch management
- Configuration changes
- Compensating controls
- Risk acceptance
4. VERIFICATION
- Rescan
- Validation testing
- Documentation
- Reporting
5. REPORTING
- Executive dashboards
- Trend analysis
- Compliance reporting
- SLA tracking
CVSS スコアリング
| スコア | 深刻度 | SLA 目標 |
|---|---|---|
| 9.0-10.0 | 緊急 | 7 日 |
| 7.0-8.9 | 高 | 30 日 |
| 4.0-6.9 | 中 | 90 日 |
| 0.1-3.9 | 低 | 可能な限り対応 |
パッチ管理
PATCH PROCESS:
1. IDENTIFICATION
- Vendor announcements
- Vulnerability feeds
- Security bulletins
2. ASSESSMENT
- Applicability
- Risk evaluation
- Test requirements
3. TESTING
- Lab validation
- Compatibility testing
- Rollback planning
4. DEPLOYMENT
- Pilot group
- Phased rollout
- Monitoring
5. VERIFICATION
- Confirm installation
- Functional testing
- Documentation
ID・アクセス管理
IAM フレームワーク
IAM COMPONENTS:
IDENTITY LIFECYCLE:
- Provisioning
- Modification
- De-provisioning
- Certification
AUTHENTICATION:
- Password policies
- Multi-factor authentication
- Single sign-on
- Passwordless
AUTHORIZATION:
- Role-based access (RBAC)
- Attribute-based access (ABAC)
- Least privilege
- Separation of duties
GOVERNANCE:
- Access reviews
- Policy enforcement
- Audit logging
- Compliance reporting
特権アクセス管理
PAM CONTROLS:
VAULT:
- Credential storage
- Password rotation
- Secrets management
SESSION:
- Session recording
- Just-in-time access
- Time-limited credentials
MONITORING:
- Activity logging
- Behavioral analytics
- Alert on anomalies
GOVERNANCE:
- Access certification
- Policy enforcement
- Compliance reporting
セキュリティ意識向上
セキュリティトレーニングプログラム
| トピック | 頻度 | 対象 |
|---|---|---|
| 新入社員向けセキュリティ | オンボーディング | 全従業員 |
| 年次更新 | 毎年 | 全従業員 |
| フィッシング対策意識 | 四半期ごと | 全従業員 |
| 開発者向けセキュリティ | 毎年 | 開発チーム |
| 経営幹部向け説明会 | 四半期ごと | リーダーシップ |
| 役割別 | 必要に応じて | 特定の役割 |
フィッシングシミュレーション
SIMULATION PROGRAM:
FREQUENCY: Monthly
DIFFICULTY LEVELS:
- Easy: Generic, obvious errors
- Medium: Branded, some personalization
- Hard: Targeted, well-crafted
METRICS:
- Click rate
- Report rate
- Training completion
- Trend over time
RESPONSE:
- Click → Immediate training
- Report → Positive reinforcement
- Repeat offenders → Additional training
セキュリティ指標
主なセキュリティ指標
| カテゴリ | 指標 | 目標 |
|---|---|---|
| 脆弱性 | 30 日を超えて未解決の重大な脆弱性 | 0 |
| パッチ適用 | SLA 以内にパッチ適用されたシステム | 95%+ |
| インシデント | 平均検知時間 | <24 時間 |
| アクセス | 孤立アカウント | 0 |
| トレーニング | 修了率 | 95%+ |
| フィッシング | クリック率 | <5% |
セキュリティダッシュボード
EXECUTIVE DASHBOARD:
RISK POSTURE:
- Overall risk score
- Risk trend
- Top risks
COMPLIANCE:
- Framework coverage
- Audit findings
- Remediation status
OPERATIONS:
- Incident summary
- Vulnerability status
- Patching compliance
INVESTMENT:
- Budget utilization
- Tool effectiveness
- Headcount
脅威インテリジェンス
脅威インテリジェンスの情報源
| 種類 | 情報源 | 用途 |
|---|---|---|
| 戦略 | 業界レポート、地政学的情報 | 経営幹部向け説明会 |
| 戦術 | TTP、マルウェア分析 | 検知ルール |
| 運用 | IOC、キャンペーン | アクティブな対応 |
| 技術 | シグネチャ、ハッシュ | 自動ブロック |
詳細なインシデント対応プロセスと SOC 運用については、インシデント対応リファレンスを参照してください。
参考資料
- セキュリティフレームワークリファレンス - NIST、ISO 27001、CIS Controls、MITRE ATT&CK
- インシデント対応リファレンス - IR プロセス、重大度レベル、SOC 運用
OWASP Top 10(コード例付き)
1. アクセス制御の不備
# WRONG - No authorization check
@app.get("/api/users/{user_id}/data")
async def get_user_data(user_id: str):
return db.get_user_data(user_id) # Any user can access any data
# RIGHT - Verify ownership
@app.get("/api/users/{user_id}/data")
async def get_user_data(user_id: str, current_user: User = Depends(get_current_user)):
if current_user.id != user_id and not current_user.is_admin:
raise HTTPException(status_code=403, detail="Forbidden")
return db.get_user_data(user_id)
2. 暗号化の失敗
# WRONG - Weak hashing
import hashlib
password_hash = hashlib.md5(password.encode()).hexdigest()
# RIGHT - Use bcrypt or argon2
from passlib.context import CryptContext
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
password_hash = pwd_context.hash(password)
verified = pwd_context.verify(password, password_hash)
3. インジェクション
# WRONG - SQL injection via string formatting
query = f"SELECT * FROM users WHERE email = '{email}'"
cursor.execute(query)
# RIGHT - Parameterized queries
cursor.execute("SELECT * FROM users WHERE email = %s", (email,))
# WRONG - Command injection via unsanitized input
# Never pass user input to shell commands directly
# Always use subprocess with list arguments:
# RIGHT - Safe subprocess usage
import subprocess
subprocess.run(["convert", user_filename, "output.png"], check=True)
4. 安全でない設計
# WRONG - No rate limiting on password reset
@app.post("/api/reset-password")
async def reset_password(email: str):
send_reset_email(email)
# RIGHT - Rate limit + CAPTCHA
@app.post("/api/reset-password")
@limiter.limit("3/hour")
async def reset_password(email: str, captcha: str):
if not verify_captcha(captcha):
raise HTTPException(400, "Invalid CAPTCHA")
send_reset_email(email)
5. セキュリティ設定の不備
# WRONG - Debug mode in production, exposing stack traces
# RIGHT - Environment-aware configuration
app = FastAPI(debug=os.getenv("ENV") == "development")
@app.exception_handler(Exception)
async def handle_error(request, exc):
logger.error(f"Unhandled error: {exc}", exc_info=True)
return JSONResponse(status_code=500, content={"error": "Internal server error"})
6. 脆弱なコンポーネント
# Audit dependencies regularly
npm audit
pip audit
cargo audit
# Pin versions, use lockfiles (package-lock.json, Pipfile.lock, Cargo.lock)
7. 認証の失敗
// WRONG - JWT with no expiration, weak secret
const token = jwt.sign(payload, "secret123");
// RIGHT - Short expiry, strong secret, refresh tokens
const token = jwt.sign(payload, process.env.JWT_SECRET, {
expiresIn: "15m",
algorithm: "RS256",
issuer: "my-app",
});
8. ソフトウェアとデータの整合性の失敗
# Pin action versions in GitHub Actions (not @main)
- uses: actions/[email protected]
9. セキュリティログとモニタリングの失敗
# Log security-relevant events with structured data
logger.info("auth.login.success", extra={"user_id": user.id, "ip": request.client.host})
logger.warning("auth.login.failed", extra={"email": email, "ip": request.client.host})
logger.critical("auth.bruteforce.detected", extra={"ip": request.client.host, "attempts": count})
10. サーバーサイドリクエストフォージェリ(SSRF)
# WRONG - User controls URL without validation
# RIGHT - Allowlist domains, block internal IPs
from urllib.parse import urlparse
import ipaddress
ALLOWED_HOSTS = {"api.example.com", "cdn.example.com"}
def safe_fetch(url: str) -> Response:
parsed = urlparse(url)
if parsed.hostname not in ALLOWED_HOSTS:
raise ValueError("Host not allowed")
ip = ipaddress.ip_address(socket.gethostbyname(parsed.hostname))
if ip.is_private:
raise ValueError("Internal addresses not allowed")
return requests.get(url, timeout=10)
静的アプリケーションセキュリティテスト(SAST)
| ツール | 言語 | 統合 |
|---|---|---|
| Semgrep | 30 以上の言語 | CI/CD、IDE、CLI |
| CodeQL | C/C++、Java、JS、Python、Go | GitHub Actions |
| SonarQube | 30 以上の言語 | セルフホスト、CI/CD |
| Bandit | Python のみ | CLI、CI/CD |
# Semgrep (recommended - fast, customizable)
semgrep scan --config auto .
semgrep scan --config p/owasp-top-ten .
semgrep scan --config p/secrets .
動的アプリケーションセキュリティテスト(DAST)
# OWASP ZAP baseline scan (passive, fast)
docker run -t ghcr.io/zaproxy/zaproxy:stable zap-baseline.py \
-t https://your-app.com
# Full scan (active, thorough)
docker run -t ghcr.io/zaproxy/zaproxy:stable zap-full-scan.py \
-t https://your-app.com
# API scan
docker run -t ghcr.io/zaproxy/zaproxy:stable zap-api-scan.py \
-t https://your-app.com/openapi.json -f openapi
サプライチェーンセキュリティ
Sigstore(コード署名)
# Sign container images with cosign
cosign sign --key cosign.key docker.io/myapp:latest
# Verify signatures
cosign verify --key cosign.pub docker.io/myapp:latest
SLSA(ソフトウェア成果物のサプライチェーンレベル)
| レベル | 要件 |
|---|---|
| SLSA 1 | ビルドプロセスが文書化されている |
| SLSA 2 | ホスト型ビルドサービス、署名付き来歴情報 |
| SLSA 3 | 強化されたビルドプラットフォーム、改ざん不可能な来歴情報 |
依存関係の管理
# Lock dependencies and audit regularly
npm ci # Install from lockfile only
npm audit --audit-level=high
pip-audit
cargo audit
# Use Dependabot or Renovate for automated updates
関連項目
コメント
Markdown 対応