security-hardening
セキュリティ強化や安全なコーディングに関するご要望に応じ、OWASP脆弱性対策や脅威軽減策を提案するSkill。
📜 元の英語説明(参考)
Security hardening and secure coding practices. Use when user asks to "harden security", "secure coding", "OWASP vulnerabilities", "input validation", "sanitization", "SQL injection prevention", "XSS protection", "CORS security", "secure headers", "vulnerability scanning", or mentions security best practices and threat mitigation.
🇯🇵 日本人クリエイター向け解説
セキュリティ強化や安全なコーディングに関するご要望に応じ、OWASP脆弱性対策や脅威軽減策を提案するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o security-hardening.zip https://jpskill.com/download/6124.zip && unzip -o security-hardening.zip && rm security-hardening.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/6124.zip -OutFile "$d\security-hardening.zip"; Expand-Archive "$d\security-hardening.zip" -DestinationPath $d -Force; ri "$d\security-hardening.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
security-hardening.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
security-hardeningフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-17
- 取得日時
- 2026-05-17
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
セキュリティ強化とセキュアコーディング
一般的な脆弱性を防ぐための包括的なセキュリティ強化とセキュアコーディングの実践です。
OWASP Top 10 (2021)
1. アクセス制御の不備
- 適切な認可を実装する
- ロールベースアクセス制御 (RBAC) を使用する
- すべてのリクエストで権限を確認する
2. 暗号化の失敗
- 強力な暗号化 (AES-256) を使用する
- 転送中の機密データ (TLS) を保護する
- シークレットをハードコードしない
3. インジェクション
- SQL にはパラメーター化されたクエリを使用する
- すべての入力を検証し、サニタイズする
- ORM フレームワークを使用する
4. 安全でない設計
- 設計段階での脅威モデリング
- デフォルトで安全な原則
- 定期的なセキュリティレビュー
5. セキュリティ設定の不備
- 依存関係を最新の状態に保つ
- デフォルトの認証情報を削除する
- 不要な機能を無効にする
6. 脆弱なコンポーネント
- 定期的な依存関係の監査
- 脆弱性スキャンツールを使用する
- フレームワークとライブラリを最新の状態に保つ
7. 認証とセッションの失敗
- 強力なパスワードポリシー
- 多要素認証
- 安全なセッション管理
8. ソフトウェアとデータの整合性の失敗
- パッケージの整合性を検証する
- 署名付きコミットを使用する
- 安全な CI/CD を実装する
9. ロギングと監視の失敗
- セキュリティイベントをログに記録する
- 不審なアクティビティを監視する
- 定期的なセキュリティ監査
10. SSRF
- URL とリダイレクトを検証する
- 送信リクエストを制限する
- ネットワークレベルの制御
セキュアコーディングの実践
入力検証
// Bad
const id = req.query.id;
const user = db.query(`SELECT * FROM users WHERE id = ${id}`);
// Good
const id = parseInt(req.query.id, 10);
if (!Number.isInteger(id) || id < 1) {
throw new Error('Invalid ID');
}
const user = db.query('SELECT * FROM users WHERE id = ?', [id]);
出力エンコーディング
// Bad
const html = `<div>${userName}</div>`;
// Good (escapes HTML)
const escapeHtml = (str) => str
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
const html = `<div>${escapeHtml(userName)}</div>`;
セキュリティヘッダー
Content-Security-Policy: default-src 'self'
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Strict-Transport-Security: max-age=31536000
セキュリティチェックリスト
- [ ] すべての入力が検証され、サニタイズされている
- [ ] パラメーター化されたクエリが使用されている (SQL インジェクションなし)
- [ ] 機密データが暗号化されている (TLS、保存時)
- [ ] 強力な認証 (MFA、強力なパスワード)
- [ ] CORS が適切に設定されている
- [ ] CSRF トークンが使用されている
- [ ] セキュリティヘッダーが設定されている
- [ ] 依存関係が定期的に監査されている
- [ ] エラーメッセージが情報を漏洩しない
- [ ] ロギングがセキュリティイベントを捕捉している
- [ ] シークレットがコード/ログに含まれていない
- [ ] 定期的なセキュリティテスト
ツールとユーティリティ
npm audit/pip check- 依存関係スキャン- OWASP ZAP / Burp Suite - 侵入テスト
- Snyk - 脆弱性スキャン
- SonarQube - コード品質とセキュリティ
- TruffleHog - シークレットスキャン
参考文献
- OWASP Top 10
- OWASP Cheat Sheets
- CWE/SANS Top 25
- NIST Cybersecurity Framework
- Google Styleguide Code Review Security
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Security Hardening & Secure Coding
Comprehensive security hardening and secure coding practices to prevent common vulnerabilities.
OWASP Top 10 (2021)
1. Broken Access Control
- Implement proper authorization
- Use role-based access control (RBAC)
- Verify permissions on every request
2. Cryptographic Failures
- Use strong encryption (AES-256)
- Protect sensitive data in transit (TLS)
- Never hardcode secrets
3. Injection
- Use parameterized queries for SQL
- Validate and sanitize all inputs
- Use ORM frameworks
4. Insecure Design
- Threat modeling during design
- Secure by default principles
- Regular security reviews
5. Security Misconfiguration
- Keep dependencies updated
- Remove default credentials
- Disable unnecessary features
6. Vulnerable Components
- Regular dependency audits
- Use vulnerability scanning tools
- Keep frameworks and libraries updated
7. Authentication & Session Failures
- Strong password policies
- Multi-factor authentication
- Secure session management
8. Software & Data Integrity Failures
- Verify package integrity
- Use signed commits
- Implement secure CI/CD
9. Logging & Monitoring Failures
- Log security events
- Monitor for suspicious activity
- Regular security audits
10. SSRF
- Validate URLs and redirects
- Restrict outbound requests
- Network-level controls
Secure Coding Practices
Input Validation
// Bad
const id = req.query.id;
const user = db.query(`SELECT * FROM users WHERE id = ${id}`);
// Good
const id = parseInt(req.query.id, 10);
if (!Number.isInteger(id) || id < 1) {
throw new Error('Invalid ID');
}
const user = db.query('SELECT * FROM users WHERE id = ?', [id]);
Output Encoding
// Bad
const html = `<div>${userName}</div>`;
// Good (escapes HTML)
const escapeHtml = (str) => str
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
const html = `<div>${escapeHtml(userName)}</div>`;
Secure Headers
Content-Security-Policy: default-src 'self'
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Strict-Transport-Security: max-age=31536000
Security Checklist
- [ ] All inputs validated and sanitized
- [ ] Parameterized queries used (no SQL injection)
- [ ] Sensitive data encrypted (TLS, at-rest)
- [ ] Strong authentication (MFA, strong passwords)
- [ ] CORS properly configured
- [ ] CSRF tokens used
- [ ] Security headers set
- [ ] Dependencies audited regularly
- [ ] Error messages don't leak info
- [ ] Logging captures security events
- [ ] Secrets not in code/logs
- [ ] Regular security testing
Tools & Utilities
npm audit/pip check- Dependency scanning- OWASP ZAP / Burp Suite - Penetration testing
- Snyk - Vulnerability scanning
- SonarQube - Code quality and security
- TruffleHog - Secret scanning
References
- OWASP Top 10
- OWASP Cheat Sheets
- CWE/SANS Top 25
- NIST Cybersecurity Framework
- Google Styleguide Code Review Security