本文へスキップ
Skillpedia
セキュリティ35k · #8302

performing-security-headers-audit

できること

このツールは、Webサイトがブラウザレベルの重要なセキュリティ保護を使っているかを確認します。サイトが返す「ヘッダー」を分析し、機密情報が漏れていないか、そしてサイトが一般的な攻撃から守られているかを確認します。

使う場面

  • ✓テストする許可を得ているWebサイトのセキュリティを確認するとき。
  • ✓ユーザーのブラウザがデータの盗難や攻撃から守られているかを確かめたいとき。
  • ✓Webサイトが特定のセキュリティ要件を満たしているかを確認したいとき。

スキルのリンク

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-security-headers-audit/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-security-headers-audit/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“example.comのセキュリティヘッダーを監査してください”

毎週5つの新しいスキル。1分で読めます。

仕組み

このツールは、Webサイトからのレスポンスを取得し、返されたセキュリティヘッダーを調べます。「Content Security Policy」や「HTTP Strict Transport Security」などの設定が有効で、ユーザーを守るように正しく構成されているかを確認します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Performing Security Headers Audit

When to Use

  • During authorized web application security assessments as a standard configuration review
  • When evaluating browser-level protections against XSS, clickjacking, and data leakage
  • For compliance assessments requiring security header implementation (PCI DSS, SOC 2)
  • When performing initial reconnaissance to identify easy-win security improvements
  • During CI/CD pipeline security gate checks for new deployments

Prerequisites

  • Authorization: Written scope for the target application (header review is low-risk)
  • curl: For fetching response headers from target endpoints
  • SecurityHeaders.com: Online scanner for quick header assessment
  • Mozilla Observatory: Mozilla's web security testing tool
  • Burp Suite: For comprehensive header analysis across multiple pages
  • Browser DevTools: For examining headers and CSP violations in real-time

Workflow

Step 1: Collect Security Headers from Target

Retrieve and catalog all security-related response headers.

# Fetch all response headers
curl -s -I "https://target.example.com/" | grep -iE \
  "(strict-transport|content-security|x-frame|x-content-type|x-xss|referrer-policy|permissions-policy|feature-policy|x-permitted|cross-origin|set-cookie|server|x-powered-by|cache-control)"

# Check headers across multiple pages
PAGES=("/" "/login" "/api/health" "/admin" "/account/settings" "/static/app.js")

for page in "${PAGES[@]}"; do
  echo "=== $page ==="
  curl -s -I "https://target.example.com$page" 2>/dev/null | grep -iE \
    "(strict-transport|content-security|x-frame|x-content-type|x-xss|referrer-policy|permissions-policy|set-cookie|server|x-powered)"
  echo
done

# Check both HTTP and HTTPS responses
echo "=== HTTP Response ==="
curl -s -I "http://target.example.com/" | head -20
echo "=== HTTPS Response ==="
curl -s -I "https://target.example.com/" | head -20

Step 2: Assess Transport Security (HSTS)

Evaluate HTTP Strict Transport Security configuration.

# Check HSTS header
curl -s -I "https://target.example.com/" | grep -i "strict-transport-security"

# Expected: Strict-Transport-Security: max-age=31536000; includeSubDomains; preload

# Verify HSTS attributes:
# max-age: Should be >= 31536000 (1 year) for preload eligibility
# includeSubDomains: Protects all subdomains
# preload: Eligible for browser HSTS preload list

# Check if HTTP redirects to HTTPS
curl -s -I "http://target.example.com/" | head -5
# Should be 301/302 redirect to https://

# Check if HSTS is on the preload list
# Visit: https://hstspreload.org/?domain=target.example.com

# Test for HTTPS-only cookies
curl -s -I "https://target.example.com/login" | grep -i "set-cookie"
# All session cookies should have Secure flag

# Check for mixed content
curl -s "https://target.example.com/" | grep -oP "http://[^\"']+" | head -20
# HTTP resources loaded on HTTPS pages create mixed content vulnerabilities

Step 3: Audit Content Security Policy (CSP)

Analyze CSP headers for effectiveness and potential bypasses.

# Extract CSP header
CSP=$(curl -s -I "https://target.example.com/" | grep -i "content-security-policy" | cut -d: -f2-)
echo "$CSP"

# Check for dangerous directives:
# 'unsafe-inline' in script-src: Allows inline scripts (XSS risk)
# 'unsafe-eval' in script-src: Allows eval() (XSS risk)
# * in any directive: Allows loading from any origin
# data: in script-src: Allows data: URI scripts
# Missing default-src: No fallback policy

echo "$CSP" | tr ';' '\n' | while read directive; do
  echo "  $directive"
  if echo "$directive" | grep -q "unsafe-inline"; then
    echo "    WARNING: unsafe-inline allows inline script execution"
  fi
  if echo "$directive" | grep -q "unsafe-eval"; then
    echo "    WARNING: unsafe-eval allows eval() calls"
  fi
  if echo "$directive" | grep -q " \* "; then
    echo "    WARNING: wildcard allows loading from any origin"
  fi
done

# Check for CSP report-only (not enforcing)
curl -s -I "https://target.example.com/" | grep -i "content-security-policy-report-only"
# Report-only does NOT block violations, only logs them

# Test CSP with Google's evaluator
# https://csp-evaluator.withgoogle.com/
# Paste the CSP header for automated analysis

# Check for CSP bypass via whitelisted domains
# If CDN domains are whitelisted, check for JSONP endpoints or angular libraries

Step 4: Check Frame Protection and Click Defense Headers

…

よくある質問

「セキュリティヘッダー」とは何ですか?

Webサイトがブラウザに送る追加の情報で、コンテンツを安全に扱う方法を指示するものです。信頼できない提供元からのスクリプトの読み込みを防いだり、接続が常にHTTPSで行われるようにしたりします。

このツールを使うには許可が必要ですか?

はい、Webサイトのセキュリティを監査するには明示的な許可が必要です。許可なくテストすると違法になる場合があります。

このツールではどのような問題を見つけられますか?

クロスサイトスクリプティング(XSS)、クリックジャッキング、データ漏えい、接続の暗号化不足など、攻撃に対して脆弱になる設定ミスを特定できます。

詳細

作者による元の説明

Auditing HTTP security headers including CSP, HSTS, X-Frame-Options, and cookie attributes to identify missing or misconfigured browser-level protections.

repo: mukul975/Anthropic-Cybersecurity-Skills

人気

GitHubのスター
35k
ランキング
#8302
ライセンス
Apache-2.0
更新日
2026/8/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル