external/anthropic-cybersecurity-skills/skills/validating-tpm-measured-boot-attestation/SKILL.md
Verify TPM PCRs and measured-boot and remote-attestation integrity.
npx skillsauth add seikaikyo/dash-skills validating-tpm-measured-boot-attestationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.
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.
sudo apt install tpm2-tools tpm2-abrmd # Debian/Ubuntu
sudo dnf install tpm2-tools tpm2-abrmd # Fedora/RHEL
/dev/tpm0 / /dev/tpmrm0) and the kernel measurement log at /sys/kernel/security/tpm0/binary_bios_measurements.| 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. |
tpm2_getcap properties-fixed | grep -i manufacturer
tpm2_getcap pcrs # list supported PCR banks (sha1, sha256, ...)
PCR 7 = Secure Boot policy; PCR 0–7 = firmware; PCR 8–9 = bootloader/kernel; PCR 10 = IMA.
tpm2_pcrread sha256 # all sha256 PCRs
tpm2_pcrread sha256:0,1,2,3,4,5,6,7 # firmware + Secure Boot policy
tpm2_pcrread sha256:7 # Secure Boot policy only
Confirm the recorded log reproduces the current PCR values (authenticity check).
tpm2_eventlog /sys/kernel/security/tpm0/binary_bios_measurements > eventlog.yaml
# The YAML includes a "pcrs" section with the calculated values — compare to step 2.
# Any mismatch means the event log and the live PCRs disagree (tampering or stale log).
The AK signs quotes; its public part is shared with the verifier out-of-band.
tpm2_createprimary -C e -g sha256 -G rsa -c primary.ctx
tpm2_create -C primary.ctx -G rsa -u ak.pub -r ak.priv \
-a 'fixedtpm|fixedparent|sensitivedataorigin|userwithauth|restricted|sign'
tpm2_load -C primary.ctx -u ak.pub -r ak.priv -c ak.ctx
tpm2_readpublic -c ak.ctx -o ak.pem -f pem # export AK public key for the verifier
The verifier supplies a fresh random nonce to defeat replay.
NONCE=$(openssl rand -hex 20)
tpm2_quote -c ak.ctx -l sha256:0,1,2,3,4,5,6,7,8,9 \
-q "$NONCE" -m quote.msg -s quote.sig -o quote.pcrs -g sha256
# Send quote.msg, quote.sig, quote.pcrs (and the nonce) to the verifier.
Independently validate the signature, nonce, and PCR digest with the AK public key.
tpm2_checkquote -u ak.pem -m quote.msg -s quote.sig -f quote.pcrs \
-q "$NONCE" -g sha256
# Exit 0 + matching PCR digest == authentic, fresh, untampered quote.
Compare attested PCRs to known-good values captured from a trusted reference build.
# Capture golden values on a trusted reference machine:
tpm2_pcrread sha256:0,7 > golden_pcrs.txt
# On each attested host, diff the quote's PCR section against golden_pcrs.txt.
diff <(grep -A8 'sha256' quote.pcrs) golden_pcrs.txt
Bind a secret so the TPM only releases it when PCRs match the trusted state.
tpm2_createpolicy --policy-pcr -l sha256:7 -L pcr7.policy -f pcr7.dat
echo -n "diskkey" | tpm2_create -C primary.ctx -L pcr7.policy \
-i - -u sealed.pub -r sealed.priv
tpm2_load -C primary.ctx -u sealed.pub -r sealed.priv -c sealed.ctx
# Unseal succeeds only while PCR 7 matches the sealed policy:
tpm2_unseal -c sealed.ctx -p pcr:sha256:7
If IMA is enabled, the runtime measurement list extends PCR 10.
tpm2_pcrread sha256:10
head -20 /sys/kernel/security/ima/ascii_runtime_measurements
agent.py reads PCRs, replays the event log, optionally produces+verifies a quote, and diffs a baseline.
sudo python scripts/agent.py --pcrs 0,1,2,3,4,5,6,7 --baseline golden_pcrs.json --output attest.json
| Tool | Purpose | Source | |------|---------|--------| | tpm2-tools | CLI for all TPM 2.0 operations | https://github.com/tpm2-software/tpm2-tools | | tpm2-tss | TSS2 stack the tools build on | https://github.com/tpm2-software/tpm2-tss | | Keylime | Scalable remote attestation framework | https://github.com/keylime/keylime | | TCG PC Client Platform Firmware Profile | PCR usage specification | https://trustedcomputinggroup.org/ | | Linux IMA docs | Integrity Measurement Architecture | https://sourceforge.net/p/linux-ima/wiki/Home/ | | RFC 9683 | Remote integrity verification of TPM devices | https://datatracker.ietf.org/doc/html/rfc9683 |
tpm2_checkquote.tools
Conduct comprehensive GDPR compliance assessments by evaluating data processing activities against EU Regulation 2016/679, including Article 30 records of processing, lawful basis validation, data subject rights implementation, Data Protection Impact Assessments (DPIAs) under Article 35, breach notification procedures, international transfer safeguards (SCCs, adequacy decisions), and technical/organizational measures under Article 32. Use when processing personal data of EU residents, preparing for supervisory authority audits, implementing privacy-by-design for new systems, scoping compliance gaps for M&A due diligence, assessing third-party processors, or responding to data subject access requests at scale. Incorporates 2026 guidance from ICO, EDPB, and post-Data (Use and Access) Act 2025 UK-GDPR considerations. Do not use for implementing specific Article 32 controls — use implementing-gdpr-data-protection-controls; or for DSAR automation — use implementing-gdpr-data-subject-access-request.
tools
Parse Windows forensic artifacts—$MFT/$J (MFTECmd), Prefetch (PECmd), registry hives (RECmd), shellbags, and Amcache—into normalized CSV/JSON with Eric Zimmerman's EZ Tools, then load results into Timeline Explorer for analysis. Use during DFIR/incident-response investigations, after triage collection (e.g. with KAPE), to establish program execution, file/folder access, and persistence evidence from acquired forensic images.
development
Build automated multi-turn adversarial attacks against conversational LLM targets using Microsoft PyRIT's RedTeamingOrchestrator, CrescendoOrchestrator (gradual escalation), and TreeOfAttacksWithPruningOrchestrator (adaptive branching), with scorer feedback loops and persisted conversation memory. Use when single-shot LLM scanning is insufficient and you need multi-turn, scorer-driven AI red-team campaigns against a chatbot or agent.
testing
Stand up MISP, enable and cache curated threat feeds (CIRCL, abuse.ch, Feodo Tracker), apply warninglists to suppress false positives, query indicators with PyMISP, and export attributes as auto-generated Suricata/Sigma/Wazuh detection rules. Use when maturing a MISP instance to actively drive detection, curating threat feeds with quality controls, or automating IOC-to-detection pipelines for the SIEM/IDS.