Podcast Lookup

Episode 784 transcript

FLOSS Weekly

  • May 22, 2024

About this episode

FLOSS-784

Jonathan: This is Floss Weekly, episode 784, recorded Wednesday, May 22nd. I'll buy you a poutine. Hey, this week Dan Lynch joins me and we talk with Francois Proulx about Poutine. That's an open source project from Boost Security. It is a code analysis tool looking for security problems in your GitHub and GitLab CI actions.

Things like leaking secrets or cash poisoning, or maybe even something worse than that, you don't want to miss it. So stay tuned.

Hey everybody. Welcome. It is time for floss weekly. That's a show about free Libre and open source software. I'm your host, Jonathan Bennett, and we've got, we've got Dan, the man, method, Dan, the, the one and the only with us today the original Linux outlaw, is that, is that right? Dan, I call you that sometimes that's accurate, isn't it?

Dan: I like to think so. I'm not entirely sure, to be honest. I'm sure there's a lot of other much older Linux outlaws than me who would, who would claim, would claim that. But yeah, I'm going to claim it. Why not? Nobody else did.

Now the real question, I suppose,

Jonathan: is have you ever actually been an outlaw?

Dan: Have I ever been an outlaw?

Only speeding offenses really in the car. I've, I've been, I've been on a few speed awareness courses for the for the local police, but only a couple. In 20 years. That's not bad. That's not bad. That's not too bad.

Jonathan: Well, we've got a we've got a fun show today. We're going to talk with Francis Pruhl about, about a project called Poutine, which, that is a, that is a Canadian it's kind of a Canadian junk food.

Is it a junk food? Maybe it's not a junk food. But it's, it's a particular type of food that is, apparently very messy to eat. And so that's sort of the play on words. Poutine is about figuring out a particularly messy security problem. And this is a project done by Boost Security, and they just recently announced it and made it open source.

And I thought it was neat. So I was, I was excited to be able to talk to him about this. Is, is this something you've gotten a chance to look into yet, Dan?

Dan: Only today. I've been doing my research today after you helpfully sent me some pointers. I've been on reading some reading some stuff about this.

I suppose the real question is, have you ever had poutine itself? Cause I have the the food. I mean, it's really good. It's very interesting. The unfortunate thing

Jonathan: is that it is now on my I cannot eat that list. I recently got diagnosed with Hashimoto's, which is a thyroid problem. And one of the most common solutions is going gluten free.

So I am going down that road to see if that's going to help. And yeah, so there's a lot of, there's a lot of junk food that I used to enjoy. That's like, I can't have that anymore because it's trying to kill me.

Dan: You need to find new ones. I'm sure you'll find new ones.

Jonathan: Oh, I'm sure I'm sure all right.

Well, let's let's not dally any longer We have the man himself rather than continuing to take guesses at what the project is about let's bring Francois on and welcome to the show, sir Thank you. Thanks for having me. Yeah, it's great to have you here. So, tell, first off, did I pronounce it right? Is it, is it poutine?

I am, I'm very ignorant when it comes to that particular bit of Canadian culture. Yeah,

Francois: that, that's how most, like, English speaking people pronounce it, poutine, but in French it's So a little softer on the

Jonathan: ending. Okay. And then give us kind of the overview of the, as we like to call it, the 30, 000 foot view, what, what is this, what, what's the problem that we're trying to solve with Putin?

Francois: Yes. So really it's in the category of security vulnerability scanner. So it's what some may call like a static code analysis scanner that is going to look typically at source code, but more specifically manifest, like typically they would be written in YAML. And it would be stored on GitHub or other get repos, not just get, but and.

Those yaml manifest would define build pipelines. The ones we currently support, it's GitHub actions. If you're familiar with that, or also on GitLab the GitLab pipelines. So they would define the the way to build a certain software and eventually package and publish to some kind of registry and we're, with poutine, we're looking at security vulnerabilities in those So we can get into the details of that.

Jonathan: Yeah. What is what, what does one of those security problems look like? Like what's, what's sort of the the category of issue that people run into with their GitHub and GitLab pipelines? So

Francois: first, like, let's kind of set the stage a little bit. So there are kind of two broad kind of types of issues.

If we look at open source projects where everything is visible, like including the build pipeline. So typically on GitHub, you know, you can discover not just the code, but the way it's built. That is definitely an area where the attacker can as, as is the case for the actual source code, find vulnerabilities, but potentially like unknown vulnerabilities, zero days.

Right. When it's like an enterprise setting, like a internal source code where. And an external attacker would not see the build pipeline or the code would be more like, you know, insider threat scenarios. But in the case of open source projects, you can see even the dependencies that this project is pulling in, how it's built, and really the scenario that the classic scenario is, if you're familiar with GitHub, like, you know, pull requests the, the, the term that we use typically to address like Most common type of problem.

It's called Pwn request. Like that, that is effectively a pull request from a fork that is specifically targeting a vulnerable workflow. And the way to do that would be either through the actual files that are modified in the pull request. So let's say the contributor, a malicious contributor is sending a patch.

