本集简介
双语字幕
仅展示文本字幕,不包含中文音频;想边听边看,请使用 Bayt 播客 App。
安全一直是软件里的蔬菜。
Security has always been the vegetables of software.
大家都知道它很重要,但不知怎么的,它总是上不了桌。
Everyone agrees it matters, and somehow it never quite makes it onto the plate.
但在今年的PyCon US上,情况变了。
At PyCon US this year, that changed.
有史以来第一次,安全有了自己专属的全天专场,而且是整个大会上仅有的两个专场之一,就紧挨着AI。
For the first time ever, security got its own dedicated day long track, one of just two at the whole conference sitting right next to AI.
而且会场里挤得水泄不通。
And the room was packed to the back wall.
本期节目,我请来了三位身处核心的人物。
On this episode, I'm joined by three people at the center of it.
Seth Larson,Python软件基金会的安全开发驻场专家,而且最近刚成为CPython核心开发者。
Seth Larson, security developer in residence at the Python Software Foundation, and very recently a CPython core developer.
Juanita Gomez,加州大学圣克鲁兹分校的开源安全博士研究员,也是这个专场的联合主席;还有Mike Fiedler,IPI的安全工程师,是为数不多的全职保障你安装的包安全的人之一。
Juanita Gomez, a PhD researcher at UC Santa Cruz in open source security who co chaired the track, and Mike Fiedler, IPI's safety security engineer, one of the very few people paid full time to keep the packages you install safe.
我们通过这次专题讨论的演讲脉络,来感受一下当前Python安全领域的温度:供应链攻击、依赖冷却、零信任、SBOM,以及将Rust引入CPython的推动力。而且,我们三个人中没有人认为安全问题已经接近解决,而这恰恰就是为什么会场座无虚席。这里是《跟我聊Python》第556期,录制于2026年7月6日。
We use the arc of the track's talks to take the temperature of Python security right now supply chain attacks, dependency cooldowns, zero trust, SBOMs, and the push to bring Rust into CPython and why not one of us thinks security is anywhere close to solved and it turns out that's why the room is full this is Talk Python to me episode 556 recorded 07/06/2026.
跟我聊Python。
Talk Python to me.
对。
Yeah.
我们准备好了,开始吧。
We ready to roll.
升级代码。
Upgrading the code.
不怕变老。
No fear of getting old.
不会沉没于空气。
Ain't sinking the air.
新框架在望。
New frameworks in sight.
来一段极客说唱。
Geeky rap on deck.
团队伙伴们。
Cart crew.
欢迎收听TalkPython to me,这是面向开发者和数据科学家的头号Python播客。我是主持人Michael Kennedy,一位拥有超过二十五年编程经验的PSF成员。让我们在社交媒体上联系吧。你可以在Mastodon、BlueSky和X上找到我和TalkPython,社交链接都在节目笔记里。你可以在talkpython.fm找到过去十年的节目,如果你想参与节目,可以加入我们的录制直播。没错,我们在YouTube上直播每期节目的原始未剪辑版本。只需访问talkpython.fmyoutube查看即将举行的活动日程。记得订阅并按下铃铛,这样我们录制时你就能收到通知。本期节目由Sentry赞助。别让那些错误悄无声息。像我们在TalkPython这样使用Sentry。在talkpython.fmcentry注册。TalkPython和Python Bytes现在都有MCP服务器。将你的AI指向十年以上的Python节目、文字记录和节目笔记,免费。点击talkpython.fm和pythonbytes.fm导航栏中的MCP。Juanita、Mike、Seth,欢迎你们来到Talk Python。
It's Welcome to TalkPython to me, the number one Python podcast for developers and data scientists This is your host Michael Kennedy I'm a PSF fellow who's been coding for over twenty five years Let's connect on social media You'll find me and TalkPython on Mastodon, BlueSky and X The social links are all in your show notes You can find over ten years of past episodes at talkpython.fm and if you want to be part of the show you can join our recording livestreams That's right, we livestream the raw uncut version of each episode on YouTube Just visit talkpython.fmyoutube to see the schedule of upcoming events Be sure to subscribe there and press the bell so you'll get notified anytime we're recording This episode is brought to you by Sentry Don't let those errors go unnoticed Use Sentry like we do here at TalkPython Sign up at talkpython.fmcentry TalkPython and Python Bytes both now have MCP servers Point your AI at ten plus years of Python episodes, transcripts and show notes free Click MCP in the nav at talkpython.fm and at pythonbytes.fm Juanita, Mike, Seth, welcome all of you to Talk Python.
嗨。
Hi.
你好。
Hello.
你好。
Hello.
很高兴有些人是老朋友,有些人是第一次来,真的非常棒。
Awesome to have some of you back, some of you here for the first time, really, really great.
所以我们要聊聊Python安全。
So we're going to talk about Python security.
而且我觉得,Seth,我看到你写了一篇文章,回顾了今年PyCon US上这个独特的Python安全专题和额外的关注点。
And I believe, Seth, I saw that you wrote up a post article just thinking back on this kind of unique Python security track and this extra focus at PyCon US this year.
我想,嘿。
Thought, hey.
如果能让大家聚在一起就好了,至少是参与这个专题的所有人,不是全部八位或七位演讲者,不管总数是多少,很多很多演讲者,然后大致聊聊Python安全,以PyCon安全专题中涵盖的主题和演讲的脉络为背景。
That'd be great to just get everyone involved together, at least everyone involved in the track, not all eight, seven or eight speakers, whatever that number adds up to be, many, many speakers, and just kinda talk broadly Python security and use this arc of the topics and talks covered at PyCon and the security track as, maybe a backdrop.
所以欢迎。
So welcome.
欢迎。
Welcome.
在我们深入讨论之前,先快速介绍一下你们是谁,以及你们是如何参与进来的。
Now before we get into that exactly, let's just do quick introductions about who you are and how you're involved in stuff.
Juanita,你先来怎么样?
Juanita, you wanna kick us off?
好的。
Sure.
我叫胡安妮塔。
My name is Juanita.
我现在是加州大学圣克鲁兹分校的博士生。
I am a PhD researcher right now at UC Santa Cruz.
我在大学里和SBOM项目合作,研究开源安全与可持续性。
I work with the SBOM my university doing research in open source security and sustainability.
我参与Python和科学Python社区已经有一段时间了。
And I've been involved in, like, the Python and the scientific Python community for a while.
所以,是的,我被邀请来共同主持这个专题,这让我非常兴奋。
So, yeah, I I got invited to coaching of the track, and that was very exciting.
太棒了。
Very cool.
你的博士读到哪里了?
Where are you in your PhD?
你通过资格考试了吗?
Are you past quali qualifying exams?
我八月份毕业。
I'm graduating in August.
天哪。
Oh my god.
太棒了。
That's awesome.
恭喜。
Congratulations.
是的。
Yes.
你早就过了那个阶段了。
You're far past it.
那之后有什么计划?
So what's the plans after?
我刚找到工作。
I just got a job.
我暂时还不能说,但我刚拿到
I can't talk about it yet, but I just got
一个,所以我要去工业界了。
a So but I'm going to industry.
我主要会继续做开源领域的安全和可持续性方面的工作。
I'm gonna keep working on security and sustainability in open source mostly.
对。
But yeah.
在工业界。
In industry.
不错。
Cool.
恭喜你,既完成了博士学位,
Congratulations on on both finishing the D.
又马上找到了工作。
And getting a job straight away.
那真是太酷了。
That's super cool.
谢谢。
Thank you.
对。
Yeah.
迈克,欢迎回来。
Mike, welcome back.
嘿。
Hey.
很高兴来到这里。
Glad to be here.
我是迈克·菲德勒,PyPI安全与保障工程师,为Python软件基金会工作,常驻纽约市。
Mike Fiedler, PyPI safety and security engineer working for the Python Software Foundation based out of New York City.
我即将在PSF工作满三年,这是一个很酷的里程碑,我将与我的同事赛斯一起庆祝。
This will be I'm coming up on my third year here at the PSF, which is a cool milestone that I will be sharing with my compatriot here, Seth.
非常棒。
Very cool.
我知道,感谢你所做的一切工作。
And I know thanks for all the work.
我觉得这影响挺大的。
It's been, I think, pretty impactful.
而且已经三年了。
And three years already.
是的。
Yeah.
这真是一段疯狂的旅程,因为在这份工作之前,我很久以前就是PyPI的志愿管理员和贡献者了。
It's been it's been kind of a wild ride of of kind of incorporating this, because I was a volunteer PyPI admin and contributor long before this job opened up.
能够坐在这里全职思考和处理PyPI的安全功能等问题,让我大开眼界,看到了差距在哪里,以及它们仍然存在的地方,但也看到了在短期内我们可以立即做哪些非常重要的事情,同时逐步构建我们需要的部分,以实现这些长期目标,但在这个过程中我们仍然能够取得进展。
And having the ability to sit here and think about and work on security features and stuff for PyPI full time has been a big eye opener as to kind of where the gaps were and kind of where they remain, but also kind of what are the very important things that we can do in the interim immediately while building up the kind of the the piece by piece bits that we need to get to these longer term ideas, but being able to kind of still make progress while we're getting there.
再说一次,这就像在飞行中重建飞机一样。
Again, it's that that notion of, like, rebuilding a plane while you're flying it.
比如说,好吧。
Like, okay.
嗯,我们有飞机,但现在我们是在飞行中加装更好的传感器、更好的操控、更好的油门,还有更好的开关,而且飞行速度还在加快。
Well, we had the plane, but now we're, like, adding better sensors, better steering, better throttles, better better toggles while we're still flying, and that flight is accelerating.
对。
Yeah.
百分之百。
A 100%.
还有安全带。
And seat belts.
我觉得在安全飞机的比喻里,安全带应该算一个。
I think seat belts belong in a security airplane analogy.
可能吧。
Probably.
但话说回来,这个也有争议。
But again, it's arguable.
有时候安全带反而是个问题。
Sometimes seat belts are a problem.
所以,对。
So, like Yeah.
这就变成了一个关于权衡和平衡的很好的讨论,以及什么才能真正推动进展,而什么只是可有可无的,比如烟灰缸。
It it it becomes a very good discussion of trade offs and balances and kind of what what actually will move a needle versus this is a nice to have, you know, ashtray.
对。
Yeah.
烟灰缸。
Ashtrays.
天哪。
Oh my gosh.
我记得,我记得飞机上还有烟灰缸的时候。
I remember I remember when there were ashtrays on airplanes.
是的。
Yep.
那
That
真是疯狂。
was crazy.
我就想,为什么还有烟灰缸
I'm like, why is there still an ashtray
在这架飞机上?
on this airplane?
我知道他们不会让任何人用它的。
Like, I know they're not gonna let anyone use it.
有趣的事实是,飞机厕所里仍然有烟灰缸,因为尽管这是违法的,但他们还是希望如果你要违法,能有一个安全的地方扔烟蒂。
Fun fact, they still have them in airplane bathrooms, because while it is against the law, they still want you to have a safe place to throw an ash your your cigarette butt if you're gonna violate the law.
这样你就不会把它扔进垃圾桶,引发火灾。
So that way, you don't throw it into the the trash can and set something on fire.
对。
Yeah.
听起来挺合理的。
Seems seems reasonable.
确实合理。
Seems reasonable.
那么,作为过渡,迈克,你先来,然后赛斯,你接着讲。
So as as a way of a segue, Mike, I'll have you take this first, and then, Seth, you can pick this up.
你提到全职投入这个项目,而不是一群只对部分内容感兴趣的贡献者,但你知道,在成千上万个项目、用户和贡献者之间协调,就像赶猫一样难。
You pointed out being full time on this project versus a bunch of kind of contributors who get excited about part of it, but then, you know, there's this whole herding cats across thousands and hundreds of thousands of projects and users and contributors.
你觉得全职投入这个角色,和只是核心开发者那种情况相比,影响有什么不同?
And what is your thoughts on the impact of having a full time dedicated role to this versus just, like, a core dev type of situation, you know?
对。
Yeah.
我觉得这里有两方面。
I I think there's there's kinda two facets here.
对吧?
Right?
这确实是一个权衡。
And it there is very much a trade off.
对吧?
Right?
如果是全职志愿者,你付出什么就得到什么,也就是什么都没有。
When it's full time volunteers, you get what you pay for, which is nothing.
对吧?
Right?
你什么都没付出。
You haven't paid for anything.
志愿者会做他们想做的事,他们会尽力而为。
Volunteers are gonna do what volunteers wanna do, and they're gonna do their best effort.
当你雇了人,你就会设定期望,并努力确保达到这些期望。
When you hire somebody, then you you set expectations, and you try to make sure that you meet them.
对吧?
Right?
这里有个双刃剑,就是一旦雇了全职员工,志愿者往往会退一步,因为觉得,好吧。
The the double edged sword there is that by hiring full time employees, volunteers often will take a step off because it's like, okay.
我不需要像以前那样投入那么多志愿服务了,因为现在有人拿钱来做这件事。
I don't need to volunteer as much as I used to because now someone's getting paid for, to do it.
所以这既是好事,因为它突出了需要清理和集中精力推进的领域,但也给了志愿者一个急需的休息,这反过来又给全职员工施加了更多压力去执行,而他们又没有足够的人手和时间。
So it's it's both a good thing because it highlights and focuses effort on areas that need kind of sanitization and and focused effort to make progress, but it also gives volunteers a much needed break, which then in in turn puts more pressure on the full time employees to execute, which again, not enough capacity, not enough time.
所以,你知道,我们在这里尽力了,但是,就像,这
So, you know, it's it's we're doing our best here, but, like, it
这
it's
表明如果你为专注的安全工作付钱,你确实能得到好的安全结果。
shown that if you do pay for a focused security effort, you do get good security outcome.
而且我认为,对我以及任何人来说,关键的一点是,如果你付钱,他们就会来。
And I think that's the the the takeaway for for me and for anybody is if you pay for it, they will come.
有道理。
Fair.
Seth,欢迎回来。
Seth, welcome back.
嘿,Michael。
Hey, Michael.
给还没听过你节目的朋友简单介绍一下吧,然后说说你对全职这件事的看法。
So quick intro for people who haven't listened to your episodes, and then maybe maybe your thoughts on this full time thing.
对。
Yeah.
大家好。
So I hi, everyone.
我是Seth Larson。
Seth Larson.
我在Python软件基金会担任驻会安全开发者。
I'm a security developer in residence at the Python Software Foundation.
我主要负责API后端以外的工作,比如Python语言本身、运行时环境、Python和pip的安全响应团队,还有打包工具和标准之类的。另外,我也关注安全领域和Python之间是怎么互相影响的。
I work primarily on kind of, like, everything that is not API back end, so that's the Python language, the runtime, the security response team for Python and PIP, packaging tools and standards, and then kind of like how security world interacts with Python and vice versa, right?
就像CBE那些。
So like CBE and all that.
而且最近,非常最近,成为了核心开发者。
And recently, core developer, very recently.
所以回答这个角色怎么样以及和志愿者互动的问题,因为我的领域很大,我试图聚焦的地方,我最终做的是找那些明显高影响力的项目。
So to answer the how is this role and all of that and interacting with volunteers, the way that I've tried to like, because my space is so large, my area of where I'm trying to focus, what I end up doing is I try to find projects that are obviously high impact, all of that.
对吧?
Right?
不想做那些事情。
Like, don't wanna be doing things.
你不想只是小打小闹,或者怎么说,就是那种零敲碎打。
You don't wanna be nibbling or what is the there's a snacking.
就是那个说法。
That's the phrase for it.
你不想只是零敲碎打,但也不想做那些志愿者本来就能做的事情。
You don't wanna be snacking, but you also don't wanna be doing things that volunteers could technically do.
对吧?
Right?
所以,如果某个工作、任务或项目是志愿者能做的,我可能会暂停一下,等一等,因为我要给别人留出贡献的空间。
So if you if it's a job that is or a task or a project that a volunteer could do, maybe I will, like, pause and wait on that because I'll leave space for someone to potentially contribute there.
然后,那些不太可能得到志愿者贡献的事情,比如为Python软件基金会建立CB编号机构,或者在PSRT(Python安全响应团队)当管理员,做类似的事情,比如,好的。
And then the things that are less likely to get volunteer contributions, things like spinning up a CB numbering authority for the Python Software Foundation or being an admin on the PSRT where or the Python Security Response Team where you're doing things like, okay.
我们要监控发送到我们邮件线程的垃圾邮件。
We're going to, like, be monitoring for spam being sent to our email thread.
志愿者可能不想做那个,但他们可能想加入安全响应团队,参与协调漏洞报告,然后因为他们在NCD记录和公告中的工作而得到认可。
Volunteers maybe don't wanna do that, but maybe they would want to be on the security response team contributing to coordinating vulnerability reports and then getting acknowledged for their work in NCD record and advisory.
所以这就是我的想法。
So that's kind of how I think about it.
因为这个领域太广了,我尽量确保给别人留出贡献的空间,以防别人在我之前先做了。
Because the area is so wide, I try to make sure that I leave space for other people to contribute just in case that people do get around to it before I end up getting to it.
我们也想锻炼社区的志愿者能力,而不是只靠一个人,对吧。
We wanna build the community volunteer muscle also, not just have it be on one Yeah.
那真的很酷。
That's really cool.
你有多关注像Django这样流行的第三方项目?
How much do you focus on popular third party projects like Django?
我的意思是,Django已经有全职人员了,但像Flask之类的项目呢,还是只关注纯Python?
I mean, Django already has full time people, but Flask or something like that versus just pure Python?
对。
Yeah.
所以我会说,我的时间不一定总是直接花在项目上,但我确实会花时间回应维护者的问题。
So I would say my time doesn't necessarily always, like, land directly on the project, but I do spend time responding to maintainers if they have questions.
比如,Flask的David,我和他多次讨论过如何做安全响应计划或威胁模型,或者你知道,嘿。
So, like, for example, David from Flask, him and I have talked many times about how to do, like, a security response program or a threat model or, you know, hey.
我看到这个了。
I'm seeing this.
你能帮忙吗?
Like, can you help?
比如,在这种情况下我该怎么办?
Like, what what should I do in this situation?
我们聊过这个,我也和很多其他维护者聊过,不只是Blast。
Like, we've talked about that, and I've talked about it with many other maintainers, not just Blast.
就是想给他们一些建议。
Just to try to give them, like, advice.
而且,这个职位在非营利组织的一个好处就是,你可以非常非常开放。
But then also whenever like, one of the nice things about this role being at, a nonprofit is that you can be super, super open.
你不必把做过的事情和成功的经验都藏在心里。
You don't have to like keep the secrets to yourself about like what you've done and like how you've seen success.
所以我们发布我们所做的一切,以及我们看到成功的地方,理论上人们可以直接拿去用,复制粘贴到他们的项目或流程中,然后比以前过得更好。
So like we publish everything that we do and like where we see success and people in theory can just like take that, copy paste it into their projects or their processes and and and have a better time than they were before.
这样人们就可以互相学习。
So people can learn from each other.
我真的很喜欢这部分工作。
I really do appreciate that part of the work.
这是做开源安全的一个独特之处,不像那种我不能说的东西。
That is a bit of a unique aspect of doing an open source security thing as opposed to I can't talk about it.
这个不是。
This is no.
我们什么都不说。
We don't we don't talk about anything.
所以非常有趣。
So very interesting.
我们来谈谈这个专题。
Let's talk about this track.
有一个开创性的Python安全专题,首次推出了一整天的议程,专门讨论最新的Python安全。
So there's this trailblazing Python security that talks about, for the first time ever, a day long track devoted to the latest in Python security.
如果你查看演讲日程,周六就是那个专题,当时整个房间都满了。
And if you pull up the the schedule of talks, it was Saturday was the track, and that was there was just a whole room.
而且我还喜欢那个房间,不是吗?
And what I also liked was a room, wasn't it?
那是一个固定的地方,所以你不用一直换地方。
That was, like, a fixed place, so you didn't have to keep moving.
对。
Yeah.
那么,Juanita,你愿意先来谈谈为什么你们今年会关注这个吗?
So, Juanita, you wanna kick us off and talking about, like, why this why why do you guys focus on this this year?
而且,你知道,为什么你们决定给它一个专门的时段?因为只有两个专门的时段,安全和AI,我觉得这非常合适。
And, you know, why did you decide it's gonna take a specific slot in there's only two dedicated slots, security and AI, and I think that's very fitting.
但跟我们说说这个专题吧。
But tell us about this track.
好的。
Okay.
嗯,我会让Seth来谈谈这个想法是怎么产生的,因为我没有参与那部分,但我会谈谈为什么我认为它很重要,以及为什么它在会议上很重要。
Well, I will let Seth talk about how did the idea come to place because I was not part of that, but I'm gonna talk about why I think it's important and why it was important in the conference.
我认为安全是Python中所有事情的一个平行方面。
I think security is something that's parallel to everything in Python.
Python。
Python.
我觉得如果你是某个软件包的维护者,心里应该时刻想着安全这件事。
I think that if you're a maintainer for a package, I think having security somewhere on your mind should be a thing.
就是说,你在开发东西的时候,应该考虑安全问题。
Like, you should be thinking about security when you're developing a thing.
而且我觉得,维护者花在安全上的时间或者专业知识方面,可能存在着很大的缺口。
And I think there's like a big gap in like maybe the time that maintainers spend thinking about security or like even the expertise.
所以我认为这个专题对Python的维护者或用户来说,是个很好的机会,可以学习一些重要的安全知识,尤其是在考虑他们的开发流程时。
And so I think this track was like a big opportunity for people that work in Python as maintainers or as users to just learn about some important security things when thinking about like they their development processes.
我觉得把它设为专门的专题很棒,因为这凸显了安全的重要性。
I thought it was great that it was like a dedicated track because I think it highlights the importance of security.
它不像是一堆分散在日程里、人们得自己琢磨着去听的讲座,而是我们把它做成了完整的专题,让它成为一件正经事。
Like, it's not a bunch of tongs that are kinda like in the schedule that people just kinda like figure out they want to go to, but it's like we've like made it a thing by making it like a full track.
我觉得这提升了Python安全的重要性,而这一点平时未必总是能得到体现。
And I think that elevates the importance of security with Python, which I think it's not necessarily always the case.
我觉得每次我跟迈克聊天的时候,我都会想,为什么只有你在为PyPI或者PyPI的安全做贡献,却只有你一个人拿钱?
I think every time that I talk to Mike, I'm like, why are you the only getting paid for doing PyPI or PyPI security?
我觉得提高人们对安全重要性的认识非常重要,我认为这个专题就是想要达到这个目的。
I think increasing the awareness of the importance of security is, like, very important, and I think that the track is I think was meant to do that.
你觉得那七场演讲在多大程度上代表了更广泛的安全领域?毕竟你是研究这个的,还拿了博士学位。
How much do you think what were in those seven talks is representative of the broader security space, you know, getting your PhD, studying this stuff?
你可能会比一般人更了解,不只是Python方面的。
Like, you get maybe a little more than just Python view.
那么,你觉得它涵盖了哪些内容,又遗漏了哪些呢?
Like, what what did it capture and what did it miss, I guess?
我觉得,说实话,我们把这个专题设计得足够多样化,能够涵盖安全领域里非常不同的方面。
I think, honestly, we we made it a track that was diverse enough that we could capture, like, very different things within the sick like, the security brother, like, image.
而且我还觉得,我们讨论的很多东西其实并不一定是Python特有的。
And I also think that a lot of the things that we talked about are not even necessarily Python specific.
比如,你应该关心你的凭证。
Like, you should care about credentials.
你应该关心网络钓鱼。
You should care about phishing.
所有这些事情,无论你是用Python、C还是其他任何语言开发,都应该关心。
Like, all of these things are things that you should care about whether you do Python or C or any other like language development.
我觉得,可能有一点缺失的是,在会议结束后,我回想起来,可能会希望有一个安全方面的入门介绍。
I I think that something that maybe I I was missing a little bit after I like saw maybe after after the conference, I was thinking about I would have liked maybe like an intro version of security something, I think.
在我的研究中,我实际上关注的是安全实践,主要是针对刚开始的项目。
Something that I work with in my in my research is actually like security practices mostly for like starting projects.
我合作的都是大学项目,我的开源项目的目标就是改进这些大学项目的实践。
I work with, like, literally university projects and, like, the goal of my Osport is to improve the practices of the university projects.
其中一些项目可能还不够先进,无法采用一些更高级的安全实践。
And some of them are maybe not as advanced to take on some of the, like, I would say more advanced security practices.
所以,也许像那样的事情,我们没有涵盖那么多,比如一些基本的东西,就像直接去GitHub,然后切换一些仓库配置的开关。
And so maybe something like that is is something that maybe we did not captured as much, like, basic things like like, literally just going to GitHub and, like, switching some some switches on on the configurations of, like, your repository.
有些东西可能缺失了,我认为对于那些在安全领域完全没入门的人来说,这些是有价值的。
Some of those things maybe were missing and I think there's value on that for people that are, like, literally nowhere in the security, like, path.
但除此之外,我觉得这个专题的多样性真的很不错。
But apart from that, I think the diversity was really good on the track.
我很喜欢。
I I love it.
我觉得那会是一个很好的开场演讲,就像安全入门一样。
I think that'd be a great talk to kick off the track and, like, security one zero one.
比如第一周别被黑之类的。
Let's not get hacked the first week or something like that.
你懂吧?
You know?
对。
Yeah.
我会做的。
Like I'll do it
明年吧。
in next year.
是的。
Yes.
就这么办吧。
Let's do it.
我很想看到那个。
Like, I would love to see that.
比如说,也许可以加一点速率限制和一些日志记录。
Like, for example, maybe just add some a little bit of rate limiting and some logging.
这样如果真的出了什么事,你就能察觉到,诸如此类的。
So if something does happen, you could actually tell and, you know, these kind of things.
对吧?
Right?
你知道的,这类东西有一大堆。
It would be you know, there's a whole list of that stuff.
对吧?
Right?
还有一个想法,是在我们回顾这次活动的流程和主题时想到的,这是胡安妮塔的主意,所以你得纠正我。
Another idea that, like, came up in when we were thinking about how the track went and how the themes and this is this is Juanita's idea, so I you're gonna have to correct me.
这个想法是增加一些互动性,让活动更有活力,而不是像现在这样。因为你知道,在安全领域的这些演讲中,你可能期待的是更专业的空间,但如果采用演讲的形式,基本上就是一个人在讲。
But the idea of, like, having a little bit more interactivity to kind of shake things up as opposed to being because I mean, with security, with these talks, maybe you're expecting it to I mean, it's obviously like more expert space, but that ends up if you're in a talk format, it's mostly talking to people.
但如果采用小组讨论的形式,先提几个问题来设定主题,然后开放给观众,了解他们有什么问题,这样互动性会更强。
But having something like a panel you start off with a few questions to kinda set the theme, and then you kind of open it up to kind of get some vibes from the audience about what kind of questions they're having, make it more interactive in that way.
这个想法对我来说也很有趣。
That seemed really interesting interesting to to me me as as well.
嗯。
Well.
所以我们明年会尝试一下这个形式。
So So we're we're gonna gonna we're gonna see if we can experiment with that next year.
所以你的意思是明年还会有一次?
So am I hearing you say there's gonna be one next year?
我们当然希望如此。
We're hoping for it, for sure.
我们觉得明年应该再办一次。
We we we think that we should have another one next year.
我是说,没有任何迹象表明我们不应该再办一次,这是我们看到的。
I mean, there was no indication that we shouldn't do this again is is what we saw.
所以
So
说实话,我觉得安全问题明年可能就解决了。
Honestly, I mean, security might be solved next year.
哦。
Oh.
哦,对。
Oh, yeah.
那会
It'd
很好,不是吗?
be great, wouldn't it?
当然。
For sure.
人工智能会解决我们所有的安全问题。
AI will solve all of our security problems.
我是这么听说的。
It's what I've been told.
我也是这么读到的。
It's what I've read.
迈克,你想把我们引向一条完全不同的道路。
Mike, you're trying to take us down a path that is a very different path.
嗯,我是说,都过去几分钟了,我们还没提到人工智能呢。
Well, I mean, it's been a few minutes, and we haven't said AI yet.
嗯,不。
Well, no.
你其实提到了,因为你介绍了另一条路线。
You actually did because you introduced the other track.
所以不是这样。
So it's not
对。
Yeah.
我们只是顺带提了一下,但不是针对这个话题。
Well, we only mentioned it in passing, but not with regard to this topic.
我确实觉得,如果时间允许,想跟你聊聊这个。
I do think, actually, maybe if we get some time, do wanna talk to you about it.
但内容太多了。
But it's it's There's a lot to cover.
有意思。
Interesting.
内容太多了,也许这可以单独做一期节目来深入探讨。
There is so much maybe this could just be its own own show that we could go into because there is a lot to cover.
我觉得有正面也有负面,这大概就是AI的写照吧,不是吗?
I think there's there's, like, positives and negatives, and that kinda sums up AI right there, doesn't it?
说实话,这概括了一切。
It sums up everything, honestly.
这概括了很多生活。
It sums up a lot of life.
是的。
Yes.
嘿,等一下。
Hey, one second.
通常,这里会是Sentry的广告时间,但这次不是。
Normally, this would be an ad break from Sentry, but not this time.
我们就感谢他们支持节目,然后马上回到对话。
Let's just thank them for supporting the show and get right back to the conversation.
另外,节目结束后请访问talkpython.fmsentry。
Also, visit talkpython.fmsentry after the show.
谢谢Sentry。
Thanks Sentry.
很多灰色地带。
A lot of gray.
对。
Yeah.
不是那么非黑即白。
Not so much black and white.
很多灰色地带。
A lot of gray.
所以当时是站无虚席。
So it was like standing room only.
我是说,听起来这对我们明年来说是个好兆头。
I mean, that sounds like there that bodes well for our next year.
对。
Yeah.
明年,希望如此,我是说,如果能有个更大的房间就更好了,是的。
Next year, hopefully, I mean, it'd be really great to even have a bigger room or yeah.
我们对出席人数非常满意。
We were quite happy with the turnout.
有几场讲座基本上都站满了人,房间里再也进不来人了。
We had a few talks that basically it was standing room and there was nowhere else to come into the room.
作为首次活动的组织者,看到房间太小总是很高兴的。
So that's always great to see as an organizer for a first time event is when the room is too small.
这意味着你做得对。
It means you're doing something right.
没错。
Exactly.
你已经超额完成了你原本想达到的目标。
You've you've overachieved compared to what you were trying to work with or whatever.
是的。
Yeah.
我想知道,你共同主持一个专题讨论之类的经历是怎样的?
I guess it's just wanting to set, like what was your experience just co sharing a a track and so on?
在会议的那一边是什么感觉?
Like, what was it like being on that side of the conference?
我觉得很棒,因为其实我已经组织Sidebar好几年了。
I think it was I I thought it was great because I think so I've actually been organizing sidebar also for a couple of years.
一直以来,我都想把安全话题带到外面来讨论。
And for the longest time, I've actually tried to bring security as a conversation outside by.
我做过几次兴趣小组讨论,但搞一个安全专题似乎不太可能。
So I've like, I've done a couple of like birds of a feather session, but having a security track seems a little impossible.
我不知道,所以能在PyCon上实现这个,我真的非常开心,因为这给了你机会,让大家来谈论你真正关心的事情。
I don't know like it's so I don't know like making making this happen at PyCon was it made me really really happy because it gets you the opportunity to bring people to talk about the things that you really care about.
比如,Python安全对我来说真的很重要。
Like, security in Python is really, like, personal to me.
我非常在乎这件事。
I I care a lot about it.
而且我觉得部分问题在于,人们对我们在Shark上讨论的一些事情缺乏认识。
And I think part of the problem is the lack of awareness of some of the things that we discussed at the Shark.
所以我觉得这是一个很好的机会,可以把这种意识带到桌面上来,并且真正参与到那个对话中去。
So I thought it was a great opportunity to just kind of bring that awareness into the table and making it happen just like being part of that conversation.
我为自己做到这件事感到非常自豪。
I feel really proud of of doing that.
而且我觉得,塞斯和我,还有另外几个人,我们审阅大家提交的演讲提案时,真的玩得很开心。
And I think also, I think, like, Seth and I and, like, other couple of of people we had I mean, I had a lot of fun reviewing some of the tongs that people submitted.
不幸的是,我们只有八个名额,但光是阅读那些演讲提案,我就学到了很多东西。
We were unfortunately, like, limited to, like, eight slots, but there was a lot of things that I learned by just reading some of the talk proposals.
所以对我来说,参与这个分论坛也是一次学习经历。
So it was like, I think it was also like a learning experience for me too to be part of the track.
对。
Yeah.
我想说的是,和胡安妮塔相比,我在组织会议、演讲和大会方面的经验,这真的是我第一次真正深入参与这种级别的会议组织工作。
I was gonna say compared to Juanita, my experience with organizing sessions and talks and conferences, this is like the very first time that I've like really dipped my toe into organizing at this level for a conference.
所以对我来说,这真的学到了很多,我觉得这是一次很棒的经历。
So it was it was a lot of learning for me and I I thought it was a great experience.
我觉得其他人肯定也会喜欢做这件事的。
I think other people could definitely like, would enjoy doing this too.
所以现在我在慢慢了解和学着这些东西,就是关于一个会议的分会场或者演讲日程是怎么安排出来的。
So now I'm I'm, like, just understanding and learning all of these things that are about how a conference track or a talk schedule is put together.
对我来说,当天的事情真的特别特别多。
And for me, like, the the day of stuff was, like, so so much.
你到处跑来跑去,而且都是临场发挥,你知道,他们都有各种建议。
It it's you're running around and it was, like, very on the fly and, you know, they have all the recommendations.
但一旦事情开始运转起来,就停不下来了。
But once the ball is rolling, it's like, it's rolling.
而且真的非常有趣。
And it was really, really fun.
我不知道。
I don't know.
我们在那里玩得很开心。
We had a lot of fun up there.
我觉得那场会议办得非常好。
I think that it was a great session.
每个人的能量都非常积极。
Everyone the energy was so positive.
活动结束后,人们总是会走过来跟你说,哇,太棒了。
People are always coming up to you afterwards and saying, like, oh, that was amazing.
比如,谢谢你做这些,诸如此类的话。
Like, thank you for doing this, all of that.
是的,那真的是一次很棒的经历。
And, yeah, it was it a really great experience.
太酷了。
So Cool.
对。
Yeah.
今年的PyCon也真的很有趣。
PyCon was really fun this year too.
我觉得长滩是个挺不错的场地。
I I thought Long Beach was a pretty nice venue.
那里有一些不错的小吃车,还有其他可以做的事情。
There's some nice food carts and other things to do there.
所以那真是
So that was
看起来真的很不错。
Really looking nice.
那里。
There.
对。
Yeah.
现在我们知道了一些很酷的小酒吧,你知道的,屋顶酒吧或者户外酒吧,我们可以去那里和朋友聚会,或者去你想再去的很棒的餐厅,什么的。
Now that we know the cool little bar open you know, rooftop bars or outside bars that we can just go meet up and hang out with friends or the cool restaurant you wanna go back to or whatever.
对。
Yeah.
我第一次去那儿的时候,租了一辆那种Lime或者Bird的滑板车,花了一个小时在镇上和海滩边转悠,就为了熟悉一下环境,然后再去办理入住。
My first event there was to rent one of those, like, Lime or Bird scooters and just spend an hour riding around the town and the beach just to, like, get used to it and then going to check-in.
所以特别好玩。
So very fun.
咱们把话题转到会议上吧,第一个议题,我想一共有七个,我们有六七个议题,我列出来供大家讨论。
Let's let's bring it over to the conference with the first of seven I think we have seven six or seven tracks that I put up for us to kind of riff on here.
这个议题不是别人,正是迈克·菲德勒的《钓鱼活动的解剖》。
And that would be by none other than Mike Fiedler, An Anatomy of a Fishing Campaign.
这是什么?
What is this?
哎呀。
Oh, boy.
这是什么?
What is this?
所以这是今天第一个议题,对吧?
So this was the first track of the day, wasn't it?
展开剩余字幕(还有 480 条)
对。
Yeah.
对。
Yeah.
我来告诉你这是什么。
And I'll tell you what this is.
这就是为什么我们不能拥有好东西,迈克。
This is why we can't have nice things, Mike.
这就是为什么我们不能拥有好东西。
This is why we can't have nice things.
真的,确实如此,对吧?
Really, it really is true, right?
对我来说,这是一个很好的机会来做一些故事化的教育,因为这些案例确实会发生,对吧?
Like there's for me, it was a good opportunity to kind of do a little storytelling education, because these are cases that happen, Right?
而这个案例足够新颖,我觉得它值得一些澄清,因为人们听到网络钓鱼攻击时,就会说,哦,是的。
And this was a novel enough one that I was like, this this deserves some some disambiguation because people hear phishing attack is like, oh, yeah.
对。
Yeah.
对。
Yeah.
对。
Yeah.
但这次不一样。
Was this was different.
对吧?
Right?
而且我当时非常兴奋能去演讲,能被选中做这个分享。
And I I was very kind of excited to to speak and and be selected for the for the spot.
你刚才提到全场爆满。
And you mentioned standing room only.
站在台上,放眼望去,整个大厅里都是人,后面墙边都站着人,座位全坐满了,一个空位都没有,这确实有点吓人。因为你知道,有时候人们不会坐满所有座位,那倒还好。
Standing up there on the stage and looking out into a large room and seeing people standing at the back wall and not seeing little dotted seats available throughout the the the room was was a little intimidating, because it's like, you know, sometimes people don't sit in all the seats, and that's fine.
我们前面两排都是空的。
We're like the first two rows are empty.
但并没有。
But no.
胡安妮塔和赛斯基本上把整个房间都塞满了人,不是故意的,纯粹是靠精心安排时间线、定下基调,就像在说,对,这将会是一个故事。
Juanita and Seth had basically packed this room with people, not intentionally, but purely purely by curating the timeline and, like, setting the tone of, like, yeah, this is this is gonna be a a story.
我得以分享我亲身经历的一次钓鱼攻击,当时我们的一些用户被骗访问了一个网站,那基本上是 PyPI 的代理。
And I was able to relate my personal firsthand experience of dealing with a phishing campaign that some of our users were tricked into visiting a website that was a basically a proxy for PyPI.
在之前的钓鱼攻击中,很多人会谈论构建一个逐字节或像素级完美的假网站,然后把流量引过去。
In previous phishing campaign attempts, a lot of folks talk about building a for byte or pixel perfect version of a different website and steering traffic to that.
但这次他们根本不需要这么做。
Here, they didn't even need to do that.
他们只是在前面又放了一个代理。
They just threw up another proxy in front of it.
而且他们用的是公开的邮箱地址,这些地址是维护者放在 GitHub 个人资料和 Python 包元数据里的。
And it was, you know, using email addresses that are, like, publicly available that maintainers put on their GitHub profiles and put in their, you know, Python package metadata.
他们群发邮件给了不知道多少维护者。
And they farmed out and emailed some unknowable number of maintainers.
这真是个
What an
有趣的安全问题。
interesting security issue.
对吧?
Right?
就是说,你得相当确定人们用来登录GitHub的邮箱,很可能就是他们在PyPI注册的那个,而你想从PyPI接管的那些包,都链接到了他们的GitHub仓库。
Like, you're you've gotta be pretty sure that the login people use for their GitHub is probably the same email address that they've registered at PyPI, and the packages that you want to take over from PyPI linked to their GitHub repo.
对吧?
Right?
这确实大大简化了你需要做的事情。
It's it's a really it really does condense what you gotta do to
有一点。
A little bit.
对吧?
Right?
比如,很多钓鱼攻击都是广撒网式的。
Like, so in a lot of phishing campaigns, it's kind of a spray and pray.
对吧?
Right?
他们撒的网很大,会群发邮件给两百万人。
They're casting a very wide net, and they're gonna email 2,000,000 people.
哪怕只有两个人上钩,对他们来说就是成功。
And if they get two, that's a success for them.
对吧?
Right?
因为我们得时刻提防。
Because we have to defend a 100% of the time.
他们只要成功一两次就够了。
They only have to be right once or twice.
对吧?
Right?
而且在这个案例中,他们确实这么做了。
And and they were in this case.
他们,再说一次,PyPI是开源的。
They they again, PyPI is an is open source.
对吧?
Right?
你可以阅读整个代码库。
You can read on the entire code base.
你可以看到我们的邮件模板是什么样的。
You can see what our email templates look like.
而且你可以看到,是的,我们确实偶尔会要求维护者执行某个操作,而他们给维护者发了邮件,要求他们执行操作。
And you can see that, yeah, we do ask maintainers now and then to do an action, and they emailed maintainers and asked them to do an action.
而这些维护者确实执行了操作。
And these maintainers did an action.
对吧?
Right?
他们做了要求他们做的事情。
They did what they were asked to do.
比如,你几年前给人们发邮件说,嘿。
It is For example, you emailed people a couple years ago and said, hey.
你需要开启两步验证。
Well, you need to turn on 2FA.
对吧?
Right?
是的。
Yeah.
而且,这完全合理。
And, like, that's that's totally legitimate.
有时候我们会给人们发邮件说,嘿。
And sometimes we will email people and say, hey.
你的元数据有问题。
There's a problem with your metadata.
进去修一下。
Go in and fix it.
对吧?
Right?
我们偶尔会告诉人们有问题。
We will will occasionally tell people there's a problem.
这次特别告诉他们,他们没有使用我们的邮件基础设施。
This one in particular would tell them it wasn't using our email infrastructure.
你知道,如果你有反垃圾邮件措施,也许能拦截它,但没拦截,因为邮件来自这个黑客宣传的域名。
It you know, if you had anti spam things, then, like, maybe it would have caught it, but it didn't because the mail was coming from the domain advertised for this this hack.
而且它基本上显示的是pypi.org,而不是pypi.org。
And it was basically showing instead of pypi.org, pypi.org.
我敢说,你在手机上看邮件时,要悬停在一个链接上,看出小写Arial字体里I和J的区别,你根本不会注意到。
And I would challenge you at, you know, looking at an email on your phone to hover on a link and see that difference between an I and a j in the lowercase arial font on your phone, like you're not gonna notice it.
对吧?
Right?
对于上当受骗的人,我一点也不怪他们。
Humans I have no qualms for the humans that fell fell for this.
对吧?
Right?
他们只是做了他们该做的事。
Like they they did what they were supposed to do.
是的。
Yeah.
这次攻击让人恼火的是,我们一直在讨论双因素认证,但这次仍然是钓鱼攻击。
What was annoying about this attack is we've been talking about 2FA for a very long time now, and this is still phishing.
你知道,即使有某些形式的双因素认证,你还是可能被钓鱼。
You know, you can still get phished with certain forms of two factor authentication.
认证。
Authentication.
特别是那种基于时间的一次性密码,也就是TOTP,或者大家可能想到的二维码、谷歌验证器应用之类的。
Notably, the time based one time password that were TOTP or what folks might think of your, like, QR code or Google Authenticator app.
你知道,这些东西其实都是一回事。
You know, all of those things are the same thing.
但如果你用的是WebAuthn,或者底层技术,比如通行密钥或YubiKey,那需要的是另一种双因素认证,更能防钓鱼。
Whereas if you used WebAuthn or the underlying, you know, technology for pass keys or like a YubiKey, that's requiring a different sort of two FA that is more phishing resistant.
所以,凡是用了防钓鱼那部分的人,这次攻击就影响不到他们。
So anybody who had the phishing resistant part was not subject to this attack.
然后我觉得可能
And then I think it might
值得简单聊一下这个,因为我完全同意,因为你可以直接代理。
be worth maybe just a quick conversation on that because I I totally agree because you could just proxy.
他们发过来那个东西,你有三十秒、十五秒或者多少秒的时间,然后把这些凭证转过去,通过代理黑进去大概没问题。
They send over the thing, you've got thirty, fifteen, whatever seconds to then, you know, carry those credentials over, and you probably are fine to to hack through with a proxy.
对吧?
Right?
我觉得TOTP那种更像是,如果你的凭据被人拿到并且泄露了,对吧,那光有这些也不够进入系统了。
I mean, I think it's I think the TOTP ones are more like, if if somebody gets hold of your credentials and they're leaked, right, that's not enough to get in anymore.
对吧?
Right?
或者如果他们想暴力破解什么,那可能是个很大的挑战来限制这个。
And or if they're trying to brute force something, that that can be a big challenge to limit that.
但对于钓鱼攻击,是的。
But for phishing, yeah.
它真的没增加多少安全性,对吧?
It really doesn't add a lot of safety, does it?
确实没有,因为一旦你完成了用户名密码,然后做TOTP,你得到的会话令牌。
So it doesn't because the session token that you get once you have completed your username password, then you do your TOTP.
现在你有了一个会话cookie。
Now you have a session cookie.
对吧?
Right?
这就是你的浏览器用来代替每次页面浏览都要求你输入密码和两步验证的东西。
This is what your browser uses instead of asking you for your password and t and to FA every single page view.
对吧?
Right?
你有一个会话cookie,有效期大概是八小时左右,所以你不必每次都那么做。
You have a session cookie that is good for, I don't know, eight hours or something like that, so you don't have to do that all the time.
而这个会话cookie,他们可以利用它,甚至不需要在三十秒内的TOTP。
And this the session cookie is something that they can use to then they don't even need the TOTP within those thirty seconds.
他们现在有了会话cookie,就可以用它来冒充你登录。
They now have a session cookie and use that to log in as you.
然后他们做的下一步是创建一个API令牌,并发布。
And then the next part that they did was create an API token, publish.
现在的API令牌没有任何过期时间。
API tokens today do not have any expiry.
所以他们就想,好吧。
So they were like, alright.
我要创建一个新的API令牌。
I'm gonna create a new API token.
现在我不需要你的用户名、密码、TOTP或会话令牌。
And now I don't need your username, your password, your TOTP, the session token.
这些我都不需要。
I don't need any of that.
我有了一个API令牌。
I have an API token.
对。
Yeah.
我就可以用这个令牌在这个网站上做我想做的事情,你懂的。
I can go ahead and do the things that I wanna do on on this website, you know, with with this token.
所以我觉得安全是分层的。
So I think there's, like, layers of security.
这件事之后我们加了一个措施:如果你现在使用一个通过TOTP获取的会话令牌,并且它来自不同的IP地址,我们不会接受它。
Something we added in the aftermath of this was if you now are using a session token and it was obtained via TOTP and it's coming from a different IP address, we're not going to accept that.
我们会要求你重新验证身份,因为有些情况发生了变化。
We're gonna ask you to, like, re re recertify that you are who you said you were, because something is different.
但如果只是稍微偏离一下,那就没问题。
But if just step off in, then you're fine.
受影响最大的是那些频繁切换VPN的人,或者坐火车时不断更换IP地址的人,虽然这种情况不常见,但确实可能发生。
The people who will get impacted by this is are folks who are like bouncing between VPNs, or if you're riding a train and you keep changing IP addresses as you as you kind of go to different cell towers, which I don't think happens very often, but it can.
这些人会被拦截,但就像,嘿,是的。
Those are the people who will get caught in that net, but it's like, hey, yeah.
你知道,我们无法仅凭那些凭据确认你的身份。
You know, we can't tell that you are who you said you were based on those credentials.
对。
Yeah.
胡安妮塔,赛斯,你们有什么想法?
Juanita, Seth, thoughts?
我想说这是本次会议中最喜欢的演讲之一,因为非常贴近实际。
I I wanna say that this was one of my favorite talks of the track because it was very relatable.
比如,在座很多人都是在PyPI上发布自己软件包的维护者。
Like, a lot of the people that are sitting down in the room are maintainers who published their packages in PyPI.
而迈克的观点就是,哦,这种事也可能发生在你身上。
And just having Mike's perspective on, like, oh, this can happen to you.
你得意识到这一点。
Like, you need to be aware of this.
我觉得这样更有影响力,因为你会直接受到其中一些事情的影响。
I think it makes it much more impactful because it's like it's like like you are directly affected by some of these things.
而且我觉得迈克不仅讲了一个关于这些坏事如何发生的故事,最后还提出了行动号召。
And I think also Mike had like a really like, he he not only told us a story about how all of these bad things happen, but also at the end, like, a call for action.
比如,这些是你需要做的事情,以避免这些事情发生在你身上。
Like, this is this is the things that you need to do in order to avoid these things from happening to you.
所以我觉得这对在座的人来说真的很有影响力。
And so I thought that was really impactful for the people that were sitting down in that room.
不错。
Nice.
所以我觉得有一件事,迈克,我不确定你有没有提到,但结果是有些包被注入了恶意代码,然后发布到了 PyPI 上。
So one of the things I think is, I guess, Mike, I'm not sure if you mentioned it, but the result was there were some packages that got malicious code in them and then published a PyPI.
对吧?
Right?
我们知道的就只有一个。
Just just one that we know of.
对吧?
Right?
我们审计了很多攻击者的签名和行为模式。
We we audited kind of a lot of the attacker signatures and kind of their behaviors.
我们只找到了一个。
We're only able to turn up one.
所以,在 PyPI 上我们有超过一百万个用户账户,但只有四个人上了这个钓鱼的当,点击并真的登录了。
So only four of the user accounts of the again, we have over a million user accounts on PyPI right now, but only four people fell for this phishing and, like, click through and actually logged in.
而且只有一个包被窃取并重新发布了。
And only one package was was kinda harvested and and republished.
而且,再说一次,这并不意味着没有创建其他包,你知道,作为备份,但他们针对的是一个依赖的依赖的依赖。
And, again, that doesn't mean that others weren't created, you know, as as a backup, but they went after one that is a dependency of a dependency of a dependency.
对吧?
Right?
他们正在沿着供应链一步步深入。
They're they're working their way through a supply chain.
他们没有针对其他四位——抱歉,其他三位维护者所拥有的任何东西。
They didn't go after anything that that, you know, these other four sorry, the other three maintainers had.
他们针对的是那个中了钓鱼攻击的维护者,而他的包是 Hugging Face 的 transformers 库的一个依赖。
They went after the one the one maintainer who kind of fell for the fish, and theirs was a dependency of Hugging Face's transformers library.
如果你在 AI 领域做任何事情——很多人都在 AI 领域做很多事情——transformers 是关键。
If you're doing anything at all in AI land, which a lot of people are doing a lot in AI land, transformers is kind of key.
它每天大概有三四千万的下载量。
It gets, I don't know, thirty, forty million downloads a day.
而 num two words 是 transformer 的一个子依赖。
And num two words is a sub dependency of transformer.
所以只要发布了num2words的新版本,所有使用Transformers的用户都会受到影响。
So by publishing a new version of num2words, any Transformers user is going to get it.
挺吓人的。
Scary.
确实。
And it's yeah.
你可能会想,我要引入这个依赖,所以你会审查它。
You know, and you maybe think, I'm going to take on this dependency, so you'll review it.
但是依赖链那么深,你能追到多远呢?
But how far down the dependency chain do you follow, right?
我的意思是,答案就像那个电视节目说的。
I mean, answer is, like, you know, what was that TV show?
你是最薄弱的一环。
You are the weakest link.
再见。
Goodbye.
对吧?
Right?
就是说,你的强度取决于链条中最薄弱的一环,而我们都依赖着某些东西、某些人和某些地方。
Like, you're only as strong as as the weakest link in your chain, and we all depend on something and somebody else and somewhere.
对吧?
Right?
没有人是百分之百完全靠自己写所有东西的,连C标准库都不是自己写的。
None of us are writing 100% everything by ourselves based on, like, a c standards library.
比如,你的编译器也不是自己写的。
Like, you didn't write your compiler on your own.
你用的是别人的。
You used somebody else's.
Python语言也不是你自己写的。
You didn't write the Python language on your own.
你用的是别人的。
You used somebody else's.
而且即使你是在编写Python,你也在使用别人写的工具。
And even even if you are authoring Python, you're using tools that somebody else wrote.
你的编辑器不是你一个人写的。
You didn't write your editor on your own.
你的操作系统也不是你一个人写的。
You didn't write your operating system on your own.
再说一次,如果你是那个独自完成这一切的人,我敬佩你。
And again, if you are the one person who has done all of this, I commend you.
我也觉得你付出了很多努力,值得称赞,但在当今世界这并不必要。
I also think you have put in a lot of effort that is commendable, but is unnecessary in today's world.
但你可能因此更安全。
But you are likely more secure as a result.
对。
Yes.
TalkPython的这一部分由我们的AI工具赞助。
This portion of TalkPython to me is brought to you by our AI tools.
你知道那种情况吗?你问AI一个关于Python的问题,它却自信地告诉你十八个月前的库版本。
You know that thing where you ask an AI something about Python and it confidently tells you about the library version from eighteen months ago?
嗯,我们至少为我们的节目解决了这个问题。
Well, we fixed that at least for our shows.
TalkPython和Python Bytes现在都有MCP服务器了。
TalkPython and Python Bytes both have MCP servers now.
连接TalkPython,你的AI就能搜索超过五百五十集的完整转录、每一位嘉宾,以及TalkPython课程的全部课程目录。
Connect TalkPython and your AI can search over five fifty episodes, full transcripts, every guest, the entire course catalog of TalkPython courses.
连接Python Bytes,它就能获取从2016年至今近500集的Python新闻,包括我们曾经在节目笔记中放过的每一个链接。
Connect Python bytes and he gets almost 500 episodes of Python news going back to 2016 including every link we've ever put in the show notes.
这意味着你可以这样说:问TalkPython,Astral加入OpenAI对UV意味着什么?或者Python Bytes对Locust说过什么?然后得到一个真实的答案,带有真实的链接,而不是幻觉。
This means you can say things like ask TalkPython what astral joining OpenAI means for UV or what has Python bytes said about Locust and get a real answer with real links, not a hallucination.
在你的提示中提到我们任何一个节目的名字,你的AI就知道该去哪里找。
Name one of our shows in your prompt and your AI knows exactly where to look.
如果你喜欢在终端里工作,TalkPython现在也有命令行工具了。
And if you live in the terminal, TalkPython now has a CLI too.
一行命令 uvtool install talk python cli,然后搜索剧集、文字记录、嘉宾和课程,甚至都不用打开浏览器。
One line uvtool install talk python cli then search the episodes, transcripts, guests and courses without ever even opening a browser.
它是开源的,输出文本、JSON 或 Markdown 格式,所以也能喂给不支持 MCP 的 AI 工具。
It's open source and it outputs text JSON or markdown so it also feeds AI tools that don't speak MCP.
这就是我真正构建它的原因。
And here's the real reason I built it.
这两个节目涵盖了大约十年的 Python 历史。
Both shows cover around ten years of Python history.
那些人、那些决策、那些占据主导的包,以及那些悄然消失的包。
The people, the decisions, the packages that took over and the ones that quietly didn't.
这种对我们所有信息的增强访问是免费的。
This enhanced access to all of our information is free.
无需账户,无需 API 密钥,无需购买任何东西。
No account, no API keys, nothing to buy.
这些节目中所包含的历史应该为我们所有人所共享。
That history contained in these shows should be there for all of us.
所以去访问 talkpython.fm 和 pythonbites.fm,点击导航栏里的 MCP 链接,马上把它们连接到你的智能体,这样以后任何时候需要它们都能用。
So visit talkpython.fm and pythonbites.fm and click the MCP link in the nav bar, Connect them right now to your agents so that they will be accessible anytime they're needed in the future.
希望大家喜欢这个访问方式。
Hope you all enjoy the access.
看你的演讲时,我想到一个概念,就是依赖冷却期,这个概念现在挺火的。
One thing that came to mind when I was looking at your talk is this whole concept of dependency cooldowns, which is making, you know, some some waves.
我觉得我挺早就注意到了,而且很早就把这个想法分享给大家了。
I think I've I noticed it pretty pretty early in put this up for everyone.
大概在 UV 出现的时候就很早了,我觉得 PEP 也在跟进,还有一些其他的包管理器。
Pretty early, I guess, with UV, and I think PEP is getting it as well, but also some of the other package managers.
但我看到这个概念在其他领域,跟 Python 无关的包管理器里也开始流行起来。
But I've seen it sort of picking up steam in other areas unrelated to Python, other package managers.
是的。
So Yeah.
我,我
I I
我觉得总的来说
think the general
这个想法,真的很喜欢这个想法。
idea really like this idea.
我真的很喜欢。
I really like it.
我觉得,冷却时间对普通用户来说是个好主意。
I think I think cool downs are a good idea for your average consumer.
所以,在另一个我和Seth稍后讨论的话题里,我们谈到那些不使用版本锁定,或者不决定只用1.0.0版本的人。
So in a in a in a different attack that Seth and I talk about later, we we talk about how the people without using version pinning or, you know, deciding I want to use version one point o point o only.
如果你使用不限制的版本,你会得到注册表提供的最新版本。
If you use unbounded versions, you're going to get the latest one that the registry has to offer.
当攻击者想要利用你时,那正是他们想利用的一个途径,他们会说,这些人没有锁定版本。
And when attackers are looking to exploit you, that's kind of one vector they're looking to exploit to say, these people are not pinning their versions.
Numbtowards在transformers中没有被锁定,所以他们会得到最新的版本。
Numbtowards was not pinned in transformers, so they're gonna get whatever the latest one is.
现在,子依赖的版本固定和版本范围限制又是另一套话题了。
Now subdependency pinning and version bounds is a whole other set of conversations.
但作为最终用户,冷却期是最简单的方式,让你可以说,我不想要注册表提供的最新版本。
But as an end consumer, pull downs is the easiest way for you to say, I don't want what the latest the registry has.
我想等三天或七天。
I wanna wait three days or seven days.
因为在这三到七天的时间里,很可能会有一些安全扫描器已经检查过这个版本,如果发现问题就会报告出来。
Because in the scope of those three to seven days, it is very likely that some security scanners will have chewed through this and noticed if there's a problem and reported it.
如果确实发现了问题,那么在那个时间段内,那个版本很可能就无法再下载了。
And if they have, there is a, again, a very high likelihood that that version is no longer avail available for download in that time.
对。
Yeah.
所以,比如你看
So, like If you look
我链接的那个东西是 cooldowns.dev。
at cool the thing I'm linking to is cooldowns.dev.
这里头就指出了,它到底管不管用?
And in here, it pointed out said, does it actually work?
然后他们给了一些数据。
And they gave some stats.
你知道,他们提到Light LLM,还有其他一些出现的问题。
You know, they talk about Light LLM, some of the other issues that have come along.
他们说,我觉得大概一周内,90%的有漏洞的包都被下架了,而且大多数在一天内就下架了,差不多是这样,对吧?
They said, I think within a week, I think 90% of the vulnerable ones were taken down, and most of them were taken down within a day, or something like that, right?
对。
Yeah.
我的意思是,PyPI上很多这种情况都得感谢我们那帮志愿者举报者。
I mean, a lot of that on PyPI is thanks to our group of volunteer reporters.
我们之间没有任何商业关系。
And we don't have any kind of commercial relationship.
就是社区里有些人喜欢扫描这些东西。
There's just people out there in the community who like scanning stuff.
有些公司确实会这么做。
There are businesses who do it.
其中一些会向PyPI报告,说,嘿。
And some of them will report back to PyPI and say, hey.
我们发现了可疑的东西,有问题的东西。
We found something fishy, something smelly.
我们建议你们看一下。
We recommend you take a look.
有些人报告得非常准确,几乎零误报,所以我们允许他们在PyPI上将其标记为自动隔离状态,这需要像我这样的人来审查,要么放行,要么彻底下架。
Some of these folks have gotten such a very good, or almost zero false positive rate that we kind of allow them on PyPI to put that into an automated quarantine status that requires a human like myself who, to review it and either clear it or or tank it completely.
但在那个中间状态,它就不再可下载了。
But in that interim state, it's no longer downloadable.
所以,我们最著名的例子是卡米尔·穆恩科夫斯基,他在奥地利工作,他的报告通常在发布后三十分钟内就能出来。
So those, like, our most notable one is, Kamil Munkovsky, who works out in Austria, and he has gotten it down to like, his reports are often within, you know, thirty minutes of publish.
他的工具会扫描、分析并报告,而且零误报。
His tooling has scanned it, analyzed it, and reported it back with zero false positives.
而且,你知道,这需要时间和经验的积累,而他完全是自愿做的。
And, you know, that only comes with duration and time, and he's doing this as a volunteer effort.
所以,真的要给卡米尔点赞。
So kudos out to Kamil.
那要处理的数据量可真大。
That's a lot of data to be processing.
对。
Yeah.
我也想说说关于冷却期的那部分,比如,这到底是为谁设计的?
I wanted to comment on the cool downs aspect too, like, maybe about, like, the who is it for?
因为我觉得,在Python这种规模上做东西,总是会遇到一个挑战,就是它服务了太多不同的社区和人群,对吧?
Because I think this this is always a challenge whenever we're building something at the scale of Python, right, where it serves so many different communities and people and right?
比如,你可能是大型组织里开发团队的一员,你们有自己的安全团队来决定安全策略。
There's people that have you're on a developer team in a really large organization, and you have your own, like, security team who is deciding what your security policies are.
他们运行着PyPI的镜像。
They're running a mirror of PyPI.
对吧?
Right?
所有这些都在发生。
Like, all this stuff is happening.
但Python也需要服务于学生或者那些第一次接触编程的人。
But then Python also needs to serve students or people who this is their first programming language.
我的想法是,这种配置你设置一次,之后就不用再操心,而且能受益于PyPI上已有的庞大体系,比如那些扫描的人、手动审查并下架的人,还有Mike的所有工作。
And my thinking is is that this sort of config where you set it once and then you don't have to think about it and you benefit from this large apparatus that already exists out there in PyPI, people that are scanning, people that are manually reviewing things, taking them down, all of Mike's work.
对吧?
Right?
你就能从所有这些工作中受益,而不需要自己组建庞大的团队或制定政策,也不必非得审查每一个依赖。
Like, you get to benefit from all of that work without having to have this massive, you know, separate team or policy or having to necessarily think about, like, reviewing every single dependency.
对吧?
Right?
我觉得很多开发者,尤其是学生,并没有这样做。
Like, this is something that I don't think that a lot of developers are doing, especially not students.
对吧?
Right?
他们想运行pip install,安装他们需要的包,要么是为了课程,要么是因为他们在学习。
They they want to run PIP install with the thing that they want to install either for their course or because they're learning.
他们不一定想到,哦,这可能是恶意软件安装到我系统上的一种方式。
They're not necessarily thinking about, oh, this is potentially a way that malware is gonna be installed on my system.
所以设置一个非常严格的,比如七天的冷却期,设置一次,然后你就基本安全了。
So set, like, a really aggressive, like, seven days or something like that on your cool down one time, and then you're pretty okay.
我觉得很多人应该使用冷却期,尤其是对于开发机或者个人电脑,你在上面运行Python,没有庞大的安全应用体系为你工作。
Like, I think a lot of people should probably be using cool downs, especially for, like, developer machines or a personal machine that you're running Python on where you're not you don't have this giant security app aratus working for you.
是的。
Yeah.
我想补充一下,很多使用Python包的人根本不知道PyPI是什么,这些包从哪里来,pip install是什么意思,所以有像……说真的,但当我开始做这些事情的时候,我完全不知道。
I wanna I wanna second that and and say that a lot of the people that use Python packages have no idea of what is PyPI, where they're coming from, what does pipping style mean, and so having like and like like seriously, but but when I started doing all of these things, had no idea.
我只是运行命令,在Reddit或其他地方读到的,我觉得有一些默认的安全措施,比如在我的开发环境中,我认为这很棒。
I was just running commands that I was reading somewhere in Reddit or somewhere else and and I think just having some like default ways of keeping security like, in my own developer developer environment is I think it's it's great.
对于最没有经验的开发者来说,这绝对更有用。
For for the most unexperienced developers, this is definitely more useful.
对。
Yeah.
我觉得这是个好主意。
I think it's a great idea.
我真的很喜欢这个想法。
I I really like the idea.
所以我在某种程度上采用了这个做法,我觉得它很棒。
So I I adopted this to some degree, and I thought it was amazing.
然后我遇到了一些问题,我很想听听你的看法。
And then I ran into some problems, and I I love to hear your thoughts on this.
所以,我没有固定依赖版本,但我用 UV PIP compile,它会说更新一下,然后说,好的。
So one of I don't have unpinned dependencies, but I use UV PIP compile, which will say with that update and say, okay.
好吧,我现在已经决定了。
Well, I it's I've decided now.
我打算发布一个新版本。
I'm gonna release a new version.
我们继续做一下依赖的刷新更新,然后重新编译,它会重新固定到最新的版本。
Let's go ahead and do, like, a refresh of the update of of the dependencies and recompile, and it'll re pin them to the newest.
对吧?
Right?
如果没有这个冷却期,它就会固定到最新的版本。
And without this cooldown, it'll pin them to the very latest.
所以如果某个东西在一小时前被推送到 PyPI,而我运行了那个命令,那我还不如不固定依赖。
And so if for some reason something were to get pushed into PyPI in an hour ago, and I ran that command, well, I might as well have unpinned dependencies.
对吧?
Right?
所以我打算用 uv pip compile,加上那个命令,比如 exclude newer one week。
So I I'm gonna put u v pip compile dash dash, like, wait, whatever the command is, exclude newer one week.
我甚至把它放到了所有服务器相关的 Docker 构建中,这样如果结合 PIP audit 和这个,Docker 构建就会失败。
And I even put it into the Docker build for all of my my server stuff so that the Docker build would fail if using a combination of PIP audit and this.
所以如果有CVE,构建就会失败,因为某个包有问题。
So if there's a CVE, it will fail because there's a there's a problem with one of the packages.
然后我会用这个,这样就不会拿到旧版本了。
And then I would use this so I wouldn't get older ones.
但我遇到的问题是,某个东西有CVE,然后它会回溯到七天前,而修复版本可能只晚一天发布。
But here's what I ran into is there would be CVE in something, and then it would it would window into the seven days ago, and the fix would be, like, one day later.
但它不允许安装没有CVE的那个版本,因为那个版本被排除在较新版本之外。
But it wouldn't allow it to install the one without the CVE because that was excluding newer.
所以最后我不得不忽略这个,忽略那个,你懂我意思吗?
And so then I end up with all of these, like, x ignore this one because this one you know what I mean?
就像这两件事在互相冲突。
Like, it's these two things clashing.
有点像,一个包说某个依赖的版本必须大于2,另一个说必须小于2。
It's kind of like one package says version has to be greater than two on a dependency, and one says version has to be less than two.
你就会想,那我现在该怎么办?
You're like, well, now what do I do?
对。
Yeah.
迈克尔,你正好说到了为什么我至少现在很难推动把依赖冷却时间设为默认值。
Michael, you're you're touching on the exact reason why I would have a hard time, at least right this moment, pushing for dependency cooldowns to be a default.
这会让用户感到困惑,尤其是当有其他系统告诉他们需要解决问题,而他们运行那些他们知道有效的命令时——比如之前用来升级依赖到特定版本之类的——这些命令却不起作用。
It confuses users, especially when there are other systems that are telling them that they need to resolve a problem and when they run commands necessary that they know work because they've used them before to upgrade a dependency to a specific version or whatever, they don't work.
或者他们会说,哦,那个版本不存在,因为PyPI实际上把这些版本从候选池中移除了,诸如此类。
Or they'll say something like, oh, that version doesn't exist because PyPI is literally dropping these versions from the candidate pool or something like this.
对吧?
Right?
它会说那个版本不存在,然后你就会看到这些非常令人困惑的消息。
It'll say that version doesn't exist, and you get these really confusing messages.
我的意思是,有一天我确实希望有某种东西。
I mean, one day I do I I would really like to have something.
不一定非得是冷却时间,但某种系统,默认情况下,如果你没有——我喜欢这样想——如果你没有通过你的工具使用来展示你是否具备运营成熟度,这就是我的看法。
It doesn't necessarily have to be cool downs, but some sort of system that the default is if you are not the way I like to think about it is, like, if you are not showing through your tool usage, whether or not you have, like, operational maturity is kind of how I think about it.
对吧?
Right?
比如,你没有用镜像,直接装最新的。
Like, you're not using a mirror, you're installing direct from latest.
如果你没有表现出那种操作成熟度,比如要求锁定版本或指定确切版本之类的,那么就需要某种安全默认设置。
If you're not showing that sort of operational maturity, like asking for a lock or an exact version or whatever, then there is some sort of secure default.
但这个安全默认策略需要考虑很多因素。
But that secure default policy needs to take into account a lot of things.
其中一个因素就是,安全漏洞是否在冷却期或审查期内被修复。
And one of those things is whether security vulnerability is being fixed by something that is within this cool down window or reviewing window.
如果索引端能多做这类事情,也许会更简单。
And maybe this can be easier if there's more of this happening kind of on the index side.
就像现在,PyPI 基本上是你上传后立即可用,对吧,扫描是事后才做的。
Like right now, PyPI is mostly you upload it, it's immediately available, right, and the scan comes after the fact.
没有中间审查步骤,因为我们做不到。
There's no intermediate step where it's being reviewed because we just can't.
量太大了。
There's too much volume.
所以如果我们能达到那种状态,也许工具就能更容易地实施这类策略,因为大部分工作会在索引端完成。
And so if we get to a world where that is happening, maybe tools can implement this sort of policy a little bit more easily because it'll be, for the most part, on the index side.
但从工具的角度来看,要默认做到安全,并且完美兼顾所有这些使用场景,真的很难。
But from a tool perspective, it's really difficult to get a secure default that take and respects all of these use cases perfectly right as a default.
这非常具有挑战性。
It's very challenging.
你的意思是,我们需要雇更多的人,在软件包发布之前进行扫描。
What you're saying is we need to hire a lot more people to scan packages before they get published by BI.
这就是你说的。
That's what you say.
对吧?
Right?
我接受邮件建议。
I'm open to emails.
没错。
That's right.
有兴趣解决这个问题的朋友,可以发邮件到 Seth@python.org。
Email email Seth@python.org for for any interested parties of solving this issue.
确实。
Indeed.
所以,迈克,你之前提到过API密钥,它们有点像超出了双因素认证等范围。
So earlier, Mike, you talked about API keys and how they're kind of outside the bounds of, you know, two factor and so on.
接下来这个演讲是关于零信任在200毫秒内,每笔交易的身份验证,由Tristan McKinnon主讲。
So the next talk was zero trust in two hundred milliseconds, identity per transaction with Tristan McKinnon.
这来自Fiedleramp,这是美国政府的项目,即联邦风险和授权管理计划,提供安全和风险等方面的解决方案。
And that comes from Fiedleramp, which is a US government thing, the federal risk and authorization management program that provides approach to security and risk and so on.
如果我没记错的话,这有点像零信任的故事,每次需要使用API密钥时,都必须获取一个新版本的API密钥。
And if I recall correctly, this is kind of a a zero trust story where it's every single time you need to use an API key, you have to get a new version of API key.
比如,我想和AWS对话。
Like, I wanna talk to AWS.
太好了。
Great.
这里有一个你可以用两秒钟的密钥之类的。
Here's a here's a t a key you can use for two seconds or something.
对吧?
Right?
现在就用它。
Use it now.
是的。
Yeah.
你对这个有什么看法?
What are what are your thoughts on this?
从这个演讲中你得到了什么启示?
What are the takeaways from this one?
有人吗?
Anyone?
你觉得怎么样?
How do feel about it?
好的。
Alright.
我本来想说,我们都在互相配合。
So I was gonna say, we're all playing at each other.
我真的很喜欢这个演讲,因为它谈到了Python和开发中很多人不一定经历过的一面,那就是你在一个受监管或需要实施FedRAMP的行业工作,对吧?
I I really love this talk because it talked about a side of Python and development that a lot of people don't necessarily experience, which is where you work in an industry that's regulated or needs to implement FedRAMP, right?
这需要大量的额外工作。
It is a ton of extra work to do this.
而且很多时候,网上很少讨论这些,因为就像你说的,做这类工作的不一定是开源社区。
And a lot of times it's not really talked about a lot online because, like you said, that's not necessarily open source communities that are doing this sort of work.
主要是行业在做这些事情,所以看到这样的演讲真的非常棒,你谈论的是FedRAMP合规和Python中的零信任,以及人们已经使用的各种工具。
It's mostly industry that is doing these things, and so it's really, really great to see this sort of talk where you're talking about something like FedRAMP compliance and zero trust in Python with a lot of different tools that people already use.
比如使用AWS SDK,以及如何用AWS实现这一点,然后将其推广到其他不同的后端。
So using the AWS SDK and how to implement this with AWS and then extrapolating that out to other different back ends.
对吧?
Right?
所以它是与后端无关的。
So it's back end agnostic.
因为这个原因,我真的很喜欢这个演讲。
I really enjoyed this talk because of those reasons.
这些内容在PyCon或开源会议上通常看不到,人们谈论联邦政策要求以及如何实施这样的安全控制。
This is just stuff that you don't necessarily see at PyCon or at, like, open source conferences, people talking about federal policy requirements and how to implement secure controls like this.
所以这真的是一个非常有趣的演讲。
So really, really interesting talk.
是的。
Yeah.
这确实是一个你平时看不到的领域,而且,是的,这挺酷的。
It is a bit of a look in an area that you don't normally see, and, yeah, it's quite cool.
下一个演讲是关于Rust的,由Emma Smith主讲。
This next the next one is Rust, and this by Emma Smith.
这个演讲确实很有意思,因为你可以从技术角度去讨论它,但你也得从组织层面去考虑,等等。
And this one certainly it's it's interesting because it's you can debate it technically, but then you also have to debate it from a organization perspective and and so on.
它的想法是,如果我们能用 Rust 写更多的 CPython 会怎么样?
And the idea is what if what if we could have more of CPython written in Rust?
对吧?
Right?
但是很多在 CPython 上工作的人,嘿。
But a lot of the people who work on CPython hey.
猜猜那个名字是什么?
Guess what's what is the name there?
就像,CPython 这个语言本身是 C 开发者,他们不一定想用 Rust 重写,也不一定有这方面的专长,还有一大堆类似的事情。
Like, CPython as in the language are c developers, and they don't necessarily wanna rewrite stuff in Rust, and they don't necessarily have an expertise in it, and a whole bunch of things like that.
所以第一,对演讲的看法。
So one, thoughts on the talk.
第二,对 Rust 和 Python 的看法。
Two, thoughts on Rust and Python.
我想谈谈我对这个演讲的看法。
I want to give my thoughts on talk.
我觉得,我非常喜欢这个演讲,原因有两个。
I think I think I love this talk for two reasons.
第一个原因是,这是在Python大会上关于Rust的演讲,这显示了这两个社区之间的交集。
The first one is, it was a talk about Rust in a Python conference, which shows the intersection between these two communities.
而且我觉得,Emma在解释迁移的技术影响以及我们为什么需要这样做方面做得非常好。
And I think, I mean, I think Emma did a great job of explaining like the technical implications of the migration and like of why we need to do this.
但同时,她也非常清楚地说明了从社区角度来看这意味着什么。
But at the same time, she, I think she she was very clear about what this means from like a community perspective.
而且我认为,演讲的一部分实际上是在讨论我们如何才能真正实现这一点,不是从技术角度,而是从组织人员、让大家同意这样做以及如何实现的角度,我觉得这与开源以及开源运作的方式非常契合。
And I think part of the talk was actually talking about how can we actually make this happen, not from a technical perspective but like from organizing the people and like actually getting the people to to like agree with doing this and like how do we make this happen, which I think is very like on point with open source and how open source works.
就像你不能仅仅做一个决定,然后就改变你正在做的事情的方向。
Like you don't like you don't just make a decision and, like, take a different path on something that you're doing.
因为有很多人参与特定社区的决策。
Like, there's a whole lot of people that are involved in making decisions for a specific community.
而且我觉得艾玛在阐述开源社区这个特定方面如何运作时,做得非常出色,尤其是在这次演讲中。
And I think Emma did a great job of illustrating how that specific aspect of open source works with particular talk.
所以我非常喜欢。
So I loved it.
我的一大亮点是,维多在现场,他最后向艾玛问了关于这次演讲的问题,我当时就想,让PyCon的创始人来问关于你演讲的问题,是不是很酷?
And one of my highlights was that Widow was there and he ended up asking questions to Emma about this particular talk and I was like, isn't it cool that you have the creator of PyCon asking you questions about your talk?
那是我最难忘的时刻之一。
That was that was one of my highlights.
对。
Yeah.
从安全角度来看,我对这个想法非常感兴趣。
From like a security so I I am very intrigued about this idea.
这听起来合理,但就像你说的,从社会层面来说,极具挑战性。
I it it makes sense, but it's also, like you said, like, in a social sense, extremely challenging.
而且即使在技术层面,这也是极具挑战性的。
And also, even in, like, a technical sense, it's extremely challenging.
对吧?
Right?
这可不是个简单的项目。
This is this is not an easy project.
我觉得,当人们想到用 Rust 重写这些东西的时候,对吧,这几乎像个玩笑,对吧,你可以说,哦,就用 Rust 重写吧,而且,哦,Rust Python 已经存在了。
I think that there's maybe when people think about rewriting in Rust and all of this stuff, right, it's almost kind of like a joke, right, that you can, oh, just rewrite it in Rust and, oh, Rust Python already exists.
为什么这会难呢?
Why why would this be hard?
对吧?
Right?
就像,这已经存在了。
Like, this already exists out there.
而且这非常难。
And it is extremely difficult.
我很期待在 Europython 的语言峰会上讨论这个。
I am really excited to talk about this at the language summit at Europython.
那里也有一个演讲。
There's a talk there also.
我觉得Emma和整个Rust for Python团队的任务很艰巨。
And I think that Emma and the whole team that's working on Rust for Python have their work cut out for them.
这将是一个漫长的过程。
It's gonna be a long journey.
从技术角度来看,我认为他们选择先攻克哪个库的决定非常明智,他们选择了zlib,这是一个大家比较熟悉的压缩库。
Talking about just the technical aspect of this, I think that they have made a really great choice in which library they've decided to potentially attack first as a first go, which is zlib, which is a compression library that's pretty understood.
它处理很多不可信的数据。
It processes a lot of like, untrusted data.
对吧?
Right?
所以,这里涉及到内存管理和内存安全漏洞的问题,虽然zlib在这方面的问题不算特别多,但作为第一个模块来攻克确实是个很好的选择。
So, like, there's the memory management, memory of security vulnerability aspect, not necessarily that, like, zlib has had a ton of issues in that area, but it's, like, a really good one to attack as a first module.
是的。
Yeah.
我,我打算
I'm I'm gonna be
那跟我们说说,他们具体提议要做什么?
So tell give give us an idea of exactly what they're proposing here.
是不是说,标准库里现在有些模块是纯Python或C写的,他们提议用Rust重写一部分?
Is this like, there are portions of the standard library that right now are pure Python or c, and we propose rewriting some of them in Rust?
目前的提议是先重写标准库里的一个模块,用Rust,长期目标可能是重写更多,甚至语言本身的部分也用Rust重写。
So the proposal right now is to rewrite a single standard library module in Rust with the long term goal being maybe more and even potentially the, like, parts of the language being rewritten in Rust.
所以,比如,我记得好像是,合法的。
So, like, the I believe it was, like, legit.
那个即时编译器是另一个候选,算是个大项目,或者,你可以先拿这个练练手。
The just in time compiler was another candidate for, like, a larger project or maybe, like, a here, you can cut your teeth on this.
我们不会合并它,但这样可以验证一下相关的工具链,比如把东西编译成Rust,然后实际能不能用,作为一个选项。
We won't merge it, but we'll it'll it'll prove out whether or not the tooling that's around this, like, compiling stuff to Rust and having it actually work for would work just as an option.
这个之前也讨论过,所以这事已经持续挺长时间了。
This got discussed a while back too, and so this has kind of been ongoing for quite a long time.
所以我真的很兴奋,这次演讲是艾玛和团队第一次露面,跟更广泛的社区说这件事正在发生。
And so I'm really excited that this talk this is kind of the first time that Emma and the team have poked their head out and be like, talk to the wider community about this is happening.
我们在讨论这个以及它可能意味着什么。
We're discussing this and what it could mean.
但是,是的,我觉得前面还有很长的路要走。
But, yeah, it's gonna be a long road ahead, I have a feeling.
对。
Yeah.
好的。
Alright.
接下来,是《Asleep at the Wheel:Python 构建的 SBOM》。
Next up, Asleep at the Wheel SBOMs for Python Builds.
演讲者是 Sanchit Sahay 和 Abhishek Reddypalle。
Sanchit Sahay and Abhishek Reddypalle.
抱歉,刚才有点问题。
Sorry about that.
对。
Yeah.
那么,SBOM。
So SBOMs.
各位,对SBOM有什么看法?
What are the thoughts on SBOMs, folks?
我们需要更多。
We need more of them.
是的。
Yes.
而且更好。
And better.
要准确。
To be accurate.
没错。
Exactly.
说实话,我本来只想简单说一句,我为这个演讲感到非常自豪,因为Abby和Sanchit都是学生。
I think honestly, I was just gonna comment really quick that I was very proud of this talk because because Abby and Sanchit are both students.
他们都是,嗯,我觉得Sanchit是硕士生,Abhishek是博士生。
They're both well, I think Sanchit is a master student, Abhishek's a PhD student.
作为博士生,我很喜欢看到人们在非学术会议上做的研究。
And as a PhD student, I I love to see the research that people are doing in conferences that are not academic conferences.
我觉得他们在发展自己的研究方面做得非常好,同时也与外部社区互动,想办法让他们的工具可用、好用。
And I think they have done a really good work on developing their research, but also interacting with the outside community to figure out how to make their their tools available and usable.
我很喜欢他们把项目纳入开放SSF这样更大的生态系统,因为这表明他们想确保自己做的任何东西都是真正可用的,是的。
I love that they have made their project part of the open SSF, like, bigger ecosystem because that kinda shows how they want to make sure that anything that they're doing is actually usable and yeah.
这不仅仅是一篇关于抽象、不切实际的东西的论文,而是社区真正可以使用和采纳的东西。
Like, it's it's not just a paper about something that's very abstract and not really relevant, but, like, it's actually something that the community can use and adopt.
所以,我真的为这个演讲感到骄傲。
So I'm I'm really proud of this talk.
对。
Yeah.
我想补充的是,这个演讲让我真正明白了SBOMit是什么,真的非常酷。
I was gonna add that this talk is the talk that showed me what SBOMit actually was, which is really, really cool.
我之前听说过它。
I'd heard of it.
大概知道它是什么意思。
I kind of knew what it meant.
对吧?
Right?
这类东西太多了,安全工具和方法多得让人应接不暇,你往往只是知道有这个东西,知道什么时候可能需要深入了解,但不知道冰山有多深,也不知道要让它像魔法一样工作,记录构建过程中发生的所有事情——所有网络调用、所有命令调用——然后导出成SBOM,同时还要生成一个可验证的记录,我记得是用Intoto做的,这背后需要付出多少努力。
It's one of these things where there's just so many security tools and approaches and so much area to cover that you kind of like end up knowing about something and you know when you'd maybe reach over there to learn more, but you don't know how deep the iceberg goes, right, and how much work had to go into making this basically work like magic to record all of the stuff that happened during your build, all the network calls, all the command invocations, and how it gets then exported into an SBOM, but then also this verifiable record using, I believe it's called Intoto.
这就是SBOMit中IT的含义。
That's what the IT is in SBOMit.
而且,它是如何端到端工作的。
And, like, how it all works end to end.
这让我不禁想到,如果我们发布这个,比如为PyPI建一个构建农场,如果我们真的做那个项目,我们就会想到这个,然后说,也许我们可以把这项技术整合进去。
And so it just gets my mind thinking about, like, if we were to release this, like, either, like, a build farm for PyPI, if we ever to work on that project, this is the sort of thing that we would, like, reach for and say, like, okay, maybe we could integrate this technology into that.
或者如果我们打算做一个推荐的构建工具,比如一个用于构建的Docker镜像,那这个技术可能就会成为其中的一部分,用来记录网络调用,最后得到一份非常准确的软件物料清单,展示软件包是如何构建的,然后你可以把它和软件包一起发布,或者作为用户使用它,随你怎么用。
Or if we were going to create a, like, a recommended builder, like a Docker image that did building, like, this would potentially be a part of that story where you're recording network calls and then you can get this extremely accurate software bill of materials document at the end that shows how a package was built and then you can have that be published with the package or you can use it as a user, however you wanna use it.
这类信息非常重要,而且事后很难获取,不像在构建过程中,当实际程序在进行安装和构建时那样容易记录。
Like that sort of information is really important and it's really difficult to get after the fact as opposed to, like, when it's in flight and when the actual programs are doing the installations and the builds and all of that.
所以我想你提到了
So I think you mentioned
哦,抱歉。
oh, sorry.
请继续,Renee。
Go ahead, Renee.
我刚才想说,这个演讲确实很好地让人们意识到,目前生成SBOM的工具并不那么准确,而且要让SBOM在安全角度真正可用,还有很多工作要做。他们在提高意识方面做得很好。
I was just gonna say that this stock actually did a very good job of making people aware that the current tools that generate SBOMs are not as accurate and there is still a lot of work needed to make SBOMs like actually usable for like within like a security perspective and they did a great job of just making awareness.
而且他们还勇敢地做了现场演示,现在人们都不做演示了,因为容易出错,但他们做了,而且成功了。
And they also were brave enough to do a demo, which is like like people people now don't do demos because they all break, but they did a demo and it worked.
那真的很酷。
That was really cool.
太酷了。
Very cool.
赛斯,你之前推测可能有一个神奇的过程,涉及冷却时间、固定依赖和审查,也许SBOM可以作为其中的一个输入,用来表明:这个没问题,但在供应链的某个地方有一些源代码,我们发现它其实是有问题的。
Seth, you theorized there might be some magical process involving cool downs and pin dependencies and review, and maybe SBOMs could be an input to that to say, well, this ain't got no problem, but has some source down, you know, in the supply chain that actually we've discovered is problematic.
所以所有下游的东西,我们都需要检查或标记,或者做其他处理。
So everything downstream from that, we can we need to, like, check or flag or whatever.
对。
Yeah.
是的。
Yeah.
SBOM,我理解SBOM主要是作为这样一个第三方的东西。
SBOM the way I think about SBOM is mostly as just this, like, third party.
它不是某个生态系统的一部分,所以它对Python特别适用,因为我们有很多Python包不仅仅是Python。
Like, third it's it's not a part of an ecosystem, so it works really well for Python because we have so many, like, so many Python packages out there are not just Python.
还有C、Fortran、Rust、JavaScript,所有这些不同的生态系统。
It's like C, Fortran, Rust, JavaScript, all of these different ecosystems.
对吧?
Right?
所以GPU就是着色器。
So GPU that's shaders.
GPU着色器。
GPU shaders.
把它们也放进去。
Throw them in there.
为什么不呢?
Why not?
我是说,Mike比我更了解这个。
I mean, Mike knows this even more than I do.
比如,还有视频。
Like, there's video.
PyPI上真是有各种各样的好内容。
It's just all sorts of great great content on PyPI.
对。
Yeah.
不是说我们鼓励那种用法。
Not that we encourage that use case.
Python 包里有很多东西,而 SBOM 是表示所有这些软件来源的好方法,而且不局限于 Python。
There's a lot of stuff in Python packages, and SBOMs are a great way to represent the providence of all of that software without it being Python specific.
确实。
For sure.
好了。
Alright.
我们得加快速度了,因为还有几个要过。
Picking up speed because we got a couple more to go through.
我们这里可能还有后续的,或者说事后的情况。
We've got maybe the the the follow on or the after after case here.
这是由 Hala、Ali 和 Andrew Case 做的,从 Python 内存生成事后运行时 SBOM。
It's post incident runtime SBOM generation from Python memory by Hala, Ali and Andrew Case.
总体思路是,你声明的供应链输入是一回事,而实际存在的又是另一回事。
And the general idea is there's what you've declared to be your supply chain inputs, and then there's what's actually there.
所以,也许看看内存里加载了什么,然后你会想,哦,为什么这个库也被加载了?
So maybe look at what is loaded into memory, and you're like, oh, why is this library also loaded?
或者某个黑客类的东西被放到了机器上,然后被加载了,现在我们可以通过查看加载的模块等来检测到这一点。
Or some other hacker type of thing got put on the machine and then loaded in, and now that's now we can detect that through this this generation of looking at, like, loaded modules and so on.
对吧?
Right?
是的。
Yeah.
这个,我真的很感兴趣,因为它深入到了Python内存管理、模块加载和函数调用的细节,非常深入。
This one, I was really intrigued about this because it went so deep into Python memory management and how modules are loaded and how functions are called, like, extremely deep dive into this topic.
所以我看这个演讲时,超级……我真是看得入迷了。
And so I was, like, super I was, like, in awe watching this talk.
我当时想,怎么一直有这么多酷炫的东西出现。
I was like, there just kept on being more cool stuff happening.
所以我当时就在看运行时分析。
And so I was, like, looking at, like, a runtime analysis.
你可以看到哪些函数正在被调用。
You can see what functions are being called.
你可以看看某个CVE是否影响了你的程序。
You can like, to to see whether or not, like, a CVE is affecting your program.
所以你可以在程序运行时实时检查它,然后
So you can, like, introspect your program live while it's running and
看看是否
see whether or not,
某个东西真的在被使用。
like, something is even being used.
你甚至不需要查看源代码来检查什么的。
You don't even have to, like, look at the source code to to to check or whatever.
你只需要看看你的程序,看它是否在使用代码。
You just look at your program and see if it's using code.
对。
Yeah.
对。
Yeah.
因为如果你真的去查,而且我没有,我可能以后会知道得更多。
Because if you if you bother and I don't I I didn't maybe I'll know better than I do.
但如果让我猜的话,我觉得不到1%的人会在代码上真正运行PIP audit或者UV PIP audit之类的,UV audit,不管是什么。
But if I were to speculate, I'd say less than 1% of people actually run PIP audit or UV PIP audit sort of thing, UV audit, whatever it is, on their code.
但即使你做了,或者你看了CVE,发现了一个,或者Dependabot告诉你,哦,你的某个依赖有CVE。
But if even if you do or you look at the CVE and you see one or maybe maybe get Dependabot tells you, oh, there's a CVE in one of your dependencies.
你最好去修复它。
You better go fix it.
然后你得去看看,说,这真的重要吗?
And then you gotta go look and say, does it really matter?
比如,我记得在我用的一个包里,它说,哦,在Windows上,如果你接受不可信输入,而且它是PDF,并且是这样,它就会做这个,你知道,可怕的事情。
Like, I remember one in one of the packages I was using, it said, oh, on Windows, there's this issue that if you take untrusted input and it's a PDF and it's this way, it's gonna do this, you know, terrible thing.
我就说,对。
I'm like, yeah.
但我的部署目标是 Linux 上的 Docker,我的开发机是 Mac,而且我觉得我根本没有接受过任何不可信输入。
But it's my deployment target is Linux on Docker, and my dev machine is Mac, and I don't think I've taken untrusted input whatsoever for this.
所以我干嘛要在乎呢?
And so don't do I care?
我真的不在乎。
I don't really care.
你知道吗?
You know what?
我就不去管它了。
I I'm just gonna not worry about it.
但 PyPI 会填满我的构建,然后我们又回到依赖、冷却时间那些问题上了。
But PyPI will fill my build, and then we're back to the depend the the the cool downs and all that.
但不管怎样,我觉得这就是问题的一部分。
But, nonetheless, it's like, I think that's part of the problem.
而且,如果你能想办法把CVE和那个结合起来,比如说,实际上,我可以验证它不会碰到那段代码。
And the fact if you could say somehow combine the CVE and the say, actually, I can verify it doesn't touch that bit of code.
那真是太酷了。
That's super cool.
对。
Yeah.
在这方面,我觉得有一个持续的努力,通过开源漏洞数据库来提供更丰富的细节,比如受影响的代码路径。
On that front, I think there's a a an ongoing effort through the, open source vulnerability database to surface more rich details as to, like, code paths that are affected.
这样你就可以自动审计,我是否使用了那些代码路径?
So that way you could automatically audit, do I use those code paths?
然后据此决定你的构建是失败还是不失败。
And then thus either fail or not fail your build.
但再说,在像Python这样使用动态特性的语言里,要准确表示我是否使用了那条代码路径,往往是一个更难回答的问题,因为你甚至不一定需要通过import语句来导入库。
But again, in languages like Python where dynamicism is used, getting that an an accurate representation of am I using that that code path is often a harder question to answer because you don't necessarily even have to import the library via an import statement.
你可以使用importlib。
You can use import lib.
你还可以做各种其他不同的事情。
You can do all sorts of other different things.
所以挑战在于,我们如何提供足够的信息,让你做出自信的决定,同时又不误导你走上错误的道路?
So the the challenge is how do we surface enough information for you to make a confident decision without misleading you down down the wrong path?
确实。
Indeed.
我们继续吧,因为时间不等人。
Let's keep moving on because time and time is a ticking.
下一个话题是安德鲁·内斯比特讲的GitHub Actions安全性和Python包。
The next one is GitHub action security and Python packages by Andrew Nesbitt.
是的。
So yeah.
太吓人了。
Terrifying.
有些东西真的很奇怪。
There's some really weird stuff.
关于 Bayt 播客
Bayt 提供中文+原文双语音频和字幕,帮助你打破语言障碍,轻松听懂全球优质播客。