3 ms·
There's actually another possible approach to blocking SolarWinds style hacks that doesn't require pervasive sandboxing. Sandboxing is very hard with the curren
by mike_hearn 3y ago
There's actually another possible approach to blocking SolarWinds style hacks that doesn't require pervasive sandboxing. Sandboxing is very hard with the current set of primitives operating systems expose, e.g. macOS doesn't expose low level sandboxing primitives as a documented API at all, Windows barely has a sandboxing API, Linux has several but they're all extremely low level and complicated.
That other approach is to rely on confidential computing technologies, in particular, the remote attestation capabilities of Intel SGX and AMD SEV. These technologies are often associated with DRM or multi-party computation, but they can be used in a different way. In this alternative use case you statically attach a remote attestation to a piece of data as a signature of computation.
A signature of computation is a proof that a piece of data was derived by running a specific program with a specific input. If that program is deterministic, and has been verified by yourself or a third party, then it means the correctness of the transform can be mechanically verified in such a way that it's much harder to hack. In particular if you use SGX then root exploits on the machine doing the computation won't help the attacker due to the hardware level protections. If you use SEV it's harder but can AFAIK still be done with some specialized OS hacking.
Concretely this means that a shipped software artifact could come with a signature proving not only the identity of the developers, as is the case today, but that those files were produced using a known third party compiler and linker applied to e.g. a source tree at a specific git commit hash. Because those files can be verified by anyone including the developers themselves, it means that a compromised CI system is very limited in what it can do: every file has a cryptographic proof tracing it backwards to the input source tree, which in turn is replicated independently on developer's workstations and laptops so it can be checked by many semi-independent actors. And for extra value the company can hire a third party auditor who verifies that the source code at hash X does in fact meet the vendor's description of what it does.
I've experimented with this sort of approach in the past, but unfortunately CC as a tech gets sort of repeatedly stuck in the domain gap between low level systems programmers and the kind of wideband ecosystem building you need to deliver genuine business value. People aren't aware of what it can do or how to use it.
Also, this approach has a subtle side effect: it means the compiler is now a valid target for attack. For example if source code can corrupt compiler internals sufficiently to inject code, then you could potentially cause a miscompile that invalidates the proof. One solution for that is to use memory-safe compilers but the only one I know of is Graal.
- mlinksva 3y agoInteresting. I presume harder to tamper with (due to CC) attestation wouldn't help if the developer were compromised/had ill intent/wrote an exploitable bug, while sandboxing or other confinement might (depending on the malware/exploit, and coarseness/robustness of the confinement), so they are complements? (I'm not sure whether SolarWinds involved any malware or unintended vulnerabilities, from my casual reading it seems to have been a bunch of different attacks...in any case, these supply chain attacks/vulnerabilities exist whether they were used in SW or not...I'm just always slightly uncertain by what is meant by SW-style; not a criticsm of this comment, just laying out my ignorance!) Re memory-safe compilers, is Graal the known one because it is (I guess it must be given the claim) pure Java? As opposed to relying on eg LLVM or GCC which are heaps of C and C++.
- mike_hearn 3y agoRe: Graal, yes exactly. Yes attestation has to attest to the execution of a program and there's no program that can tell you the developer was competent/honest/not compromised. But what it can do is, for example, tell you that a build was done in a clean and verified environment i.e. one free of attackers/malware. And importantly this guarantee can be made also considering the cloud vendor as an attacker. Think about how horrific it'd be if an attacker got privileged access to AWS or GitHub Actions, for example.
- mlinksva 3y agoIndeed, thanks for explaining. Oh, and your mention of Graal reminds me of reading here 56 days ago that it has some support (JavaScript-only at that time) for sandboxing itsself https://news.ycombinator.com/item?id=37572536 https://news.ycombinator.com/item?id=37572536 presumably not nearly as fine-grained as capability-based schemes mentioned in the OP, but still a useful step perhaps.
- mike_hearn 3y agoIt's actually usable as a capability system. You can just run code in a context without permissions and then pass in cap objects that are exposed to that context.