Readit News logoReadit News
jansommer commented on Ask HN: What are you working on? (March 2025)    · Posted by u/david927
jansommer · 5 months ago
I'm thinking about how to properly test AWS Step Functions. The problem is that I can either mock the entire response for every state in JSON only, or call out to a lambda. What I want is to type check the evaluated JSONPath payload and the mocked JSON response, to ensure that my tests always adheres to global contracts/types written in JSON Schema.

I think it's doable by dynamically creating lambdas based on test cases I define in one way or another, perhaps like mocked integration services, that does nothing but validate if the event from SFN matches a schema, and that the mocked response also matches a schema.

My concern is that I can't find prior projects doing this. My use case is mostly (exclusively at the moment) calling out to lambdas, so perhaps I can get away with this kind of type checking. But it's just weird that something like this doesn't already exist! Past experiences have taught me that if no one have tried it before, my idea is usually not that good.

Let me know what you think!

(Would have liked to use durable execution which totally solves the typing issue, but can't in this case)

Deleted Comment

jansommer commented on Bypassing disk encryption on systems with automatic TPM2 unlock   oddlama.org/blog/bypassin... · Posted by u/arjvik
keeperofdakeys · 7 months ago
You can mitigate this by including PCRs that sign the kernel and initrd, however it means whenever you update you need to unlock manually. On Redhat-based distros this can be done with PCRs 8 and 9, though IIRC this may change on other distros.

Also AFAIK there is no standard way to guess the new PCRs on reboot so you can't pre-update them before rebooting. So you either need to unlock manually or use a network decryption like dracut-sshd.

jansommer · 7 months ago
You can use tpm2_policyauthorize and allow the PCR to change without having to manually unlock. This was not supported in TPM 1.2.

You can use it with Systemd.

https://github.com/tpm2-software/tpm2-tools/blob/master/man/...

jansommer commented on Dumping Memory to Bypass BitLocker on Windows 11   noinitrd.github.io/Memory... · Posted by u/supermatou
dist-epoch · 8 months ago
From what I know, the state of the UEFI settings is hashed into some PCR registers. Potentially even hardware serial numbers. Sometimes when I modify non-secureboot BIOS settings, Bitlocker complains and enters into recovery mode.

So I really doubt TPM will release the keys on a different motherboard with different UEFI settings.

User changed motherboard and TPM complains: https://old.reddit.com/r/pcmasterrace/comments/vdvni1/swappe...

jansommer · 8 months ago
Odd that you have to recover from changing UEFI settings with Secure Boot! You should be able to change any setting when that's enabled. BitLocker binds to a lot of other things when SB is off and might be fragile in that state. But it does seem that some changes will affect PCR 7:

> PCR 7 changes when UEFI SecureBoot mode is enabled/disabled, or firmware certificates (PK, KEK, db, dbx, …) are updated. The shim project will measure most of its (non-MOK) certificates and SBAT data into this PCR. — https://uapi-group.org/specifications/specs/linux_tpm_pcr_re...

It makes sense to use the certificates to generate PCR 7. I wonder if you can swap out the motherboard with one of the same model with the same certificates without modifying the PCR 7 digest...

But if Shim actually modifies the digest, I guess that SB would completely mitigate OP's exploit since the TPM policy is going to fail when the PCR 7 values doesn't match.

jansommer commented on Dumping Memory to Bypass BitLocker on Windows 11   noinitrd.github.io/Memory... · Posted by u/supermatou
jansommer · 8 months ago
7+11 is default for BitLocker as far as I know. Binding to other values will bite you later if you update UEFI firmware or change some settings.

GRUB and all other boot loaders are unecessary with UEFI. See my comment history for more.

Kernel updates + Secure Boot is easy with a Debian hook.

The hard part is making it work with TPM when you want to add encryption...

jansommer · 8 months ago
Found the article where I read about PCR 7+11 being the default [1]. The reason I looked it up is because if this is actually true, and the TPM is built into the cpu, what prevents someone from placing the cpu and disk on another motherboard?

Say that you have disabled usb booting and secured UEFI settings with a password. If you extract the cpu (and thereby its tpm) and the disk, then you'd still be able to boot, right? Meaning that without a TPM pin, you'd be able to do OP's attack on a different motherboard even when the original machine was off and UEFI settings secured.

What am I missing? Is it that easy to circumvent UEFI settings protection and maintain the PCR 7 value?

[1] https://blog.scrt.ch/2023/09/15/a-deep-dive-into-tpm-based-b...

jansommer commented on Dumping Memory to Bypass BitLocker on Windows 11   noinitrd.github.io/Memory... · Posted by u/supermatou
mjg59 · 8 months ago
Why? It means you'll only get one shot at the attack, but nothing here is intrinsically prevented by using a TPM PIN (or even a non-TPM password, the attack doesn't depend on TPM-based Bitlocker in any way other than if the target machine is powered off or your first attempt fails)
jansommer · 8 months ago
I wouldn't underestimate that a PIN prevents this attack on machines that are powered off.

