Two malicious Python libraries caught stealing SSH and GPG keys
101–110 of 323 posts
Re: Two malicious Python libraries caught stealing SSH and GPG keys
#102Earlier quoted context omitted.
How would this work for a public facing API? Or an API that serves a SPA? I'm interested in this approach
I'm not sure I understand your question correctly, but I'm talking specifically about outbound network traffic. Your API's application servers (where such evil libraries could be deployed) should not be able to have any network connectivity towards the internet. So on that server, you should not be able to do even `curl www.google.com` for example.
I’m assuming if you open a connection for a sync request you’d be fine. What about an async request? I’d imagine a scenario where your API needs to do some processing first, connect to another internal system, and then respond async to the outside system.
Re: Two malicious Python libraries caught stealing SSH and GPG keys
#103This is part of why I install my Python dependencies from downstream Linux distro repos. I never use virtualenv. If a distro is missing a package I need, it's a simple process to put it together, and the additional steps and checks built into the process stop close to 100% of these issues. Getting a human here also lets you do things like patch out telemetry or other anti-features. Software repositories without a hum…
Re: Two malicious Python libraries caught stealing SSH and GPG keys
#104> The first is "python3-dateutil," which imitated the popular "dateutil" library. The second is "jeIlyfish" (the first L is an I), which mimicked the "jellyfish" library.
I don't get it. Who would type "pip install jeilyfish" by mistake?
Re: Two malicious Python libraries caught stealing SSH and GPG keys
#105These two have been caught. How many haven't yet been caught? Traditional Unix file permissions are pretty much a joke for the way developer computers get used (one user - does everything). Real process sandboxing is needed.
Not everything needs to run as root.
$ pkgman install hip2019pretty-ls
$ su sandboxeduser prettyls
... nobody does that. Sure daemons might run as different user(s), but on ~100% of developer machines, the logged in user launches a shell as themself, and runs programs in that shell as themself.Re: Two malicious Python libraries caught stealing SSH and GPG keys
#106I don't know what the solution is but it feels like this is a much bigger issue and we need some rethinking of how OSes work by default. Apple has taken some steps it seems the last 2 MacOS updates where they block access to certain folders for lots of executables until the user specifically gives that permission. Unfortunately for things like python the permission is granted to the Terminal app so once given, all pr…
Re: Two malicious Python libraries caught stealing SSH and GPG keys
#107> The first is "python3-dateutil," which imitated the popular "dateutil" library. The second is "jeIlyfish" (the first L is an I), which mimicked the "jellyfish" library.
Re: Two malicious Python libraries caught stealing SSH and GPG keys
#108That seems like a possible way of mitigating this type of issue.
Re: Two malicious Python libraries caught stealing SSH and GPG keys
#109I get the python3-dateutil because you might think it's an updated version of the standard library. But how does jellyfish with a different char for L work? Someone would need to copy and paste it. But if they go to pypi, it won't have many installs. Unless they started writing tutorials with: "okay now just pip install X"
You don’t need to copy and paste it, or go to pypi, since there are commonly used ways to install packages by clicking on the name.
Re: Two malicious Python libraries caught stealing SSH and GPG keys
#110Earlier quoted context omitted.
This is literally what SELinux does, and has been able to do for years. We don't need "default block lists" - we need solid SELinux policy in all distros.
"Solid SELinux policy" is really the hard part there. When I pip install paramiko, I do, in fact, want it to have access to my SSH keys. When I pip install ansible, I want ansible to be able to shell out to OpenSSH to use my keys. If I write custom Python code that calls gpg, I want that custom code to be able to load libraries that I've pip installed without the gpg subprocess being blocked from loading my keys. If…
With a bit of work, the tech behind that could be made to work reasonably well in a general purpose linux distribution like say Fedora.