validating-tpm-measured-boot-attestation
できること
このツールは、TPMと呼ばれる特別なチップを使って、コンピュータが安全に起動したかを確認します。コンピュータが起動する前の段階で、オペレーティングシステムや重要なプログラムがハッカーによって改ざんされていないことを確かめます。
使う場面
- ✓新しいコンピュータを安全なネットワークに接続するとき。
- ✓起動中に改ざんされたかどうかを確認したいとき。
- ✓パスワードなどの重要な秘密情報を、システムが正しく起動した場合にのみアクセスできるように保護したいとき。
スキルのリンク
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/validating-tpm-measured-boot-attestation/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私のコンピュータが安全に起動し、オペレーティングシステムが改変されていないことを確認してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
TPMは、コンピュータの起動プロセスの各段階を記録します。このツールは、その記録を本来起こるはずだった内容と比較し、不審な変更がないかを検出します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Validating TPM Measured Boot and Attestation
Legal Notice: Perform TPM operations only on systems you own or are authorized to assess. Some operations (clearing the TPM, taking ownership, defining NV indices) are destructive or can lock the device. This skill is for defensive integrity verification and authorized assessment.
Overview
A Trusted Platform Module (TPM 2.0) is a hardware root of trust that supports measured boot: each stage of the boot chain hashes ("measures") the next stage and extends that measurement into a Platform Configuration Register (PCR) before handing off control. PCRs cannot be set arbitrarily — they can only be extended (new = hash(old || measurement)), so the final PCR value is a tamper-evident summary of everything that executed. The TCG firmware profile assigns specific meanings: UEFI firmware code/config measure into PCR 0–7 (PCR 7 specifically captures Secure Boot policy), bootloaders measure the kernel into PCR 8–9, and Linux IMA measures executables into PCR 10.
Two complementary verifications matter. Local validation reads current PCRs (tpm2_pcrread) and replays the TPM event log (tpm2_eventlog on /sys/kernel/security/tpm0/binary_bios_measurements) to confirm the recorded measurements reproduce the live PCR values — proving the log is authentic and revealing exactly what changed if a value drifts from baseline. Remote attestation has the TPM produce a signed quote (tpm2_quote) over selected PCRs using an Attestation Key (AK), with a fresh nonce to prevent replay; a verifier then independently checks the signature and PCR digest (tpm2_checkquote) and compares against a golden/expected value. This lets a server cryptographically establish that a remote machine booted approved firmware and kernel before granting access, sealing secrets, or admitting it to a Zero Trust network.
This skill provides the full tpm2-tools workflow for enrolling an AK, capturing and verifying quotes, replaying event logs, sealing/unsealing data to a PCR policy, and building a golden-value baseline for fleet attestation.
When to Use
- Establishing that endpoints/servers booted a known-good firmware and kernel before granting access (Zero Trust device posture).
- Detecting boot-chain tampering (bootkits, unauthorized firmware/kernel changes) via PCR drift from a baseline.
- Verifying measured-boot integrity after a Secure Boot or firmware incident.
- Sealing secrets (disk keys, credentials) to a measured-boot state so they only release on a trusted boot.
- Building or auditing a remote-attestation service (e.g., Keylime, custom verifier).
Prerequisites
- A system with a TPM 2.0 device and the resource manager:
sudo apt install tpm2-tools tpm2-abrmd # Debian/Ubuntu sudo dnf install tpm2-tools tpm2-abrmd # Fedora/RHEL - Access to the TPM (
/dev/tpm0//dev/tpmrm0) and the kernel measurement log at/sys/kernel/security/tpm0/binary_bios_measurements. - Root for reading some sysfs entries and for NV/AK operations.
- For remote attestation: a verifier host and a transport for the quote/nonce exchange.
Objectives
- Read and interpret PCR banks and their TCG-assigned meanings.
- Verify the TPM event log reproduces live PCR values (event-log replay).
- Create an Attestation Key and produce a nonce-bound signed quote.
- Independently verify the quote signature and PCR digest on a verifier.
- Establish golden PCR baselines and detect drift across a fleet.
- Optionally seal/unseal a secret to a measured-boot PCR policy.
MITRE ATT&CK Mapping
| Technique ID | Technique Name | Relevance |
|---|---|---|
| T1542 | Pre-OS Boot | Measured boot detects pre-OS tampering this technique relies on. |
| T1542.001 | Pre-OS Boot: System Firmware | PCR 0–7 drift reveals unauthorized firmware modification. |
| T1542.003 | Pre-OS Boot: Bootkit | Bootloader/kernel measurements (PCR 8–10) expose bootkit changes. |
| T1014 | Rootkit | IMA measurements (PCR 10) and quote verification surface concealed tampering. |
| T1601.001 | Modify System Image: Patch System Image | Attestation against golden values flags unauthorized image patches. |
Workflow
1. Confirm the TPM is present and read its properties
tpm2_getcap properties-fixed | grep -i manufacturer
tpm2_getcap pcrs # list supported PCR banks (sha1, sha256, ...)
2. Read current PCR values
…
よくある質問
TPMとは何ですか?
TPMは「Trusted Platform Module」の略で、重要な情報を保護し、システムの完全性を保証するためのコンピュータ内のセキュリティチップです。
「測定ブート(measured boot)」とは何ですか?
TPMがコンピュータの起動の各段階に関する情報を記録する仕組みです。この記録を確認することで、何も改変されていないことを確かめられます。
PCRとは何ですか?
PCR(Platform Configuration Registers)は、TPM内にある小さな記録領域のようなもので、起動段階の記録を保存します。記録の信頼性を保つため、決められた方法でしか更新できません。
詳細
作者による元の説明
Verifies TPM 2.0 measured-boot integrity and remote attestation with tpm2-tools -- reading PCRs (tpm2_pcrread), replaying the boot event log, generating and checking signed quotes (tpm2_quote/tpm2_checkquote), and sealing secrets to a PCR policy. Use to confirm a system booted trusted firmware/kernel for Zero Trust device posture, detect boot-chain tampering via PCR drift, or build a golden-value
人気
- GitHubのスター
- 35k
- ランキング
- #8407
- ライセンス
- 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エージェントがハードディスクの完全なコピーを作成できるようにします。調査中に情報が失われたり改変されたりしないようにするのに役立ちます。
似ているスキル
test-driven-development
311k機能や修正を作る前に、まず失敗するテストを書き、それが失敗するのを確認してから、合格させる最小のコードを書くようエージェントに教えます。
verification-before-completion
311kタスク、修正、ビルドが完了した、または合格したと主張する前に、実際のチェックを実行し、その出力を読むようエージェントに教えます。
migrate-to-shoehorn
310kテストファイル内の危険な型キャストを、shoehornライブラリに置き換え、テストが部分的なデータを使いつつ型チェックを通るようにします。