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

Are you 'locked in' to intel because of AVX? The cost of moving is recompiling your binary.

comment 4y ago · link · parent

But... why? Why would they do that? Like why would they go so out of their way not to mention Rust, to the extent that they would discuss borrowing in LISP or C++?

That's insanity.

comment 4y ago · link · parent

There are some optimizations in the JVM that will improve cache coherence. Bump allocation helps, inlining and escape analysis help, etc.

In theory the GC can also rearrange memory to 'compact' it. I'm not aware of this optimization in practice.

comment 4y ago · link · parent

But aspects of their OS are clearly intrinsically related to Rust. Like system calls that you can borrow across.

comment 4y ago · link · parent

> They must be applications with extremely bad design causing super low cache hits.

So basically any program written in a language with pointer types exclusively.

comment 4y ago · link · parent

I don't get your point. They had goals and chose technologies and approaches to achieve those goals. They cite their task model - would you call that some sort of 'task evangelism'? They cite that system calls in their OS are synchronous, and how that enables some optimizations that work well with Rust's borrow checker.

All of this works together and feels relevant.

comment 4y ago · link · parent

They explicitly justify the lack of solutions for memory safety in their space - both in terms of hardware and software - and why they are building their product using specific tools. They even note that this may seem like a strange choice (as opposed to using something off the shelf) but that they were willing and able to invest in these tools, specifically that they were going to build pretty much everything from scratch.

They even call the project 'Hubris' as a joke about the ambition.

Further, they discuss how borrow checking as a model lends itself to the task architecture. It's obviously very relevant.

It seems silly to call this evangelism as opposed to a very self-aware deep dive into their choices.

comment 4y ago · link · parent

I'd be interested in hearing more about the specific for some of these, but others seem unlikely to work.

For example, there's no reason for a user to have read, let alone write, access to authorized_keys.

Read and write access for users is way overly permissive by default, but it's really easy to fix that.

I do agree that you can't trust the shell if a user is compromised though. But this is about preventing an attacker from gaining root access, which means you now can't trust the entire system (since they can just shut off security controls).

Also keep in mind that all of these described attacks require performing auditable actions. If an attacker can trivially, quickly escalate, you can't trust your auditing.

comment 4y ago · link · parent

Sorry, I'm still not understanding your attack. As a user on the system, which files are you writing to exactly in order to execute this attack you've described?

comment 4y ago · link · parent

So the next obfuscation technique would be to encode strings using a low entropy encoding, yeah?

comment 4y ago · link · parent

Copying the data before the FFI boundary would have done absolutely nothing to prevent this bug or make it any less difficult to exploit tho

comment 4y ago · link · parent

I'm not sure I understand this attack. You're some process under a uid, say 1000. I SSH into the box and get a shell at uid 1000.

You're describing an attack where you configure my terminal to use a wrapper script? What exactly does that entail?

comment 4y ago · link · parent

Yeah but you can harden against that. You can:

