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

So why publish to PyPI? I have tons of personal projects that never leave my laptop, or, at most, github.

comment 4y ago · link · parent

These weaknesses are implementation specific. FIDO2/U2F is unphishable, requires proof of presence, and is a significant security win over a strong password.

comment 4y ago · link · parent

I assume/ hope that this is PyPI's first step in rolling out mandatory 2FA? Otherwise the whole "you're critical so you have to enable it" seems a bit silly in that you're going to have developers who get critical decide they don't want to do this, and at that point pull packages/ stop maintaining.

Just having a 2FA requirement from the start (or some grace period like 7 days) seems like the way to do it.

comment 4y ago · link · parent

> we will have fewer open source maintainers.

That isn't necessarily a bad thing. I would be happy to lose every developer who is unwilling to enable 2FA. I am glad to see that that's what happened here. The developer has no responsibility to maintain their code, and PyPI has no responsibility to let them publish their code. Both sides discussed this and an agreement was reached - the developer will no longer publish their code to PyPI.

No one acted maliciously. Everyone wins.

comment 4y ago · link · parent

That sounds like a best of both worlds. PyPI sets a minimum bar for developer responsibility and you can opt out of publishing to PyPI if you don't want to be that responsible.

The system works.

comment 4y ago · link · parent

It'd be nice if there were a tool you could run over your code that did this sort of thing. Even if it can technically break shit in absurd cases, I'd totally run it on my code, which isn't absurd.

comment 4y ago · link · parent

That's interesting. Thanks.

comment 4y ago · link · parent

My bad, thanks for clarifying.

comment 4y ago · link · parent

Also "what is equals?". That's why people will do:

    def fooer(i: str, strings: list[str]):
        push = str.append
        for s in strings:
            push(i, s)
Apparently this helps the interpreter understand that `append` is not getting overwritten in the global scope elsewhere.

comment 4y ago · link · parent

https://github.com/mypyc/mypyc

> Mypyc compiles Python modules to C extensions. It uses standard Python type hints to generate fast code. Mypyc uses mypy to perform type checking and type inference.

comment 4y ago · link · parent

> Because it's developed and maintained by volunteers

Who is working on python voluntarily? I would assume that, like the Linux kernel, the main contributors are highly paid. Certainly, having worked at Dropbox, I can attest to at least some of them being highly paid.

comment 4y ago · link · parent

Guido stepping away from the language will have a lot of impact on changes that were culturally guided.

comment 4y ago · link · parent

It's not extremely uncommon to find "assembly pushed together by perl" tbh

comment 4y ago · link · parent

The threat model is that I want to deploy ebpf programs to my base amis and let devs load them as-needed without root, basically.

comment 4y ago · link · parent

It would if you're talking about arbitrary classes of bugs.

comment 4y ago · link · parent

It's a good example of C forcing impossible tradeoffs. "Either use software that's old and has known bugs or update and get all of the new ones".

comment 4y ago · link · parent

Rust is newish, so it just wasn't an option. Haskell carries a heavy runtime around so it's not suitable for a lot of environments, nor is it easy (possible?) to package as a dynamic library.

But yeah, for new projects, choose memory safe languages.

comment 4y ago · link · parent

Anyone know what the status is for enforcing signed eBPF programs?

comment 4y ago · link · parent

I wouldn't expect HTTPS to make any difference vs HTTP for long lived connections.

comment 4y ago · link · parent

It means that a program has been verified against a model, and properties of that model are held true.

What it does not mean is that the program is bug free. That would, of course, violate the halting problem, or its generalization Rice's Theorem - non-trivial programs can not have arbitrary properties proven about them.

There's also Gödel's Incompleteness Theorem, obviously, as well as the fact that a proof is only as good as its model.

comment 4y ago · link · parent

As far as I am aware, the capability required to exploit Meltdown is compute and timers. For example, an attacker running a binary directly on the host, or a VM/interpreter (js, wasm, python, etc) executing the attacker's code that exposes a timer in some way.

