News for hackers. Stuff that matters.
Re:Backdooring Rust crates for fun and profit by mikepurvis on Thursday November 18, 2021 @11:44AM (#29267463)
I feel like "single shared namespace" works best when the ecosystem is managed collaboratively, with a clear leadership to make calls on who gets what name— for example, something like a Linux distro, where there are Replaces/Provides metadata specifically to facilitate these kinds of transitions and avoid being stuck forever with crappy legacy nonsense.

But this doesn't work at all in a free-for-all environment like PyPI, NPM, or Crates, where anyone can just grab a name and then have it in perpetuity.

IMO the Docker ecosystem got this right, with baking in a domain name as part of the container, and insisting that everyone on docker.io use a vendor/product convention. This meant that the toplevel namespace was reserved for them to offer (or delegate the offering of) specific blessed container images, much more in line with how distro packaging might work.

    # Get the "official" image, whatever that means (but you trust Docker Inc, so yay).
    docker pull nginx

    # Get an image supplied by a specific vendor.
    docker pull bitnami/nginx

    # Get an image from a different server altogether; maybe it's your company, or you don't trust Docker Inc after all?
    docker pull quay.io/jitesoft/nginx
Maybe the big-flat-namespace thing is still a years-later reaction against huge and unnecessary hierarchies in Java land? I think the ideal is not to permit infinite depth, but perhaps to insist on 2-3 levels.
Re:Backdooring Rust crates for fun and profit by roywashere on Thursday November 18, 2021 @12:45PM (#29268240)
Similarly, Perl has CPAN and system where if a module is unmaintained and the author unresponsive, new maintainers can be granted permission by admins to take over. This ensures the namespace is preserved, peoples dependencies keep getting updated.
Re:Backdooring Rust crates for fun and profit by cutemonster on Friday November 19, 2021 @05:07PM (#29283217)
> peoples dependencies keep getting updated.

Updated maybe with malware sometimes? Is it unbelievable that the admins sometimes would hand over an inactive module to the wrong person?

Maybe Perl is a less interesting target than npm so it works (so far) for them?

Re:Backdooring Rust crates for fun and profit by kbenson on Thursday November 18, 2021 @11:51AM (#29267559)
It's worth noting that this behavior is also a sticking point with some users and distros, and I believe was at least part of the reasoning behind podman being developed by Red Hat.

Sometimes you don't want some third party controlling and blessing what's okay, you want to explicitly control that by only allowing sources you control so you can't even accidentally use that third party.

Different groups have different use cases and it's hard to support them all well.

Re:Backdooring Rust crates for fun and profit by mikepurvis on Thursday November 18, 2021 @12:05PM (#29267736)
I definitely see both of sides of it— on the one hand, it's nice that "docker pull nginx" is always shorthand for "docker pull docker.io/_/nginx" and whether or not it is isn't dependent on some config file somewhere telling you what your primary registry is. We solved this for ourselves internally by just always using fully qualified names (containers.corp.com/foo) and not worrying too much about it.

But I can also see how this is absolutely a power grab by Docker Inc. For a company which has given away almost everything and has basically no moat in terms of technology, ecosystem, or thought-leadership, I can understand them wanting to at least retain the final say on which containers are which.

And of course, given that perspective, it's clear why a company like Red Hat would chafe against this, particularly when it's clear from the architectural differences in Podman (daemonless, rootless) that they were looking for an excuse to do it over anyway.

Re:Backdooring Rust crates for fun and profit by marcosdumay on Thursday November 18, 2021 @12:48PM (#29268265)
You mean you want to override or replace the global name registry?

I can't imagine that getting any harder by the global vs. scoped name distinction. It's just an extra feature.

Re:Backdooring Rust crates for fun and profit by kbenson on Thursday November 18, 2021 @01:53PM (#29269022)
It's a feature docker refused to implement, and is one of the reasons Red Hat created podman, which is a drop in docker replacement (you can alias it to docker for the most part), but it allows full control over what repos are checked.

For docker, as I understand it to get something functionally similar you have to define a mirror for docker.io that's not really a mirror and then prefer that mirror and/or disallow traffic to docker.io in some fashion.

Re:Backdooring Rust crates for fun and profit by infogulch on Thursday November 18, 2021 @04:27PM (#29270809)
I've heard this argument a million times, but I really don't get it. If you want to control which images are deployed, you want to be running your own image registry anyway. So you already have full control: just limit images to ones in your private registry with its fully qualified name. Why do you also insist on being able to deploy with 'short' names? Arguably it's better because users can't confuse "enterprise customized ubuntu:20.04" with the public one and bother open source maintainers with internal issues.
Re:Backdooring Rust crates for fun and profit by kbenson on Thursday November 18, 2021 @05:13PM (#29271312)
Nobody is insisting on being able to deploy with short names (or at least not the people that actually care about this). They are insisting that someone screwing up and using a short name when they shouldn't doesn't go out to a third party that's not explicitly trusted. Making this about short names is completely missing the point.

Requiring docker to be run with a "mirror" which isn't actually a mirror of docker.io and making it use your non-mirror mirror so docker.io can't be reached and everything still works is just a hacky way to trick docker into working in what many people think is a very valid way - where no external resources can be used as a container not just as a matter of policy, but as a matter of capability.

Put simply, it's not about replacing the default repo, it's about excluding all external repos. Requiring they all use long names would be a perfectly acceptable trade off for most orgs I think, if that was an option offered.

Re:Backdooring Rust crates for fun and profit by infogulch on Thursday November 18, 2021 @06:55PM (#29272159)
Ah thanks for clarifying. I think this issue gets muddled by people who do want to override the default repo to get short names, to which I roll my eyes. But it seems there is a real issue in that this:

> just limit images to ones in your private registry

... is actually not possible for a basic docker install. (Every time I use the word "just" it turns on me, and this is not an exception.) There are some implementations that have this feature (k8s, podman, etc), but the fact that it's not possible in the industry default container solution is an issue.

Re:Backdooring Rust crates for fun and profit by dmurray on Thursday November 18, 2021 @12:03PM (#29267711)
Github generally has two levels (organization and repository) which works pretty well.
Re:Backdooring Rust crates for fun and profit by hollerith on Thursday November 18, 2021 @03:28PM (#29270070)
It works pretty well, but might not if making org2/repo55 a copy of org1/repo55 (i.e., forking) weren't free for the user (namely, org2) and maybe a venture-backed startup can afford to keep it free for the user, but a non-profit cannot.
Re:Backdooring Rust crates for fun and profit by xfer on Friday November 19, 2021 @12:09AM (#29274033)
Forking doesn't cost github anything it's a git branch of parent repo. That's why you could see people accessing youtube-dl via a commit hash of github dmca repo.
Re:Backdooring Rust crates for fun and profit by krinchan on Thursday November 18, 2021 @02:11PM (#29269216)
I feel like namespaces came much later than Docker Hub, but I can’t really find a good historical record of docker registry features (or at least easily searchable ones). The global namespace was either forcibly cleaned or delegated to who was currently publishing them and projects raised issues if that wasn’t them. I vaguely remember annoyance that I had to publish my toy containers to the global namespace. I could be wrong though.
Re:Backdooring Rust crates for fun and profit by mikepurvis on Thursday November 18, 2021 @03:21PM (#29269995)
So per [1] it looks like Docker Hub launched in mid-2014. Admittedly my earliest pushes to there are more like the late-2015 timeframe, but definitely by that point I was pushing to namespace under my username. My impression had always been that the structure of Docker Hub was meant to mirror Github in terms of an org/repo scheme.

[1]: https://www.docker.com/blog/announcing-docker-hub-and-offici...