This article is nonsense. Privileged ports are a security feature. They have literally nothing to do with mainframes. On multi-user systems, they're incredibly important because they give external clients confidence that the services provided on them are authorized by the system and not just by any user -- some of whom may not be as trustworthy as others. Most systems in this era of cheap hardware are single user, BUT NOT ALL SYSTEMS. It's fine for Windows and Mac OS to do without them and it's fine to configure your own Linux system to disable them if that's what you want, but it's completely insane to argue that they're a security flaw because some people work around them using insecure practices. There are plenty of secure ways to work around them, most obviously by USING A NON-PRIVILEGED PORT. Start your service on port 8080, for example, and give out a URL like http://example.com:8080/path. It's really that simple. Take the time to understand the actual purpose of a feature before urging others to abolish it.
> Most systems in this era of cheap hardware are single user, BUT NOT ALL SYSTEMS
OP quite clearly argues that multi-user systems can still have the old behavior if they so choose with explicit configuration. OP makes an argument about what should be the sensible default in 2022, and who should do explicit configuration.
I think the point that nowadays easy single user linux configuration should be preferred over multi-user configurations is good.
IMO distros could make this easy by turning privileged ports into an (advanced) installation question. Then the clearly single-user-focused distros would default to 80, and the more server-oriented or conservative distros would default to the current behavior, but both could do which ever.
> Start your service on port 8080, for example.
In the era of Let's Encrypt, this is really about 80 and 443. The background for the OP is probably to host "normal" sites on single user hardware.
If you were to give out to non-technical users addresses like "http://example.org:8080" which then transform into "https://example.org:8443", that's just horrible UX. Those kinds of numbers in the URL probably also look to many people like someone is trying to hack them. Furthermore addresses are also communicated word-of-mouth "go to example dot org".
So no, using unprivileged ports is not an actual workaround for the use cases OP is referring to.
Stop pretending that non-technical users want to run web servers. That's just not a thing. What you're actually arguing is that some technical users are so important that making them tweak a default setting is too much to ask, but others are so insignificant that pulling the rug out from under them after decades of practice is perfectly reasonable. I disagree.
Do you not grasp WHY Let's Encrypt requires port 80 (for one particular challenge type)? Think about that for just one second. Okay I'll spell it out for you: the convention that ports under 1024 are privileged gives Let's Encrypt some confidence that privileged ports runs services sanctioned by the system administrator and not some tenant -- which is exactly the point I was making. So thanks for providing more support for my argument, I guess?
And while we're at it, can we stop pretending you care about user experience? You can't even be bothered to type those two words! You cite no studies and make no technical arguments. All you're offering is the claim that the default you prefer "should be preferred" based on your intuition.
I probably shouldn't even dignify your claim that people think port numbers in URLs mean they're being attacked with a response, but I'll bite. Do you have even a shred of evidence for this claim or did you just make it up on the spot? Obviously the latter, but if even if it were true the solution would be to educate people about what port numbers mean. Unless you want to argue that any feature of any internet service some people are confused about should be abolished? I guess we'll have to shut the entire internet down.
Changing the port number is a perfectly reasonable solution for many use cases, but it's far from the only option. Alternatives include CAP_NET_BIND_SERVICE, net.ipv4.ip_unprivileged_port_start, port mapping in containers and many more. Pick your favorite and stop wasting everyone's time.
I think you're missing the fact that in your scenario services are started with explicit privileges by init. This has nothing to do with unprivileged login users.
Back in the day, init ran as root. Init ran services as root, and services were responsible for becoming another user if they didn't need root after binding a port. It was a very simple interface.
Nowadays we have much more complicated interfaces and as a result more flexibility. Init (now systemd) must still run as root, but we can tell the component that executes a service to drop privileges before the service is started. These privileges are also more granular: Root is no longer needed to bind to a low port: We only have to grant the CAP_NET_BIND capability, rather than running as a root user.
On top of this we now have network namespaces and containers, so services might be granted their own interfaces visible only to that service, with specific permissions tailored to only that service.
If you are running a persistent webserver you do not need to worry about whether or not unprivileged users can bind to port 443. The webserver is managed by init and the permissions granted to services are explicit and granular -- and typically all this is configured by the distro by default.
>The webserver is managed by init and the permissions granted to services are explicit and granular -- and typically all this is configured by the distro by default.
Only if you're using a web server that's prepackaged by the distro.
If you're installing third party services, and exposing them to the internet, or even local networks, it's not out of line to expect you to know what you're doing. At least enough to turn off the 'dont shoot yourself in the foot' protections
People who "don't know what they're doing" will just disable SELinux if it's too difficult to configure the policy that they want. It's better to make security policies easy to configure correctly so that more people do it correctly.
Also, what does "third party" really mean in this context? I am neither the author of the Linux distro that I'm using nor the web server that I want to use. It's all third party software from my point of view.
You need some level of expertise to turn off selinux, or even know what it is. They know what they're doing enough to know the consequences if they can turn it off.
By third party, i mean stuff not in the distro. It's extra effort to install something else. You're likely to have at least a link to docs in your face when you went and got the binaries.
I don't think this is true in general. For example, in one instance I wanted to use caddy, which wasn't packaged for CentOS at the time. I don't think I had trouble getting it to run as a non-root user, but getting it to work with SELinux was a big PITA.
The Linux community seems to have a pervasive "if you're doing X then you should be able to Y" kind of attitude. But sometimes you just need to do X, and you know what you know.
This was covered in the article, albeit a little sarcastically:
>And for the three folks in Finland who administer multi-user Linux instances and rely on privileged ports for their mainframe-era security properties, they can always run sysctl and set their port limit to 1024 as it was before.
If you wanted to block non-root users binding certain ports, you'd still be able to do so. It just doesn't make sense to have this as the default anymore, as it tends to cause more security issues that it prevents.
No one has yet provided evidence that privileged ports create even a single security issue. While there's lots of huffing and puffing in the original article (including someone confusing privileged ports with IP based authentication, which is effectively dead), the closest it gets is to say that dropping privileges in a server is a pain. And then they go on to show off a one line configuration change that would disable privileged ports system wide. So do that if it makes sense for you.
What doesn't make sense would be to abandon decades of practice that real people (more than three in Finland, actually) rely upon because some people are too lazy to make a trivial change to their systems. And let's get real: 99.9% of people are never going to want to run a web server on their computers. You're just arguing that your portion of that 0.1% -- let's be a LITTLE sarcastic and call them five penguins in Antarctica! -- are more important than the rest.
One example I can think of is a local server handling some sensitive stuff. E.g. a webserver for a CNC machine that takes a password to log in. If that webserver is offline another user could start their own webserver with a fake login prompt. Other users who go to http://localhost as usual would not notice.
> It's fine for Windows and Mac OS to do without them and it's fine to configure your own Linux system to disable them if that's what you want, but it's completely insane to argue that they're a security flaw because some people work around them using insecure practices.
I guess we will also be making distros with `sudo` without a password to stop some people writing insecure scripts that try to pass it via plaintext stdin. This should be default for _every_ Linux system because some Linux server admins copy insecure code from StackOverflow. /s
Agreed. In the HPC and research space large multi user systems are still king.
It's quite common for users to stand up their own versions of privileged services on unprivileged ports. Bad actors aside, this prevents users from accidentally mimicking a service that would effectively break shared resources. These are nice guardrails.
Security and guardrails should be optional, but it should be opt out, not opt in.
Right, that's the way it should be done for ports that try to listen to non-local connections. That would actually strongly increase security, as non-privileged ports can be abused a lot too.
They did, it's called 1025-65535. This is literally ancient tech. There are more modern (and perhaps more granular) ways to do it today with cgroups and nftables I'm sure.
I myself am an avid SElinux user and I know for sure you can restrict ports to user roles there.
Did you... actually read the article this comment responded to? Or even the comment you're replying to? The original article proposed making all ports non-privileged because most systems serve a single user in practice. Are you really going to argue that changing the port to 8080 is insecure because someone could snipe it but making all ports non-privileged is better because... now someone can snipe 80 as well?
I agree with the article that privileged ports is a bad idea. I disagree that making them free for all, or using a free-for-all port is a good solution. You propose it as a simple solution but it has many issues.
Hello. I read your email to Tim Cook with interest and I sympathize with the plight of your company. But I wish you would treat other platforms with more respect.
To be clear, I'm glad you enjoy Apple products and I'm not trying to talk you out of that -- as if that were possible. But I do want you to understand that my experience with them is different than yours. Apple products don't delight me. I've tried them. Every time an iOS device ends up in my hands (something that happens way too often, including earlier today) it's a frustrating experience. They feel cold, uncaring and limited. Android has moved in this direction, getting more polished but less delightful over the years, but it's still a better experience for me.
Again, I'm not saying your feelings about Apple products aren't valid. They certainly are. I'm glad you've shared them and I admire your efforts to support the iOS platform. I just wish you respected people like me who don't experience technology the same way you do. I'm glad that iOS and Android products both exist in the market. There are audiences for both -- and then some.
And as for the web, we will have to agree to disagree. Not only do I think it's not dead, I don't think it will ever be dead. That's not something I'd say about either iOS or Android. The web can't go out of business or get bought. Anything it's missing can be added. The first web browser didn't support images! On the other side, it wasn't too long ago that people thought Blackberry was here to stay.
Clearly there are many features iOS and Android offer that are difficult to match with the web. For now. Clearly the development tools are more convenient than those available for the web. But there is one feature of the web that other platforms will never be able to match: it belongs to all of us. No one has to take a 30% cut of your revenue. No one gets to decide what you can and cannot make available. In your letter to Tim Cook you make it clear that you made use of that advantage yourself, even if you don't seem grateful. Freedom always comes at a price and it's up to you to decide whether it's a price worth paying. If it's not then develop for the platform you prefer. But please remember that there are people like me who think differently.
Consider that he tailored his message for the recipient, as most anyone would do.
Imagine if you had spent years (maybe you have, I don't know you) building an app and a business for a platform you love only to have it snatched away.
Wouldn't it bring out strong emotion and cause you to want to appeal to them in the same way?
This is exactly right. This email was never meant for public consumption, although I am glad it's out now in case it may change things for others. I do love native mobile experiences, and especially iOS. Keep in mind, Android has come a very long way to close the gap in the last 6 years. I may have dismissed other platforms too quickly, but I also believe that I would not have been able to build the products I did without this singular focus / passion. It was an iOS recommendation app, in my opinion the only way to make a great product for that is to be on the native platform.