If you just have a dumb "request/response" service you may not have to worry.

A database is an interesting case. Scylla uses CQL, which is a very limited language compared to something like javascript or SQL - there's no way to loop as far as I know, for example. I would probably recommend not exposing your database directly to an attacker anyways, that seems like a niche scenario.

If you're just providing, say, a gRPC API that takes some arguments, places them (safely) into a Scylla query, and gives you some result, I don't think any of those mitigations are necessary and you'll probably see a really nice win if you disable them.

This is my understanding as a security professional who is not an expert on those attacks, because I frankly don't have the time. I'll defer to someone who has done the work.

Separately, (quoting the article)

> Let's suppose, on the one hand, that you have a multi-user system that relies solely on Linux user permissions and namespaces to establish security boundaries. You should probably leave the mitigations enabled for that system.

Please don't ever rely on Linux user permissions/namespaces for a multi-tenant system. It is not even close to being sufficient, with or without those mitigations. It might be OK in situations where you also have strong auth (like ssh with fido2 mfa) but if your scenario is "run untrusted code" you can't trust the kernel to do isolationl

> On the other hand, suppose you are running an API server all by itself on a single purpose EC2 instance. Let's also assume that it doesn't run untrusted code, and that the instance uses Nitro Enclaves to protect extra sensitive information. If the instance is the security boundary and the Nitro Enclave provides defense in depth, then does that put mitigations=off back on the table?

Yeah that seems fine.

> Most people don't disable Spectre mitigations, so solutions that work with them enabled are important. I am not 100% sure that all of the mitigation overhead comes from syscalls,

This has been my experience and, based on how the mitigation works, I think that's going to be the case. The mitigations have been pretty brutal for syscalls - though I think the blame should fall on intel, not the mitigation that has had to be placed on top of their mistake.

Presumably io_uring is the solution, although that has its own security issues... like an entirely new syscall interface with its own bugs, lack of auditing, no ability to seccomp io_uring calls, no meaningful LSM hooks, etc. It'll be a while before I'm comfortable exposing io_uring to untrusted code.

comment 4y ago · link · parent

Also, P. https://www.microsoft.com/en-us/research/blog/p-programming-...

> P got its start in Microsoft software development when it was used to ship the USB 3.0 drivers in Windows 8.1 and Windows Phone

comment 4y ago · link · parent

No amount of formal verification stops you from writing buggy code.

comment 4y ago · link · parent

Thanks. I'll have to do some googling on that.

comment 4y ago · link · parent

CI is RCE. You want to make sure you're keeping control over that.

comment 4y ago · link · parent

I realize there are a million ways to leak addresses, but in theory is a private ipv6 space brute forceable? ie: I have every service listen on a port on some IP, they all discover each other through some specific channel (like dns). Assuming the attacker doesn't have access to that channel, they would have to start scanning every ip to try to discover services, yeah?

comment 4y ago · link · parent

The overhead of atomics is almost (if not entirely?) exclusively with regards to managing the caches in the CPU. Otherwise they're just normal bytes. Your CPU already has to do some cache management with regular bytes, so an atomic is only worse if there's contention (because that forces a flush).

The worst case for an atomic write is two additional cache line flushes, iirc.

comment 4y ago · link · parent

> and if you’re not, why use a mutex?

Because it's an incredibly efficient, safe option for doing so. Lots of shared state is rarely contended. For example, imagine you have a 'Config' that gets updated periodically in the background, readers of that config only check for updates every 1 second, and you have 7 parallel readers (and 1 writer for an 8 core system).

A Mutex is a trivial way to solve that problem that will be extremely efficient.

comment 4y ago · link · parent

The waymo vehicles are much more recent though. All of a sudden they're all over.

comment 4y ago · link · parent

Write some code, listen to the compiler's feedback, don't worry about "good" or "fast", just get things working.
1
383940
164