r/learnpython • • Jul 26 '23

Is there a trusted source/list of safe python packages?

Pypi doesn't do any vetting to packages published. Is there a list of packages that are known to be safe and verified by some org dedicated to checking?

36 Upvotes

25 comments sorted by

16

u/boy_named_su Jul 26 '23

2

u/[deleted] Jul 26 '23

Is this an 'industry standard'? ie. if you have to report on third-party open-source software usage as part of a security audit, would these ratings hold up to scrutiny?

It seems like a great resource on its face

9

u/Ok_Barracuda_1161 Jul 26 '23

I would say so. They're a large devops security company and a lot of large businesses use snyk's products. I'm not sure what the threshold is for "industry standard" but they're a trusted entity.

5

u/Work45oHSd8eZIYt Jul 26 '23

Do you have a definition of safe? :)

-1

u/[deleted] Jul 26 '23

i gave one below. essentially, safe means "able to pass a standard enterprise security audit". I'm not in the position of auditor, im a dev/engineer, so i don't personally have much stake in the nuances of definition lol

5

u/nekokattt Jul 26 '23

doesnt the enterprise security audit itself define what is safe?

can you ask them for a list?

1

u/[deleted] Jul 27 '23

can you ask them for a list?

Probably not, though asking them for a working definition of safe would be a step in the right direction I agree.

4

u/spez_edits_thedonald Jul 26 '23

i don't personally have much stake in the nuances of definition lol

Insofar as you are asking a particular question, if you want the answer to be meaningful, you do have to know what you're asking lol

1

u/[deleted] Jul 26 '23 edited Jul 26 '23

Okay, here's a more objective definition: The package does what it says it does necessarily and sufficiently.

0

u/[deleted] Jul 26 '23

I'm asking what others have used in a similar situation.

26

u/ThreeChonkyCats Jul 26 '23

You've asked a super important question.

I've been lead on security projects and audited in this way. It's a fucking horrible process.

Other than keeping a known, saved, local copy of any particular package, its a real challenge.

3

u/Quietech Jul 26 '23

Always a good idea for those times you need to rollback a change the devs made.

1

u/m0us3_rat Jul 26 '23 edited Jul 26 '23

and who is vetting the vetters?

that's one of the benefits of "open-source"

thousand of eyes all over the code. including automated tools etc.

in reality, there is no.. trusted anything.

your only choice is to keep a local repo and verify the packages before pushing a "new update".

and it's mostly "security" updates not ..actual package updates.

most of the time.

it is one of the most 100% jobs that you can have.

do expect middle of the night work phone calls.

keep up with all the blogs all the sites news vulnerabilities etc.

time intensive.

sometimes you have/get to craft pre-patches till the code maintainers come up with their own patch.

3

u/[deleted] Jul 26 '23

and who is vetting the vetters?

I'd say, similar to why people invest in the S&p500 with the understanding that if the world 500 largest companies lost all their value, the least of anyone's problems would be their portfolios, a list of packages that are well used and understood enough that if a security flaw were found in one of them, enough people would be threatened that all the stakeholders of a particular project would be able to shovel shit upstream, i would consider that package "secure".

Of course this is a philosophically unsatisfying response to the essential 'sensor' problem that there will always be a failure mode of a system that is undetectable, because what if the sensors break at the same time as the thing they are sensing? even with an infinite regress of sensors, there is always a chance...

2

u/Tefron Jul 26 '23

enough people would be threatened that all the stakeholders of a particular project would be able to shovel shit upstream

You answered your own question then. You essentially want popular projects whereby the usage of eno ugh people gives you some semblance of security. You can filter by GitHub stars I suppose.

1

u/quts3 Jul 26 '23

Honestly there is probably a market for a 3rd party enterprise subscription model for python package audit. I am aware of none. Google said they were going to get in the game, but their initial list is basically anticompetitive ecosystems.

1

u/nekokattt Jul 26 '23

safety comes to mind

1

u/threeminutemonta Jul 26 '23

I haven’t used it and learned of its existence only due to the pipenv docs.

https://github.com/pyupio/safety

I’m keen to start using it now.

2

u/nekokattt Jul 26 '23

the unfortunate thing with safety is that unless you pay them, they only provide outdated lists of vulnerable dependencies, which isn't fantastic for open source projects among other things.

In Java meanwhile, we have tools that pull the data directly from the NVD and match against the CVEs there. It isn't perfect and false positives are not uncommon but it still works well for a totally free tool.

If your company is willing to pay, Safety is great. For larger companies, I believe CheckMarx also provides OSDA for Python projects.

1

u/[deleted] Jul 26 '23

who will pay for the audits? the answer is no one. You have to hire someone to audit your code.

1

u/BlueeWaater Jul 27 '23

GitHub has a feature for inspecting your requirements.txt modules for public vulnerabilities. Useful but probably not enough.