implementing-hardware-security-key-authentication
できること
このツールは、YubiKey などの物理的なセキュリティキーや、指紋認証などの端末の機能を使った安全なログインの仕組みを作るお手伝いをします。パスワードの代わりに、またはパスワードに加えて使うことで、ハッカーが不正にアクセスするのを難しくします。
使う場面
- ✓重要なアカウントを、追加のセキュリティ方法で守りたいとき。
- ✓より安全なログインが必要な Web サイトやアプリを作るとき。
- ✓セキュリティキーだけを使って、パスワードなしでログインできるようにしたいとき。
スキルのリンク
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-hardware-security-key-authentication/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“セキュリティキーを使って、私の Web サイトに安全なログインを設定してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
このツールは、サーバーがセキュリティキーと通信するように設定します。新しいキーの登録や、ログイン時の検証を管理し、キーの持ち主だけがアクセスできるようにします。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Implementing Hardware Security Key Authentication
When to Use
- Deploying phishing-resistant multi-factor authentication (MFA) using FIDO2 hardware security keys for high-value accounts (administrators, developers, privileged users)
- Building a WebAuthn relying party server that supports both roaming authenticators (USB/NFC security keys) and platform authenticators (Windows Hello, Touch ID, Android biometrics)
- Migrating an existing password-based authentication system to support passkeys (discoverable credentials) as a primary or secondary authentication factor
- Enrolling YubiKey devices for an organization's workforce, including PIN setup, credential registration, and backup key provisioning
- Implementing passwordless authentication flows that comply with NIST SP 800-63B AAL3 (authenticator assurance level 3) requirements
Do not use without HTTPS in production (WebAuthn requires a secure origin), for systems where users cannot physically access a USB/NFC port, or as the sole authentication factor without a recovery mechanism for lost keys.
Prerequisites
- Python 3.10+ with
fido2(python-fido2 >= 2.0.0),flask, andcryptographylibraries installed - HTTPS-enabled web server (WebAuthn API requires secure context; localhost is exempt for development)
- FIDO2-compatible hardware security key (YubiKey 5 Series, SoloKeys, Titan Security Key) or platform authenticator
- Modern web browser supporting the WebAuthn API (Chrome 67+, Firefox 60+, Safari 14+, Edge 79+)
- Understanding of public key cryptography, challenge-response protocols, and HTTP session management
Workflow
Step 1: Relying Party Server Configuration
Configure the WebAuthn relying party (RP) identity and server:
- Define RP identity: Create a
PublicKeyCredentialRpEntitywith the relying party name (display name shown to users) and RP ID (the effective domain of the application). The RP ID must be a registrable domain suffix of the origin -- for example,example.comis valid forhttps://auth.example.combutother.comis not. - Initialize Fido2Server: Instantiate the
Fido2Serverclass from the python-fido2 library with the RP entity. The server handles challenge generation, attestation verification, and assertion validation. - Configure attestation preference: Set the attestation conveyance preference to control whether the server requests proof of the authenticator's identity:
none: No attestation requested (simplest, recommended for most deployments)indirect: Attestation may be provided but CA may anonymize itdirect: Full attestation chain from the authenticator's manufacturerenterprise: Device-identifying attestation for managed environments
- Session management: Configure server-side sessions to store WebAuthn state between the begin and complete phases of registration/authentication ceremonies. Use secure, httponly cookies with SameSite=Strict.
- Credential storage: Design the database schema to store credential records:
credential_id(binary),public_key(COSE key),sign_count(uint32 for clone detection),user_id,created_at,last_used,display_name, andtransports(USB, NFC, BLE, internal).
Step 2: Registration Ceremony (Credential Creation)
Implement the WebAuthn registration flow to create new credentials:
- Begin registration: Call
server.register_begin()with the user entity (PublicKeyCredentialUserEntitycontaining user ID, username, and display name), the list of existing credentials for the user (to prevent duplicate registration), and options foruser_verificationandauthenticator_attachment. - Authenticator selection criteria:
authenticator_attachment: cross-platformrestricts to roaming authenticators (USB/NFC keys)authenticator_attachment: platformrestricts to built-in authenticators (Touch ID, Windows Hello)- Omitting this field allows both types
resident_key: requiredforces creation of a discoverable credential (passkey) stored on the authenticatoruser_verification: requiredenforces PIN or biometric verification on the authenticator
- Client-side ceremony: The browser calls
navigator.credentials.create()with the options from the server. The authenticator generates a new key pair, stores the private key in its secure element, and returns the public key, credential ID, attestation object, and client data JSON.
…
よくある質問
物理的なセキュリティキーが必要ですか?
必ずしも必要ではありません。YubiKey などの物理キーのほか、Windows Hello や Touch ID など、パソコンやスマートフォンの機能も使えます。
「フィッシング耐性」とはどういう意味ですか?
偽のメールや偽のサイトによってだまされにくいことを意味します。物理デバイスや生体認証を使うため、ハッカーはそれを持っていないので、突破するのが非常に困難になります。
どの Web サイトでも使えますか?
主に、自分で開発・管理している Web サイトやアプリに適しています。利用しているだけのサイトについては、そのサイトがこの機能を提供している場合に有効にできます。
詳細
作者による元の説明
Builds a FIDO2/WebAuthn relying party server with the python-fido2 library, covering registration and authentication ceremonies, YubiKey enrollment, resident key (discoverable credential/passkey) workflows, and user verification policies. Use when implementing phishing-resistant MFA with hardware security keys, building a WebAuthn relying party, enrolling YubiKeys for a workforce, or migrating pas
人気
- GitHubのスター
- 35k
- ランキング
- #8051
- ライセンス
- Apache-2.0
- 更新日
- 2026/8/31
コメント
- …
このリポジトリの他のスキル
abusing-dpapi-for-credential-access
35k特定のタスク向けに用意された指示をAIエージェントに与え、より良く、より速く作業できるようにします。
abusing-shadow-credentials-for-privesc
35kAIエージェントに、明確で構成のしっかりした文章の書き方を教えます。
achieving-cmmc-level-2-compliance
35kエージェントがCMMC Level 2への準拠に向けた環境を整えられるようにします。セキュリティ要件を実装し、必要なドキュメントを管理します。
acquiring-disk-image-with-dd-and-dcfldd
35kエージェントがハードディスクの完全なコピーを作成できるようにします。調査中に情報が失われたり改変されたりしないようにするのに役立ちます。
似ているスキル
reverse-engineer-anything
422kREAツールを使って、出荷済みのアプリやパッケージの中身を調べ、機能の説明、版の比較、再構築の手順をエージェントが支援します。
1password
394k1Password CLIをセットアップし、サインインして、秘密情報の値を会話に表示せずに読み取ったり注入したりするようエージェントを支援します。
healthcheck
394kOpenClawを動かすコンピューターやサーバーを、SSH、ファイアウォール、更新、バックアップなどのセキュリティリスクについて監査し、安全な修正案を提案するようエージェントを支援します。