Let's say, and that is a real example, let's just updating the readme. All right, readme. md, it's a markdown file, apparently just a text file. But if it so happens that the build pipeline is gonna do like a linting, you know, formatting, just to make sure everything is, is is, is by the book. That is running code, like you know, linter or whatever.

on untrusted data. In that case, just a markdown file. Most cases, it's pretty safe, but some tools have little known kind of dangerous features that can be exploited by the attacker to run some remote code execution. That is one example. The other way is also through all other kind of inputs that the attacker has control.

Let's say the title of the pull request. Or the body of the description of the pull request or the comments that common comments, threads you see or the basically there are a number of things that if you're an User on github you can influence and the build pipeline will consume it Also, even the git branch name the git branch name.

You'd be surprised That it can contain like arbitrary bash commands or JavaScript commands. It's long enough and it accepts enough characters. There are some restrictions, but it's more than enough. And we've seen in the wild just malicious git branch names.

Jonathan: Okay, let me, let me give you a softball question.

I, I sort of know the answer to this, but here, here's a, here's a softball for you to get further into this. I thought Git runs all of your workflow stuff in their hosted virtual machines. Doesn't that completely solve all of these security problems?

Francois: So, I think you're referring to GitHub actions. So GitHub actions.

Yes, they are indeed. By default, the GitHub actions run in ephemeral throwaway virtual machines that are created on demand right at the, the, when, when a workflow is being triggered, they actually, even in the workflow, you have what they call jobs and each job is going to be a completely Independent ephemeral virtual machine but then inside of that, typically you would be referring to secrets.

For instance, to push to NPM, PyPy, Docker Hub, or whatever. So as part of the, the, the execution in the end, you're injected. It gets injected some secrets that could allow an attacker to pivot to something. Like let's say secrets to connect to AWS, to, to run some testing. If you're developing some kind of tool that would run in a cloud.

In the runtime, in the memory of the runner, even if it's ephemeral, it would get high powered in some cases, like sensitive credentials.

Jonathan: So that's, that's really the kind of the problem space that Poutine is aimed at. Someone can get arbitrary code execution in some, in some projects, I will add in some projects, the way the build system is set up, you sort of have arbitrary build or arbitrary code execution by default, because you know, there may be a build script.

That just runs bash code and you can send in a pull request that changes the build scripts. I mean, in some cases that's trivial. It's what I assume what poutine does is it looks for these problems and tries to what give you a warning that says, Hey, the way this is set up, it's trivial for someone to steal your secrets.

Exactly.

Francois: So typically the, the way get, get, get an action, namely was designed, it was designed. With that scenario in mind first hand because GitHub from the beginning always had pull requests with accepting requests from forks Right, so that's just by by its definition accepting untrusted code from someone someone So they designed by default that this would run in a sandbox where no secrets are accessible But, in some cases, you need secrets.

For instance, imagine you're processing the incoming data, and as a maintainer, you, you want to, to lower your toil of just, like, accepting, like, the contributions maybe come at a specific format, and that they, they meet just the guideline of the project. And in that case, then you might want to reply automatically with a comment saying, Sorry, we are not accepting your contribution until you Address XYZ.

But for that, the, the script will need some credentials to push the comment back in the flow, and in some cases, even update, you know files or push artifacts. So it really comes down to limiting the amount of secrets visible to kind of risky workflows. Those that, that you need access to some secrets.

But if you really need that, then yeah, you need to not process arbitrary code effectively.

Jonathan: There's a, there's another kind of class of potential problem. And I'm, I'm real curious cause I've, I've been working on this in a project that I'm involved in. We wanted to be able to do arm and arm 64 builds.

Well, as you probably know, that means self hosted runners on raspberry pies or something similar. And. I have been working over the past couple of weeks on trying to figure out a way to actually do that safely. And the, the solution that I've come up with so far is with the self hosted runners, you can do a, you can set it up with an ephemeral tag.

And then what I'm doing is I'm running those inside of Docker images. But I know that like Docker images are not the same level of of safety as something like a virtual machine is. I'm, I'm curious, does, is Putin aware of like this side of the problem, doing self hosted runners?

Francois: Absolutely. So we have a, we have a rule that will flag the usage of.

Self hosted runners, which trigger which accept on pull requests. And what's interesting there is that because unlike the, the, the sort of hosted runners, which are designed to be fully ephemeral, like fully like cleaned up and there's no sharing and fully isolated between each run. In that case, you're responsible for making sure everything is fully isolated and there is no leakage between each job.

Because if you have two like jobs that run in parallel concurrently on something you host, there could be cross cross job kind of pollution or sort of exfiltration leakage of data. So and yeah, we do flag scenarios where you're combining accepting pull requests. With that and that adds even more like more risk because you're you're on your own.

Jonathan: Yeah No, it's it's a it's kind of a scary thing to set up and I've I've been I've been kind of slowly working my way Through trying to think through this Now I'm curious does poutine Does it actually send in pull requests to try to test some of this stuff or is it just looking at configurations?

Francois: No, at the moment it's fully static.

It's a static code analysis tool that works. It can work fully offline. In fact, like it doesn't emit any network request except for interacting with Git, so you could get clone everything. In a directory and disconnect from the internet and run poutine. So like at the moment, we're not pulling any vulnerability database or whatever.

