13,486 karma · joined Jun 1, 2016 (10y ago) · 4,896 submissions
comment 5y ago · link · parent
The secret never leaves the enclave.
The goal here is that if an attacker can execute code within A's operating system that they can not exfiltrate the password. They might be able to get the enclave to sign on their behalf, but that's significantly better than an exposed secret - simply removing the attacker from the box would be sufficient to remediate, vs having to rotate the secret.
To mitigate impersonation, I suppose one could do a number of things involving a second key, but I think that this simple version demonstrates the value of having a signing oracle. This is actually not an atypical approach, just not using sgx - I know companies that keep their signing keys in separate processes, which are mutually seccomp'd such that they can only pipe messages to each other for signing purposes of apps before publishing. But in the sgx case you have a much stronger guarantee than just seccomp.
So to me the only problem that attestation solves here is if the attacker is somehow in the SGX enclave, but actually the much more likely scenario is that they aren't, and that they just ask the oracle to sign on their behalf - because B can't verify that A is the one asking to sign. Given that there is a single entity deploying both the software in the enclave and the service that interacts with it at least, that seems to be the case to me - like, in this scenario A, B, and the software in the enclave are all deployed by me, barring malicious action to interfere with that - but again, the most likely scenario is the attacker just owned the box and has a regular user on there.
But... also also, A can prevent impersonation via tricking the oracle by having another keypair shared between it and the enclave, and then it becomes a matter of protecting that memory from an attacker who can almost certainly scrape your memory - a hard thing to do.
So you end up with:
System 0, A: Key 0 System 0, Enclave: Key 1, Key 0 System 1, B: Key 1
Key 0 is used to 'auth' A to Enclave. Key 1 is used to auth A to B (via enclave oracle).
This is just my perspective on it.
comment 5y ago · link · parent
Thanks for clearing that up.
comment 5y ago · link · parent
Like I have service A and service B. A is going to talk to B, and has some secret that identifies it (maybe a private key for mTLS). I'd like for A to be able to talk to B without having access to that secret - so it would pass a message into the enclave, get a signed message out of it, and then proceed as normal.
Would that not be reasonable? Or I guess maybe I'd want to attest that the signing service is what I expect?
comment 5y ago · link · parent
a) How the hell I'm supposed to do so? It seems fairly arcane and in need of some higher level abstractions. fortanix[0] seems like it could be good here?
b) What the implications are. What's it like to maintain an enclave? What do I lose in terms of portability, debug-ability, etc?
It reminds me of GPU to some extent - it's this thing in my computer that's super cool and every time I think about using it it looks like a pain in the ass.
comment 5y ago · link · parent
DDG has a 'bang syntax' where I can do things like '!rust' to start searching the rust docs from my url - I like that a lot, I wonder if there's anything similar here or if I could work around that somehow.
comment 5y ago · link · parent
https://bugs.chromium.org/p/chromium/issues/detail?id=916326...
But to their credit they do provide external links with more details. Reading those now, because I'm running into the same questions/ conclusions as you.
comment 5y ago · link · parent
That said, I'm in agreement that most devs don't know much at all about performance. Frankly, we're told not to... it's a sad state. Performance is explicitly referred to as a last priority, the "optimization is the root of all evil" quote is completely taken out of context and parroted everywhere (go look up Knuth/Hoare's context if you haven't), etc.
All that is to say, the issue is not specific to education but is an unfortunate part of engineering culture. We, as a large group, explicitly neglect performance and treat it as a dirty word.
IMO we need a sort of performance revolution the way testing got one. I've written lots of software in a 'benchmark driven' way, and the results are extremely fast programs - I've gotten programs down from just under 1ms to a few dozen nanoseconds like that.
comment 5y ago · link · parent
I suppose that's reasonable. Sounds like reproducible builds is a big step towards that, though clearly this requires quite a lot of infrastructure support beyond just that.
comment 5y ago · link · parent
Why? How will this help with the problems you're talking about?
I can't come up with a single benefit to security from reproducible builds. It seems nice for operational reasons and performance reasons though.
comment 5y ago · link · parent
The impact of TLB flushing, not just the cost of the flush, is really significant - it's going to take a lot of work to be as expensive within the syscall path.
comment 5y ago · link · parent
The teacher is basically like "haha dumb kids, we know you're cheating" and "if only we could punish students more!". There's a lot of "the smart kids are suffering because of the dumb kids" attitude here that I find disgusting.
> That too was in keeping with a theme. The teacher email I mentioned above was from one of the conference threads, but the emails sent to me personally from counselors and administrators have overwhelmingly broken down along these lines: such-and-such a student is feeling stressed, so please excuse her from this set of assignments. This other student gets nervous about taking tests or giving presentations or working in groups, so please excuse him from work of those types.
Oh god, how awful that these students won't get to suffer through some idiot's assignment that I'm sure would greatly better their life.
There's a lot wrong with school but I feel like this teacher doesn't realize that they're a part of that.
> Wow, a 100% pass rate! What a successful school!
Yes, it's cheating. They have an incentive, as your students do, to 'pass', and so they cheat.
Give students a place to be during the day while their parents work. Give them real, meaningful incentives that matter to young people - money, freedom, social structure, a feeling of productivity - and align those with learning real, practical skills, like how to read, write, analyze context, etc.
Hire non-idiots, pay them more, reduce class sizes. Yeah it'll cost more, but the obvious economic benefits will offset that. I can count on one hand how many teachers I had that I respected - the rest were obvious failures.
comment 5y ago · link · parent
If people were willing to put every webpage behind a "do you want to run this webpage" we'd see them all using noscript already - virtually no one wants that experience.
> largely under the theory that we can do it safely with correct design
I blame operating systems and hardware vendors tbh. It's their job to make this safe, and they do a pretty bad job of it. Browser vendors have had to pick up a massive amount of slack to try to compensate, to the extent that browser teams have to make major patches to the Linux kernel.
comment 5y ago · link · parent
I think one problem with the comments about this post is that they doesn't emphasize enough that the hit is to system call heavy workloads. This is NOT a global slowdown of all compute. The hit is to system call performance, and it's big, no question, but I don't think we need to throw out the internet's structure in order to address that.
One option is to make fewer system calls. For a program that is basically scanning a file system that might be harder to do today, but for tons of other programs it isn't, and with iouring we have a very reasonable escape hatch for optimizing syscall heavy workloads.
This might sound silly, but this sort of thing is constantly happening - programs are optimized for thinking something is fast and something else is slow. For example, if you built a program in the 2000s you'd do everything you can to avoid the disk, aggressively caching. In 2020 disks are insanely fast, and the cost of caching will be worse than just optimizing your disk usage.
I don't know about the average website, but from what I can tell most sites that aren't total shit are pretty 'clean'. With an adblocker, especially so.
> running code you can't trust
We do that already. There's literally dozens of mitigations taken based on this.