1. Audit writes to paths like bashrc (I've written this alert and many others like it)

2. Audit writes from processes under uid X to files in uid Y's home

3. Limit the need to sudo in the first place

4. Add a TOTP auth to sudo

5. Limit the ability for arbitrary processes to write to arbitrary files (containerize your shells, services, etc).

The thing is that all of the above assume the attacker isn't already root. If the attacker is root, this all becomes a lot harder.

comment 4y ago · link · parent

It really depends. There's honestly a really big difference between user and root on Linux, so handing root over is probably not ideal. That said, how you deal with this is up to you and very specific to your infrastructure and security posture.

For example, the obvious question is probably "why is anyone sudo'ing". A lot of operational capabilities don't need sudo. Some do.

Rather than handing over passwordless sudo, you can provide binaries that can execute with the required permissions but provide a much more granular interface. For example, if you need to take a memory dump of a service the binary could be set up to only allow that capability and to only work on a set of services.

Further, you may want to audit sudo access but allow it. If you remove the need for root capabilities for engineering purposes you should see sudo very rarely and be able to alert on that - but obviously this assumes you have an instrumentaiton pipeline set up.

Speaking of instrumentation, it's one of the major reasons why you don't want to just hand root over. An attacker with root can more or less just turn instrumentation off. An attacker without root is auditable.

For your specific situation your current security posture could be fine. For a large company they may want to do more.

The tl;dr is really that, yeah, on some default Linux system where you assume an attacker is executing within your user already, a password on sudo isn't gonna help much. But obviously you should harden that server, and a big part of that is going to be "how do I keep the attacker from getting root".

comment 4y ago · link · parent

Slack has no concept of a hard delete. There's always a record, as far as I know.

So yes, you'll want to: 1. Delete the message 2. Revoke the token 3. Notify the user/ security operations team

comment 4y ago · link · parent

The very first thing you would do is audit for 'unsafe' though.

comment 4y ago · link · parent

I would guess that a huge part of C's popularity is UNIX. I think a number of other languages could have easily competed in the other areas ie: thin abstraction.

comment 4y ago · link · parent

I missed where it said he didn't have a lawyer?

comment 4y ago · link · parent

Sure, though I'm planning to write it in Rust so if you're not an engineer it may be a bit rough. Will reply on Linkedin though.

comment 4y ago · link · parent

Absolutely. I know lots of companies have rolled their own. I'm unaware of a public one. I've been meaning to write one myself, maybe I'll do that this weekend.

comment 4y ago · link · parent

> Given the factors involved (private ownership of language resources, complex runtime putting minimum requirements on hardware, etc.), C and C++ might be the only two paths of least resistance for a critical era of the software industry.

Maybe! We'll never know. I just don't think that rewriting history to be "C people were doers" is giving any meaningful context to language development, or how much was getting done in languages that were significantly safer.

comment 4y ago · link · parent

> Is that (creds) considered safe/secure these days?

No, definitely not. It's just super convenient and happens all the time at every organization.

The most recent Twitter breach involved a credential shared in a Slack channel. Security teams have a hard time monitoring Slack and the default settings are pretty bad (infinite session length, infinite message retention).

comment 4y ago · link · parent

The small image problem seems like it may be best solved through volumes.

Consider that busybox is just under 1MB when dynamically linked and installed. That's roughly 50% larger than a distroless container.

Further, distroless doesn't just target size for size's sake - it's also to ensure that an attacker in the container doesn't have tooling that they like to use.

Instead if your containers are mounting a volume, say `/var/run/debug-tools/`, you could copy the tools into that mount before entering your containers. This probably has a good dev UX in that you can enter containers and have your tools, it amortizes the cost across your containers on a given host, and it isn't container specific ie: you perform one copy and now all containers on that host have it.

comment 4y ago · link · parent

Lots of bugs aren't particularly exploitable. As Tavis notes, one of the major problems here is that there's a structure containing function pointers adjacent to the buffer.

If all you have is a stack overflow you may have your work cut out for you.

Further, while this bug may exist, assertions elsewhere could have meant it was unexploitable. So in isolation it's an overflow but in context it's not reachable. That didn't happen here. This happens a lot actually.

comment 4y ago · link · parent

> The same thing would happen in Rust if you tried to pass a chunk of memory to C.

In an 'unsafe' block.

comment 4y ago · link · parent

Frankly it's a bit hard to untangle your point from the way you write. Something to consider.

> and profoundly misunderstood history.

There seems to be a good deal of that.

> They didn't know better.

For what it's worth, we always knew better with C and C++. As I mentioned elsewhere languages were often designed to be safer but as C became more popular the design mistakes of C were pushed on other languages. You can look at FORTRAN, Algol, etc, to see that compiler writers took measures to ensure certain bug classes weren't possible, and those languages were overtaken by those who wanted their code to just compile, correct or not.

Your post definitely comes across as very preachy, so it's odd that you say you were trying to "avoid the immature shouty part" - that's what the parent was basically criticizing you for.

And then to end it on the implication, once again, that some people are "doers" while the rest of us are just posting on HN (the same thing you are doing????) kinda exemplifies it.

comment 4y ago · link · parent

Lots of credentials end up getting shared over slack. If you own slack you probably own a few other systems.

Also, extortion. I'm always amazed at what people will say over Slack DMs, seemingly not realizing that it all is accessible by the company.

comment 4y ago · link · parent

Having a lawyer doesn't mean you can just not answer questions when subpoenad. "Don't talk to cops" is complicated.
1
727374
164