It is in the road map to add that as a kind of opt in feature where you would be like, you know, dash dash. Allow synchronizing kind of vulnerability database at the moment. We have that kind of baked in offline. Many of the rules are purely static code analysis like to detect those problems. So they don't even need a vulnerability database.

But yeah, so to answer your question, no, we are not. Doing any kind of active exploitation validation purely based on inspecting the code, finding the code patterns that are risky.

Jonathan: It seems like there could be it's just, just looking at the problem from the outside and what little I know about poutine there, there could be some possibilities there where you might want it to be able to generate a I guess that's tricky.

If you want it to generate an active payload, then you kind of move into this area where Putin becomes a red hat tool. Or excuse me yeah, a red team. Wow, I just, I mixed my metaphors. Black hat, red team. But it becomes a red team tool. Maybe that's not what you as a security company want.

Francois: No, exactly.

We, we're really, we've really designed it in a way that is gonna help it. People who typically are responsible for writing those workflows to, to detect problems quickly, efficiently, and, and, and learn from the, like, we've also provide some kind of training, like guidance and like like best practice kind of bad, bad examples, good examples to, for, for people to, to improve and in that regard, yeah, it is not designed as a red team to To showcase that.

That being said, we have a different project that we call Messi Poutine, if you want to get into that, which is all about Allowing as kind of a sandbox for capture the flag where people can have fun exploiting things that we've designed to be Vulnerable and we, we built that really as a way to test poutine.

So we point put into that GitHub, literally a GitHub organization called messy poutine, and it's all about finding as many flags, vulnerable things in there. There are some that. At the moment, Putin is unable to find, I know them like, and you can play the game kind of to find those. And we want to improve the tool to detect as many as possible going forward.

Dan: So Francois, I am curious about why you decided to release this as open source. What's the advantage of that for you guys?

Francois: Yeah. So we're, we're, you know, a commercial or a vendor. We, we, we build a security product. For commercial product as part of that, we. Automate provisioning a number of open source tools already to name one, like Sam grep, for instance, or trivy or gripe, things like that or Chekhov.

So there was a number of open source tools that we help to orchestrate and aggregate the results, and then we add our, all of our kind of secret sauce on top of that, and that was on the one hand, kind of interesting. Give back to the community because we've been benefiting from a lot of open source tools ourselves.

And we wanted to bring something where we saw there was a gap, right? There was something that was not yet in the open source and even in commercial, there was like, there's kind of a gap in that area at the moment. And we thought that the, the, this type of problem, when we started to look at it at scale, because that's how it really started, it started more like as a hackathon project.

We, we knew this type of problem existed. We were finding it kind of purely manually, just by pure chance, like happening to see something like, Oh, that's exploitable. So we wanted to kind of automate that seeing just how big the problem is at scale. And we started this project that we call package supply, which is indexing millions of open source projects.

And finding this type of problem at scale. So also finding transitive kind of attack path that is not directly targeting one project, but like vulnerable workflows that are downstream of, of you know, say sensitive project. And at some point when we had that started to do a lot of responsible disclosures to many projects we wanted.

To bring that to the masses, like to help people fix their workflows and find those things easily. So that's, that's how we, we came up with, with, with poutine as a sort of a sister project, this bigger kind of package supply, which I spoke at the open source security foundations conference last month about that project.

And that was our way to give back to the community.

Dan: That's excellent. I was curious about how many people are interacting with it. Community wise, what's the response been like? Have you had a lot of bug reports or interaction?

Francois: Yeah. So it's been just about a month that it's open source now. And I think we're quite pleased, but with the, the, the number of interactions, like stars and like people like chatting about it, like, and you kind of getting interested in it.

So it's, yeah, I think we're getting. Very good interest by people that I think should, should know it exists. But we want to spread the word even more. And thanks to, to you, like hopefully we'll, we'll get up to more people that can benefit from learning, even learning. Like it's, I think it's first and foremost about awareness.

Like many people I talk to that have been doing a pen testing, like red team exercise for years. They're completely unaware of this class of vulnerability. Many people, you know, talk about top 10 and like very classic type of SQL injection, cross site scripting, et cetera, et cetera, that that's a very, very mature type of, you know, area.

Like there's tons of tools. The know how is, is, is very well, well advanced by now, but when it comes to vulnerabilities and build pipelines, that is still an area that is a bit Up for grabs.

Jonathan: And you got to think if, if red team professionals don't even know about it, then your run of the mill open source project on GitHub has no clue about it.

Francois: Yeah. I mean, and that, that goes back to this what we call package supply that was about in like doing, evaluating the sheer scale of that problem at scale, like millions of projects. And as I said, I've, we've reported a number of, of problems to open source projects in some cases. Some projects that were downloaded millions of times a day, not to name them in very critical infrastructure kind of pieces.

Like so it is a real problem.

Dan: Yeah. You mentioned in your I read your blog when you announcing the release of, of poutine and, you mentioned in there that it seems like maybe the things that you found so far feel a bit like they might be the tip of the iceberg. Do you think the industry has been kind of sleeping a bit on this as