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

hsts

できること

このスキルは、サイトがブラウザに対して、常に安全な HTTPS の接続を使うよう伝えているかを確認します。訪問者の保護を強めたいサイト運営者や開発者向けです。

使う場面

  • ✓サイトは HTTPS で提供されているが、ブラウザがまだ平文の HTTP を先に試すとき。
  • ✓ログインや個人情報を扱うサイトを運営しているとき。
  • ✓新しいサーバー、CDN、ホスティングの設定をしているとき。

スキルのリンク

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/hsts/SKILL.md

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

使い方

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

貼り付け用メッセージ

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

AIへの頼み方の例

“私のウェブサイトの安全な応答に、HSTS ヘッダーを追加してもらえますか。”

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

仕組み

エージェントは、HTTPS の応答に Strict-Transport-Security ヘッダーがあるかを確認し、その設定を見直します。有効期間を1年、サブドメインを含める設定を提案し、プリロードの前にはテストすることを勧めます。

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

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

Set an HSTS header

Without HSTS, an attacker on the same network can intercept the first HTTP request and strip TLS (SSL stripping), silently downgrading the connection before the browser ever sees a redirect.

Quick Reference

  • Set Strict-Transport-Security: max-age=31536000; includeSubDomains on all HTTPS responses
  • Use max-age=31536000 (1 year) minimum; HSTS preloading requires at least 1 year
  • Add includeSubDomains to protect all subdomains from downgrade attacks
  • Add preload only after testing — it is difficult to reverse and takes weeks to propagate
  • Never send the HSTS header over plain HTTP — only over HTTPS

Check

Check whether the server sends a Strict-Transport-Security header on all HTTPS responses, and verify the max-age, includeSubDomains, and preload directives are appropriate.

Fix

Add a Strict-Transport-Security header with max-age=31536000 and includeSubDomains to all HTTPS responses. Configure your web server or CDN to send this header, and validate it with curl or securityheaders.com.

Explain

Explain what HTTP Strict Transport Security (HSTS) is, how it prevents SSL stripping attacks, what the max-age and includeSubDomains directives do, and why the preload directive requires caution.

Code Review

Review server config, headers, forms, and integration points related to Set an HSTS header. Flag exact responses, cookies, or browser behaviors that violate the rule, and verify them against the effective production-like response.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/security/hsts

よくある質問

HSTS は何をしますか?

ブラウザに、サイトへ自動的に HTTPS を使うよう伝え、最初の平文のリクエストでのダウングレード攻撃を防ぎます。

includeSubDomains は何をしますか?

サイトのすべてのサブドメインに、同じ保護を適用します。

プリロードにはなぜ注意が必要ですか?

プリロードは元に戻しにくく、効果が出るまで数週間かかるため、先にテストすべきだとこのスキルは説明しています。

詳細

作者による元の説明

Use when reviewing HTTP response headers on any site that serves content over HTTPS.

repo: thedaviddias/Front-End-Checklist

人気

GitHubのスター
75k
ランキング
#2870
ライセンス
MIT
更新日
2026/10/31

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

0

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

コメント

  • …

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

似ているスキル