Better HN
topnewbestaskshowjobs
Log inSign up

staticassertion

13,486 karma · joined Jun 1, 2016 (10y ago) · 4,896 submissions

@insanitybit
Submissions

comment 5y ago · link · parent

Almost but not quite. A needs to prove to B that it's allowed to talk to B. So there's a signing service in an Enclave that A can access. It passes a message in, the enclave signs the message, and A sends the message to B.

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

What would that accomplish?

comment 5y ago · link · parent

Got it, ok. Yeah, I think that's reasonable, though I do also think that it's "extra". I would consider moving the key to the enclave without attestation to be a win, though I very much like the idea of having that level of authenticity as well.

Thanks for clearing that up.

comment 5y ago · link · parent

Is a user necessary? I feel like one thing I'd use an enclave for is as a signing oracle for service to service communications.

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

Awesome, thank you.

comment 5y ago · link · parent

True, but I'm assuming that this is all moving towards enclaves being more standard and cross platform.

comment 5y ago · link · parent

I really like the idea of secure enclaves. I'd like to use them. The problem I have is that it's unclear to me:

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

Here I had assumed it was a Ricky Martin reference.

comment 5y ago · link · parent

> Update: We do support !rust as well (and all of DDG's other bangs).

damn, alright, you got me. I'll try it out as default for a while

comment 5y ago · link · parent

It's many many years old.

edit: Oh, so this is a new, open version of the 2012 system. So perhaps not.

comment 5y ago · link · parent

Very cool - good to know.

comment 5y ago · link · parent

Seems quite fast, good UX overall. I like that it gives me information like "all results from Brave" so that if they do fall back I know about it.

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

Agreed.

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

As a college drop out I'm pretty sure I know more about writing efficient code than most CS grads - I've seen what gets taught, it's not impressive. I've also seen bootcamps (haven't attended, but friends have) and while they don't teach about efficiency, they're far more rigorous than college was. Anyway, I don't want to get into this really, but I found this part of your post to be annoyingly off-base, and I resent it.

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

Linux is extremely optimized for happy path coding.

comment 5y ago · link · parent

OK so a build machine is owned and we have a sort of consensus for trusted builders, and if there's a consensus mismatch we know something's up.

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

How does this work in practice? The distro is owned, so where are you getting the hash from? I mean, specifically, what does the attacker have control of and how does a repeatable build help me stop them.

comment 5y ago · link · parent

> Reproducible builds are way more important than is currently widely appreciated.

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

That assumes that the malware can already have arbitrary control over system calls, at which point spectre isn't the issue.

comment 5y ago · link · parent

OK, where's the data?

comment 5y ago · link · parent

AFAIK there's more evidence supporting that ~B students are the most successful vs A students.

comment 5y ago · link · parent

So the answer is no.

comment 5y ago · link · parent

Yeah that should be really fast, still. Programs could also opt to just tell the OS "hey don't check this system call from me", on each system call, avoiding any lookup.

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

Is there any evidence at all that AP classes and high GPAs leads to success, when controlling for other variables?

comment 5y ago · link · parent

School's so stupid. If you give people a grade and tell them to maximize it, with no meaningful rewards that they can understand, they're going to cheat. Duh. I regret not cheating in school, what a waste of time all of that shit was.

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

I don't know but I can't imagine a highly predictable branch being slower than a TLB flush.

comment 5y ago · link · parent

I don't think this would solve anything. This is like putting Word macros behind a "do you want to run this macro?". Yes, yes they do want to run it.

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 virtually every Spectrev1 POC is browser based Javascript.

comment 5y ago · link · parent

You're basically saying "let's consider reinventing the internet", which I think is not reasonable or a good idea.

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.

1
909192
164