Better HN
topnewbestaskshowjobs
Log inSign up

staticassertion

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

@insanitybit
Submissions

comment 4y ago · link · parent

There are multiple different problems with different solutions of varying impact.

I think you can probably split the two areas of interest into:

1. A package maintainer's credentials are compromised

2. A package repository is compromised

And the two attack vectors into:

1. The build script(s)

2. The runtime library

You can cut off the "repository is compromised" path with signing. An attacker doesn't have the maintainer's private key so even if they can modify source/packages on the server they can't "trick" the client into verifying it.

(1) is harder. Let's assume we have package signing, we know that any package we have was signed with a key that we hope only the maintainer has access to. At this point, either the maintainer is compromised or malicious. We can make compromise harder in a few ways, but should ultimately assume compromise.

One way to reduce compromise is to have the signing key stored on a hardware token that requires proof-of-presence for signatures.

Still, at this point we have "build script bad" and "library bad". Both are much harder problems, with solutions that you've alluded to to some extent - that is, sandboxing behaviors.

What this requires is a way to say "this code can do these things". This is how browser extensions / mobile apps work - they have to declare their permissions and you have to ack them any time they change.

Doing this for build scripts isn't too hard. You can run the scripts in a "hermetic" build system and have each script execute serially in a restricted environment - if one needs networking, give it networking, etc. There's no native support for this but imo it wouldn't be that hard to add it in.

Doing this for libraries is much harder. You'd need a native capabilities system in the language, and changes to capabilities would break the API. But sandboxing entire processes isn't that hard. The vast majority of services don't require egress to the public internet, meaning that an attacker is already going to have a hell of a time if they just get a shell into some box that they can't even communicate with. So I'd say start there - limit processes to what they can do and that limits the impact of a compromised library.

So altogether, none of these approaches seem super hard. We have signing, sandboxed builds (they can be pretty loosely sandboxed tbh - do a 'fetch', and then cut off internet for build scripts/ limit fs access), sandboxed services.

It'd be nice to have something more robust, but today you can do everything above without a ton of effort.

comment 4y ago · link · parent

I have no idea how many attacks this would stop. I suspect the answer is, roughly, "some".

comment 4y ago · link · parent

It was like 3,400 or something like that.

It's a work laptop, although I use it almost exclusively these days since I can easily use a "personal" profile. It's very easy to manage things like SSO/device policies on Chromebooks because of the GSuite integration.

There's pretty much nothing that it's "worse" at, other than in some niche scenarios - like there's a bug where the VM will return an invalid code for a specific CPUID, and it doesn't support nested virtualization, etc. Pretty niche stuff.

Otherwise... it works. Funny enough I'm now in quite a pickle with my Ubuntu laptop, which updated to a new kernel, failed, and now I can't roll back to the previous kernel. Because of this, virtually no drivers are working, so I can't connect to the internet... making it really really fun to deal with! Stuff like this doesn't really happen on my Chromebook.

comment 4y ago · link · parent

Presumably the cost here is that your instructions are considerably larger, which means fitting fewer of them into cache?

comment 4y ago · link · parent

> and in the world of ARM CPUs it's not.

How can this be true? I'm not saying it isn't, but this makes it sound like ARM is just objectively better - lower power and higher performance? I assume it's more complicated.

comment 4y ago · link · parent

In fact it's capable of bringing up many. You can create N VMs and M containers if you want to.

comment 4y ago · link · parent

I have an 8 core CPU + 32GB RAM + 1TB Chromebook and it's my daily driver. I have ~100 tabs open, ~2 intellij projects open, some streaming service like youtube, netflix, hulu, etc. I run builds that pin the CPU such that if I had twice the cores I'd absolutely notice it.

I'd be very happy to see 16 core Chromebooks tbh, I definitely make heavy use of all 8 of mine today.

comment 4y ago · link · parent

Yes, but you can't guess a TOTP. You can guess a password. But I hope that Github will make their FIDO2 support better.

comment 4y ago · link · parent

I am against SMS 2FA.

comment 4y ago · link · parent

I wouldn't classify it as very harsh at all.

comment 4y ago · link · parent

Yes, it definitely does not solve every problem.

comment 4y ago · link · parent

I'm just celebrating a successful deployment of something I've wanted for a long time. It's already being effective and it's not even rolled out yet.

comment 4y ago · link · parent

The expansion mentioned in the article is explicitly passwordless.

comment 4y ago · link · parent

Excellent stuff :)

comment 4y ago · link · parent

I don't see what's mean about what I said, I'm quite excited to see this change already having positive impact.

comment 4y ago · link · parent

Wonderful news. Supply chain security is a disaster because developers won't opt into any kind of security features in the majority. Mandating 2FA is the obvious solution, and we'll all be radically safer for it.

Glad to see Github pushing this, I hope package repositories follow suit!

comment 4y ago · link · parent

> You can put an auth cookie in a browser and achieve 2FA for 99% of use cases without bothering anyone.

Confusing, obviously incorrect.

> No reason 2FA can't be just two passwords.

Maybe somewhat less obviously incorrect, but still incorrect. Passwords can be phished easily, are managed by users, etc.

comment 4y ago · link · parent

The issue is that no one is taking responsibility for writing safe software. Compliance / regulation isn't, developers aren't either.

comment 4y ago · link · parent

The most common for companies to have/ be required to have.

> I've worked in defense and there are stringent security requirements for applications and servers.

Like? FEDRAMP? The vast majority of compliance is about threat modeling and access controls.

comment 4y ago · link · parent

Cool, so everyone can just ignore you then, since this is entirely incorrect.

comment 4y ago · link · parent

The most common policy will be for SOC2, ISO27001. There's virtually nothing about software security in there, other than scanning for vulnerabilities. Everything else is about controls on infrastructure, threat modeling, that sort of thing.

It's not really relevant.

Besides, none of those have to do with software engineers. Compliance doesn't imply any individual responsibility.

comment 4y ago · link · parent

We license people to drive and have a legal system for dealing with irresponsible drivers.

comment 4y ago · link · parent

> You don't have to use a memory unsafe language, but others might.

And we're telling them they shouldn't.

comment 4y ago · link · parent

Doesn't even make sense. The Ministry of Truth is tasked with rewriting the past to match the present.

comment 4y ago · link · parent

RAII is built into Rust. DI is trivial and I use it all the time, idk what you're trying to say there. Graphs require Rc, backreferences are trivial with Rc::weak.

idk what tot ell you

comment 4y ago · link · parent

Tony Hoare stated that language creators should be responsible for the bugs that users of those languages create. Is Tony Hoare a rust evangelist, or a "moral crusader" ?

comment 4y ago · link · parent

I'm experienced in security and rust and I agree with mjg. I've probably written 100s of thousands of lines of Rust, and I've been in security for well over a decade.

None of what you said is even true, all of those patterns are trivial, except "back-references" which are very slightly non-trivial.

And none of it is relevant. We don't need another memory unsafe language. It's fine if it's a toy, but this obviously isn't. It causes real harm.

comment 4y ago · link · parent

????

Whatever that means lol

You mean the borrow checker? People are working on formally proving that, and have already done so for large subsets of the language.

1
464748
164