News for hackers. Stuff that matters.
Re:Malicious software libraries found in PyPI posing as well... by hodgesrm on Friday September 15, 2017 @11:38AM (#15258006)
This is a scary attack. One partial mitigation is to use a firewall (e.g., Amazon VPC network ACLs) to restrict outbound network traffic to a small number of known addresses like well-known repos. I can't think of a good reason why code in any well-behaved application should be allowed to make random outbound network calls.

I think it's also on app developers to rethink the culture of randomly grabbing packages to build applications quickly. This is already a security problem even with approved repos. Having a rat's nest of packages makes it hard to upgrade quickly when those repos post updates to address vulnerabilities.

Edit: Removed confusing statement about return connections

Re:Malicious software libraries found in PyPI posing as well... by closeparen on Saturday September 16, 2017 @02:51PM (#15266030)
>well-known repos

I think it's clear at this point that you should be using internal mirrors of both programming language and OS package repos, so there is no need for build or production machines (other than those responsible for syncing the mirrors) to have outbound internet access at all.

Re:Malicious software libraries found in PyPI posing as well... by zokier on Friday September 15, 2017 @12:31PM (#15258435)
> One partial mitigation is to use a firewall (e.g., Amazon VPC network ACLs) to restrict outbound network traffic to a small number of known addresses like well-known repos.

That breaks down very quickly with the combination of public CDNs and TLS. I suppose you could do SNI based firewalling, but that is bit ugly, and afaik you can't do that easily with common firewalls (like netfilter).

Re:Malicious software libraries found in PyPI posing as well... by hodgesrm on Friday September 15, 2017 @03:14PM (#15259920)
As I mentioned above some of this goes back to application design. Ideally if you are layered correctly the application components of the system that own data should not talk to the outside world except in very narrowly circumscribed ways.

Unfortunately most real world systems that have internet access are created in far from ideal conditions.

Re:Malicious software libraries found in PyPI posing as well... by katastic on Friday September 15, 2017 @02:35PM (#15259523)
This. If it was that easy we'd already be doing it on all our desktops and servers.
Re:Malicious software libraries found in PyPI posing as well... by philsnow on Friday September 15, 2017 @12:48PM (#15258586)
This is probably a good mitigation anyway, but it's not enough: a malicious package could include an (obfuscated) API key that allows it to exfil whatever data it wants to an s3 bucket or similar.

Unless you're super gung-ho about using Service Control Policies _and_ your service doesn't otherwise need to access s3, then there isn't really a way to block this.

Re:Malicious software libraries found in PyPI posing as well... by jsty on Friday September 15, 2017 @12:59PM (#15258703)
> I can't think of a good reason why code in any well-behaved application should be allowed to make random outbound network calls

If your application implements webhooks, then there's a valid use case? I'm in complete agreement however that you should default to deny and open up as required.

Re:Malicious software libraries found in PyPI posing as well... by hathawsh on Friday September 15, 2017 @01:38PM (#15259080)
For security, you should call outbound webhooks using a server dedicated to that purpose, where the main server and webhook caller are connected through an async message passing system such as RabbitMQ. That way you can maintain strict firewall rules on the main server.
Re:Malicious software libraries found in PyPI posing as well... by anthony_barker on Friday September 15, 2017 @02:32PM (#15259503)
Aws Sqs write only queue for external facing servers is what we do. What worries me is not servers... It's admin/Dev machines...