You can then go further up the chain with a UEFI settings password and no usb booting. If the password is hard to decrypt, then that's a pretty good approach.

Then there's custom Secure Boot certificates that replaces the ones from MS. It'll work for Linux, not sure about BitLocker. But my Surface tablet doesn't even support custom sb certs.

jansommer commented on Dumping Memory to Bypass BitLocker on Windows 11   noinitrd.github.io/Memory... · Posted by u/supermatou
BobbyTables2 · 8 months ago
Might need most of PCRs 0-7. Isn’t PCR 4 used to measure the EFI executable booted by UEFI?

Avoid GRUB, difficult to secure with it.

Kernel updates will also be painful…

jansommer · 8 months ago
7+11 is default for BitLocker as far as I know. Binding to other values will bite you later if you update UEFI firmware or change some settings.

GRUB and all other boot loaders are unecessary with UEFI. See my comment history for more.

Kernel updates + Secure Boot is easy with a Debian hook.

The hard part is making it work with TPM when you want to add encryption...

jansommer commented on Dumping Memory to Bypass BitLocker on Windows 11   noinitrd.github.io/Memory... · Posted by u/supermatou
tchebb · 8 months ago
Surely Windows keeps the FVEK in RAM regardless of whether the TPM requires a PIN to initially obtain it. Otherwise, wouldn't you need to enter your PIN every time a block from the disk needs decrypting? Not to mention the performance impact of calling the TPM on every disk operation.

This attack reads the key from RAM, so I don't see how a TPM PIN would mitigate it.

jansommer · 8 months ago
If you can short the reset pins while the computer is running and make it restart without losing power, then yes, I agree. But if you have to shut down to make your modifications, then you won't get past the PIN prompt.
jansommer commented on Dumping Memory to Bypass BitLocker on Windows 11   noinitrd.github.io/Memory... · Posted by u/supermatou
varispeed · 8 months ago
Isn't TPM just a honeypot of sorts? It seems strange to me that after successful open source encryption software, there was a shift to TPM, like you'll have a notion of super secure storage provided by big corporations and you should just not worry about it and not question.

Surely there must be a backdoor access for three letter agencies to just download all the pins and passwords and then take a dip in the data, no worries.

jansommer · 8 months ago
Should be good enough for a personal tablet used for mail and browsing. If I drop it and someone curious finds it, I'd like to make it impossible for them to extract anything useful.
jansommer commented on Dumping Memory to Bypass BitLocker on Windows 11   noinitrd.github.io/Memory... · Posted by u/supermatou
jansommer · 8 months ago
I think you get the biggest advantage from BitLocker when you use TPM (PCR 7+11) with a PIN. That should mitigate the exploit because the FVEK should never be read without the PIN, and if BitLocker does it right (which I think it does) too many wrong PIN's results in the TPM going into dictionary attack lockout mode.

Now I've been trying for months to do the same for Linux. There's systemd-cryptsetup/cryptenroll, but it's only for LUKS and I'm trying to encrypt a few sensitive directories on a super slow internal eMMC with fscrypt (keys for secure boot and /home). The TPM is _EXTREMELY_ hard to code for when things go beyond the basics:

1. Bind to PCR 7

2. Bind to changing PCR 11 (changes whenever the kernel, init, cmdline etc. is updated)

3. Use a PIN - but not the AuthValue, because I want to use the same authorization policy for resetting the DA lockout counter on login, and also have a long password/AuthValue for resetting the counter manually.

4. Make it all work with PCR 11 signatures and public keys provided by systemd-stub.

Maybe this isn't the right place to ask, but there's almost nothing but basic TPM guides out there, so if you're an expert I could really use your help. It's just for a personal project, but I'll write about it once I'm done - if I ever figure it out!

u/jansommer

KarmaCake day467July 16, 2020
About
https://ja.nsommer.dk
View Original