validating-tpm-measured-boot-attestation
यह क्या करती है
यह tool जाँचता है कि आपका कंप्यूटर TPM नाम की एक खास chip का इस्तेमाल करके सुरक्षित तरीके से boot हुआ या नहीं। यह सुनिश्चित करता है कि कंप्यूटर शुरू होने से पहले ही operating system और दूसरे ज़रूरी programs से hackers ने छेड़छाड़ नहीं की।
कब इस्तेमाल करें
- ✓किसी नए कंप्यूटर को सुरक्षित network से जोड़ते समय।
- ✓यह जाँचने के लिए कि startup के दौरान कंप्यूटर से छेड़छाड़ हुई या नहीं।
- ✓passwords जैसे ज़रूरी secrets की सुरक्षा के लिए, ताकि वे तभी उपलब्ध हों जब system सही तरीके से boot हो।
Skill का लिंक
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/validating-tpm-measured-boot-attestation/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“जाँचो कि मेरा कंप्यूटर सुरक्षित तरीके से boot हुआ है और operating system में कोई बदलाव नहीं हुआ है।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
TPM कंप्यूटर की boot प्रक्रिया के हर चरण को रिकॉर्ड करता है। यह tool इन रिकॉर्ड्स की तुलना उससे करता है जो होना चाहिए था, ताकि किसी भी संदिग्ध बदलाव का पता चल सके।
तकनीकी सामग्री (मूल 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 है। यह आपके कंप्यूटर में मौजूद एक security chip है जो संवेदनशील जानकारी की रक्षा करती है और system की अखंडता सुनिश्चित करती है।
'measured boot' क्या है?
measured boot एक प्रक्रिया है जिसमें TPM कंप्यूटर के startup के हर चरण की जानकारी रिकॉर्ड करता है। इससे एक ऐसा रिकॉर्ड बनता है जिसे जाँचा जा सकता है कि कुछ बदला तो नहीं गया।
PCRs क्या हैं?
PCRs (Platform Configuration Registers) TPM के अंदर छोटे memory डिब्बों जैसे होते हैं, जिनमें boot चरणों के रिकॉर्ड रखे जाते हैं। इन्हें सिर्फ़ एक खास तरीके से अपडेट किया जा सकता है, ताकि रिकॉर्ड भरोसेमंद रहें।
जानकारी
लेखक का मूल विवरण
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
- अपडेट की गई
- 31/8/2026
कमेंट
- …
इस repository की और skills
abusing-dpapi-for-credential-access
35kआपके AI एजेंट को किसी खास काम के लिए तैयार instructions देता है, ताकि वह उसे बेहतर और तेज़ी से कर सके।
abusing-shadow-credentials-for-privesc
35kआपके AI एजेंट को साफ़ और अच्छी तरह से व्यवस्थित लिखना सिखाता है।
achieving-cmmc-level-2-compliance
35kयह आपके एजेंट को CMMC Level 2 compliance के लिए environment तैयार करने में मदद करता है। यह security requirements लागू करता है और ज़रूरी documentation संभालता है।
acquiring-disk-image-with-dd-and-dcfldd
35kआपके एजेंट को hard drives की exact copies बनाने में मदद करता है। जाँच के दौरान किसी भी जानकारी के खोने या बदलने से बचाने के लिए यह उपयोगी है।
मिलती-जुलती skills
test-driven-development
311kयह आपके एजेंट को किसी भी फ़ीचर या सुधार से पहले पहले असफल होने वाला टेस्ट लिखना, उसे असफल होते देखना, फिर पास करने वाला सबसे छोटा कोड लिखना सिखाती है।
verification-before-completion
311kयह आपके एजेंट को किसी काम, सुधार या build के पूरा या पास होने का दावा करने से पहले असली जांच चलाकर उसका आउटपुट पढ़ना सिखाती है।
migrate-to-shoehorn
310kआपकी टेस्ट फ़ाइलों में जोखिम भरे type casts की जगह shoehorn लाइब्रेरी लगाती है, ताकि टेस्ट अधूरे डेटा से भी type checks पास कर सकें।