I 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…
Two malicious Python libraries caught stealing SSH and GPG keys
61–70 of 323 posts
Re: Two malicious Python libraries caught stealing SSH and GPG keys
#62Don’t install packages you haven’t at least been to the website for and preferably couldn’t build yourself.
Libraries and package managers help us work together, they’re not excuses for not thinking.
Re: Two malicious Python libraries caught stealing SSH and GPG keys
#63And the problem is much larger than these typosquatting attacks. Abandoned Github projects taken over my malicious users, rogue Maven/npm/PyPI/what have you repositories, hacked accounts on any website that is used for distributing programs, feature branches in open source projecs that are automatically built on CI servers in side corporate networks, the possibilities to grab data and send it to somewhere on the internet are endless.
One security measure that somehow grew out of fashion over the last years, is at least on application servers, to disallow any outgoing network traffic, especially to the internet (at least any cloud environment I see nowadays allows it by default). This would largely prevent these sorts of attacks from being able to actually send anything out, but also prevent XXE attacks from happening, prevent reverse connections to an attacker host from being set up, make SSRF attacks harder to verify, and so on.
I strongly recommend whitelisting only the network traffic that your application actually needs.
Re: Two malicious Python libraries caught stealing SSH and GPG keys
#64Re: Two malicious Python libraries caught stealing SSH and GPG keys
#65This will keep happening, and not only will SSH And GPG keys be the target, but any interesting data will be stolen. And the problem is much larger than these typosquatting attacks. Abandoned Github projects taken over my malicious users, rogue Maven/npm/PyPI/what have you repositories, hacked accounts on any website that is used for distributing programs, feature branches in open source projecs that are automaticall…
I'm interested in this approach
Re: Two malicious Python libraries caught stealing SSH and GPG keys
#66Earlier 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.
This is currently only implemented in FreeBSD? No other distro uses this?
Re: Two malicious Python libraries caught stealing SSH and GPG keys
#67We just recently launched a free tool that helps python developers prevent exactly these type of issues. Feel free to check it out: https://trustd.dev we work preventatively, so as you download packages, the tool will analyse it and tell you of any issues found. We’re looking to collaborate with devs to work out what features should be next.
> As you install open-source packages, trustd will scan them and provide you with instant feedback on any problems.
What kind of scanning? Algorithmic? Based on human review? If we're outsourcing trust to you, I'd want to know a lot more.
And "we use Slack instead of a dashboard" doesn't sound terribly appealing. I'd want a dashboard and a range of notification options (for me email > Slack. Others may differ)
Re: Two malicious Python libraries caught stealing SSH and GPG keys
#68The official library itself could have a "urls" file which has a list of urls that are expected and so anything that doesn't match can be questioned.
Whilst this won't solve the issue 100%, it raises the difficulty barrier to implement outgoing network calls.
Re: Two malicious Python libraries caught stealing SSH and GPG keys
#69This will keep happening, and not only will SSH And GPG keys be the target, but any interesting data will be stolen. And the problem is much larger than these typosquatting attacks. Abandoned Github projects taken over my malicious users, rogue Maven/npm/PyPI/what have you repositories, hacked accounts on any website that is used for distributing programs, feature branches in open source projecs that are automaticall…
How would this work for a public facing API? Or an API that serves a SPA? I'm interested in this approach
Re: Two malicious Python libraries caught stealing SSH and GPG keys
#70Earlier quoted context omitted.
yubikeys can store GPG keys and emulate SSH keys via gpg-agent. More exciting: OpenSSL recently added full U2F/Fido support, but it might take a bit until that lands in all distros https://www.undeadly.org/cgi?action=article;sid=201911150648...
yubikeys can store GPG keys and emulate SSH keys via gpg-agent. Indeed. Same for gnuk keys. I currently use a gnuk key (Nitrokey Start) with Ed25519 and have GPG set up as the SSH agent for SSH. Though I hope to switch to a YubiKey soon, so that I don't need a separate key for U2F/Fido2.
The other advantage is that you can use the cheap U2F/Fido yubikeys without GPG/applet support.