News for hackers. Stuff that matters.
Re:Symbian Won by qwerty456127 on Thursday June 25, 2020 @09:05AM (#23640226)
> With the latest releases of Android and iOS, we’re back to where we started. Both now prompt you the first time an app asks for access. Both give you regular reminders of which apps may be snaffling your data. Both let you manage access and selectively deny apps.

Every OS should do this, desktop OSes included. For the last 2 decades I've been using personal firewalls on Windows to do just this, now I use LittleSnitch on Mac (I just hope it's going to keep working on ARM macs), AFWall+ and XPrivacy on Android and miss this level of control terribly on Linux (it sort of can be achieved with AppArmor or SELinux but both are nightmares to use).

If only iptables would allow to filter by the executable path and other process parameters - that would be just so awesome. There was such a feature in some 2.x kernel but, sadly, it was deprecated long ago.

Re:Symbian Won by simias on Thursday June 25, 2020 @10:06AM (#23640891)
>if only iptables would allow to filter by the executable path and other process parameters

The problem going down that route is that implementing this opens a huge can of worms. That stuff is easy to spoof, you have to account for thousands of edge cases. It's not for nothing that the answer to "can I know the full path of the binary that was used to spawn <process>?" is generally "it depends" or "it's complicated". And let's not even bring up what happens for interpreters for instance. Parameters are also often easy to spoof and manipulate, although in this case I suppose the kernel could just keep a protected copy of the original parameters for that purpose.

I completely get why you want that though, and it would be a great feature to have indeed, but I also completely understand why kernel devs don't want to touch that with a ten foot pole.

Re:Symbian Won by teknopaul on Thursday June 25, 2020 @10:27AM (#23641129)
I think it's a great idea mosts apps will not want to spoof the firewall. So while it may not be secure, it would be very helpful for user controlled privacy.
Re:Symbian Won by jfrunyon on Thursday June 25, 2020 @11:59AM (#23642144)
Errr... the general answer to "can I know the full path of the binary that was used to spawn <process>?" is "sure, just `readlink /proc/<process>/exe`".
Re:Symbian Won by saagarjha on Thursday June 25, 2020 @12:24PM (#23642420)
Yeah, until the program deletes itself from disk on launch.
Re:Symbian Won by richardwhiuk on Thursday June 25, 2020 @01:37PM (#23643235)
Or edits that value.
Re:Symbian Won by canada_dry on Thursday June 25, 2020 @10:51AM (#23641417)
> LittleSnitch on Mac... miss this level of control on Linux

This is such a killer app it's hard to believe that only recently a linux variation has been developed...

https://github.com/gustavo-iniguez-goya/opensnitch (the original by evilsocket seems to have been abandoned).

Re:Symbian Won by roel_v on Thursday June 25, 2020 @09:32AM (#23640508)
I do that too, out of interest, but I'm under no illusion it will help me against data exfiltration or protect my privacy. There is lots of software of which you just don't know what it is, or that plain doesn't work when blocked. Some even crashes when their connect() call doesn't immediately succeed. If you do a few weeks of real world work on a machine and then go back through all system processes you allowed, you ask yourself what half of them even are.
Re:Symbian Won by c0l0 on Thursday June 25, 2020 @10:02AM (#23640861)
I respectfully disagree. Because it's an EPIC pain, and it's absolutely hostile towards "average" users.

Back in the Android 5 (or so) days, I knew what permissions an app I was going to install on my mother's phone was going to ask to be granted _once_, and be done with it. Nowadays, an app might ask for some kind of new permission "on first use", and users on mobile are developing the same habit as users of desktop browsers during the dark ages of expired HTTPS certificates and broken Java Applet signatures had developed out of necessity: "default-ack/OK all the things".

The problem is that these days, even very technical people think that you could realistically expect to lie with dogs, and get up without fleas - i.e., install applications and software you cannot trust, and get away without having something bad (like loss of privacy, or maybe exfiltration of data) happen. All thanks to "modern" security constructs like sandboxing.

But that is not going to happen - sandboxes have been shattered and broken in the past, as they will continue to get circumvented in the future. There simply is no replacement for trust (in an application, its developers, its distributor, and its operator (if any)), and there are no technical solutions that could somehow replace it in full.

Yes, you can make it incrementally less bad to have a hostile agent/app on your machine or phone, but the trouble you're trying to prevent that way will never go away completely.

I guess some people just liked to feel "in control" when clicking away their "Norton Professional Antivirus 95 blocked 17 Viruses from damaging your machine today!" messages back in the day, and some apparently cherish clicking "grant 'Sexy FileManager Free Pro' access to your Photos and Videos" today. Personally, I'm actually rather sick of it, and all the security theatre that "modern" application delivery mechanisms like app stores/mobile platforms or stuff like snaps/appimage/younameit would have you participate in. I'd rather trust my distro's package maintainers to not let developers abuse their users, and have a look at the source if I'm in doubt about the upstream's intentions. I know I can't audit everything, but I feel like I'm much better off with that kind of trade-off, than with the non-solution to the problem I tried to describe above.

Edit: Removed a leftover part of a restructured sentence.

Re:Symbian Won by WrtCdEvrydy on Thursday June 25, 2020 @10:50AM (#23641399)
The problem isn't the sandbox, it's inherently the issue with lack of fine grained permissions and being unable to revoke permissions after installation.

Wanna see a real permission model, look at the BB10 Android Player model. After installation, you could revoke permissions and the player would basically act as if the data from that permission was just empty. App asks for contacts, here's an empty contacts list.

Edit: I just did a small hackathon and ended up having to request full BLUETOOTH Access and LOCATION access to connect to a label printer... how is this long term sustainable.

Re:Symbian Won by com2kid on Thursday June 25, 2020 @03:32PM (#23644567)
The reason for location permissions is because BT can track your location through Bluetooth beacons. See https://developer.android.com/guide/topics/connectivity/blue...

This is just Android being transparent. "Bluetooth usage may allow apps to track your location." Which is perfectly true.

There has to be a balance between explaining to the user, e.g. that there are multiple ways their location can be tracked, and permission request overload.

I don't imagine explaining to everyday users the details of the Bluetooth protocol is viable.

Re:Symbian Won by autoexec on Thursday June 25, 2020 @03:49PM (#23644776)
> 'd rather trust my distro's package maintainers to not let developers abuse their users, and have a look at the source if I'm in doubt about the upstream's intentions.

Trusting 3rd parties to decide what you can trust isn't ideal either. It's what Google and (especially) Apple have for mobile apps now. They decide what you can safely install and we're just supposed to trust them. That's clearly not working.

While you have the added benefit of being able to trawl over thousands of lines of code looking for something suspicious, that's not exactly scalable or even possible for the majority of users. In the end, what exactly are you looking for anyway if not signs that an application is making connections or accessing files that it shouldn't. In that respect, it's far better to have the OS just tell users when an application is doing those things (connecting to the internet, reading their personal files, or activating their cameras). The more transparency in what an app is doing the better because the reality is that we cannot trust every app we install. How could we possibly?

Re:Symbian Won by cestith on Thursday June 25, 2020 @11:10AM (#23641613)
> I respectfully disagree. Because it's an EPIC pain, and it's absolutely hostile towards "average" users.

Are you sure you didn't mean "EPOC" pain? Maybe "EPOC32" pain?

;-)

- a Psion owner

Re:Symbian Won by Zenst on Thursday June 25, 2020 @08:43PM (#23647531)
Also if a Series 5 Psion, an early owner of mobile ARM in its younger days.
Re:Symbian Won by edeion on Friday June 26, 2020 @04:15AM (#23649829)
Even though it's sort of an aside, I'm glad someone mentions Psion. I'd love to check whether their keyboards are on par with the legend. I wonder how many others relate, at the global scale :)
Re:Symbian Won by Zenst on Friday June 26, 2020 @03:35PM (#23656040)
For the time, it was good, maybe better mechnisms available now, but darn - it was built to last and my 5MX still works. Though a lot of psions market was retail/stock warehous stuff, their handheld terminals had a huge market. So robust design was key. Only design issue on the 5MX that griped me was the stylus holder spring being not as industrial designed. Apart from that, all works well.

Since then, dreamed of some comparable device, basic linux, enough for vi and terminal stuff, wifi/bluetooth and well, happy with the screen. Alas all devoplment of anything close, tend to wack in CPU's that would be classed as a supercomputer of the 5MX time, power hogging colour screens and you end up with devices that will last a day perhaps, but not the month the 5mx would pull with comparable usage with the rs232 adapter.

Hence a cheap terminal, basic local editor wifi device in that form factor and if it could do bluetooth and double as a keyboard for a smartphone, well, a simple device like that would tick my boxes and maybe many others.

Re:Symbian Won by cestith on Saturday June 27, 2020 @08:21PM (#23665784)
My 3, 3a, 5, and 5MX all still work (as do my Atari Portfolios and HP LX series palmtops, save one 200LX with physically damaged screen. I too keep wanting to see something like the 5Mx, or the PS-1000, or something similar with modern specs. I don't need the screen to be fast, just useful and low power. The 16-color E-Ink screens I keep reading about in Chinese tablets should work. Big battery for the form factor wouldn't hurt, but we used to use AAs. A dual-core or quad-core A53 with all solid-state storage, a nice legible low-power screen, and a great little keyboard would be quite a find.
Re:Symbian Won by icebraining on Saturday June 27, 2020 @07:56PM (#23665678)
I think you have to believe in sandboxes if you use the modern web; each site you load is effectively a program you are running on your machine, with only a sandbox protecting it.
Re:Symbian Won by messe on Thursday June 25, 2020 @09:07AM (#23640246)
> now I use LittleSnitch on Mac (I just hope it's going to keep working on ARM macs)

It should. Kexts are still allowed, for now. They're almost certainly only a couple of releases away from being deprecated though.

Re:Symbian Won by Fnoord on Thursday June 25, 2020 @09:11AM (#23640292)
From the article this HN discussion [1] links to:

"We expect the deprecation to become effective with the next major release of macOS. There’s no official release date from Apple, but based on the release schedule of recent years it will not be before this fall. Little Snitch 4 will then not be loaded by the operating system, but there will still be an option to allow the loading."

Little Snitch 5 (with NKE) requires a new license.

[1] https://news.ycombinator.com/item?id=22677849

Re:Symbian Won by jmull on Thursday June 25, 2020 @10:47AM (#23641360)
> Little Snitch 5 (with NKE) requires a new license.

There is reasonable pricing for upgrades... LS4 bought within a certain time get a free upgrade, older licenses get a reduced price.

Re:Symbian Won by dmd on Thursday June 25, 2020 @09:13AM (#23640314)
Re:Symbian Won by messe on Thursday June 25, 2020 @09:43AM (#23640635)
A WWDC talk confirmed that notarized Kexts will still be allowed, but you'll have to enable that option via MacOS Recovery.
Re:Symbian Won by saagarjha on Thursday June 25, 2020 @12:27PM (#23642452)
As long as they’re using non-deprecated KPIs. Those that are require another trip to Recovery to disable SIP.
Re:Symbian Won by ajross on Thursday June 25, 2020 @09:34AM (#23640533)
> If only iptables would allow to filter by the executable path and other process parameters - that would be just so awesome.

You can do that sort of thing with eBPF these days, either at the network level or via process tracing. It's non-trivial still, though. Lots of the various firwewall automation tools have features like this too. It's definitely a solved problem, but not one with a really clean obvious solution yet.

Re:Symbian Won by Fnoord on Thursday June 25, 2020 @09:08AM (#23640258)
A personal firewall is nothing more or less than a layer-7 firewall which rules you can (somehow) manage as user you are logged in with, with a nice GUI. There is Open Snitch [1] (plus forks/patches) for Linux, if you're after such.

[1] https://www.opensnitch.io

Re:Symbian Won by vetinari on Thursday June 25, 2020 @10:16AM (#23640997)
Editing the rules as a user with a GUI is the easy part. The more difficult parts are in details:

- how do you recognize which applications the packets belongs to? Even if you would get pid in the rules engine (which you normally don't), how do you name it? /proc/$pid/cmdline can be manipulated at will by the process; then you need to recognize additional parameters when you are using applications that run other code, from bash to virtualbox.

- what happens to the connection while the firewall is waiting for the user input in the UI? Linux apps handle long timeouts badly

- what happens to other connections while the firewall is waiting for the user input in the UI? Right now, unfortunately, whey would have to wait too.

- LittleSnitch does interesting heuristic wrt hostname/ip translation - you can get different (or no) hostname via reverse query than the application asked for. You need to monitor what each application is resolving and what answers it get. If you get same IPs for different hostnames for a single application, all bets are off, only application knows which one it connects to (you can eventually learn with DPI, but for that it might be too late). For applications with their own resolvers using DoH/DoT, tough luck.

The first problem could be solved at the level of sandbox runtimes (i.e. flatpak et al), i.e. when you know, that the application is running in the namespace belonging to specific flatpak package, you would present that as that specific application, they cannot lie about that anymore but the price is, that you can handle only sandboxed apps; for scripting and so on you still have to find how to distinguish specific instances. For all the other problems, you would have to figure them out.

Re:Symbian Won by saagarjha on Thursday June 25, 2020 @12:32PM (#23642503)
> how do you recognize which applications the packets belongs to? Even if you would get pid in the rules engine (which you normally don't), how do you name it? /proc/$pid/cmdline can be manipulated at will by the process; then you need to recognize additional parameters when you are using applications that run other code, from bash to virtualbox.

iTerm actually ran into this very issue (using the equivalent macOS APIs) and had to treat it as a security bug because the results were controllable in-process as well. And it also ran into the problem of how to deal with interpreters. It basically ended up being all ripped out and the API was redesigned to require authentication tokens rather than trying to figure out a meaningful source for a process.

Re:Symbian Won by jfrunyon on Thursday June 25, 2020 @12:04PM (#23642219)
/proc/.../exe exists.

ETA: and most Linux apps will just sit there blocking in the syscall, or at the very worst, retry/show an error/crash.

Re:Symbian Won by qwerty456127 on Thursday June 25, 2020 @09:20AM (#23640385)
The page you have linked to won't even open. I have witnessed a number of attempts to replicate LittleSnitch on Linux, none of them went far enough to anything near a usable product quality.

You need to implement at least some functionality on the kernel level (what LitleSnitch does with a kernel extension) for this, most of the people who care about desktop apps on Linux (me included) lack kernel developer skills.

Re:Symbian Won by Fnoord on Thursday June 25, 2020 @10:01AM (#23640851)
True, its not production quality. Here is an actively developed fork/repo of OpenSnitch [1]

[1] https://github.com/gustavo-iniguez-goya/opensnitch

Re:Symbian Won by gus_ on Friday June 26, 2020 @04:13AM (#23649824)
did you try tinysnitch [0], opensnitch fork [1] or Douane [2]?

[1] works pretty well for me.

[0] https://github.com/nathants/tinysnitch [1] https://github.com/gustavo-iniguez-goya/opensnitch [2] https://github.com/Douane/Douane/

Re:Symbian Won by derefr on Thursday June 25, 2020 @11:08AM (#23641591)
One thing I've been wishing for in the mobile OSes, is for them to copy web browsers, and offer a UI to change all these security/privacy permissions for an app quickly from the context of the app, rather than by going into Settings and navigating down to the app (which nobody ever bothers to do, and especially nobody ever bothers to do more than once—so you can't put stuff that'd be useful to change temporarily in there.)

Of course, the naive implementation—giving the app itself control over the system's settings for it—would be a disaster. (I think early iOS had something like that, but quickly got rid of it—right around the time the App Store stopped being so heavily curated.)

I'm suggesting something more like: if you pull up iOS Control Center while an app is open, it'd have either an "app settings" submenu, or merge "app settings" into the view of system settings. Then, within "app settings", you'd have a little privacy-lock, sort of like the one that appears in a browser's address bar—and which would allow you to change very similar things to what clicking said lock allows you to change in a browser: in est, the states of all the system confirmation prompts the app has triggered.

Less on-topic, but contextually-accessible app settings would also allow you to do neat things like provide the ability to set accessibility settings on a per-app basis in an intuitive way, or to start something like Guided Access Mode (https://support.apple.com/en-ca/HT202612) without needing to enable+remember an arcane gesture. I would especially love the idea of being able to change the perceived system font-size/scaling-factor, or the perceived system language/region, on a per-app basis — basically equivalent to Safari's display settings "A" menu. Maybe even a switch to enable that "monochrome to reduce addictiveness" mode, so you can have it on only within social media apps!

Re:Symbian Won by perryizgr8 on Thursday June 25, 2020 @11:55AM (#23642086)
> offer a UI to change all these security/privacy permissions for an app quickly from the context of the app

Isn't this exactly how Android does it? I long press the app icon, click app info. All permissions, data usage, battery usage, storage usage options and metrics are shown for the app.

Re:Symbian Won by derefr on Thursday June 25, 2020 @12:36PM (#23642537)
That still happens outside the app, though. You have to go back to the home screen, find the app icon. I'm talking about a design where there's no "lookup the app" step in any menu (Settings or Home screen); where instead, you go straight to the foreground app's preferences.
Re:Symbian Won by edef on Thursday June 25, 2020 @04:17PM (#23645146)
You can do this from the app switcher: long-press the "title bar", and there'll be a round "I" button that takes you to the app's settings.
Re:Symbian Won by perryizgr8 on Friday June 26, 2020 @01:21AM (#23648936)
If I am in the app, I can swipe slowly from the bottom, and click the "app info" button. So no hunting for the app icon needed.
Re:Symbian Won by cglong on Thursday June 25, 2020 @02:02PM (#23643593)
Not really a direct answer to your request, but Android 11 will allow you to grant permission to an app once, and will clear permissions for apps you haven't used for a few months: https://developer.android.com/preview/privacy
Re:Symbian Won by vxNsr on Friday June 26, 2020 @01:51PM (#23654858)
THIS IS A TERRIFIC IDEA!

Feels so intuitive. Turns the control center into the top bar from macOS or the file/edit/settings bar that many windows apps have. That's so darn obviously the right way to do it!!!!

Re:Symbian Won by hathym on Thursday June 25, 2020 @09:53AM (#23640754)
> If only iptables would allow to filter by the executable path

iptables can filter based on the uid ( -m owner --uid-owner {USERNAME}) then, you have to to create a dummy user and launch your executable as that user (su, runuser, ...)

Re:Symbian Won by nix23 on Thursday June 25, 2020 @09:42AM (#23640628)
Not saying your wrong, but you said something about SELinux and AppArmor..if your interested in that stuff you should checkout OpenBSD's pledge:

https://man.openbsd.org/man2/pledge.2

Re:Symbian Won by spockz on Thursday June 25, 2020 @12:17PM (#23642349)
Could this be implemented with iptables rules on a per container/jail basis, like with K8s?