Exposed Secrets with Dwayne McDaniel

Exposed Secrets with Dwayne McDaniel

Sep 15, 2025

In this episode, we speak with Dwayne McDaniel about exposed secrets in our GitHub repositories and figuring out when we've been compromised using Honeytoken. Links: Dwayne's site - https://dwayne-mcdaniel.com/ Verizon's Data Breach Investigations Report - https://www.verizon.com/business/resources/reports/dbir/ GitGuardian Blog - https://blog.gitguardian.com/ HoneyBadger.io - https://HoneyBadger.io Our Discord - https://discord.gg/aMTxunVx Buy our shirts - https://store.phparch.com/products/community-corner-podcast-t-shirt Music: Come Spring By Megan Wofford https://www.epidemicsound.com/music/tracks/bc2996e3-e558-47b6-8403-69826a030f8c/ Scott's Social Media: Website - https://scott.keck-warren.com/ Bluesky - https://bsky.app/profile/scottkeckwarren.bsky.social LinkedIn - https://www.linkedin.com/in/scott-keck-warren-91689810/ Mastodon - https://phpc.social/@scottkeckwarren

Transcript

Scott Keck-Warren Scott Keck-Warren 0:01
Hello developers, and welcome to the PHP Architect Community Corner, where we have conversations with members of the web development community. I'm your host, Scott Kett Warren, and today we're talking with Duane McDaniel about GitGuardian and the services that it provides. Duane McDaniel has been working as a developer advocate since 2014, has, and has been involved in tech communities since 2005. His entire mission is to help people figure stuff out. He loves sharing his knowledge and he's done so by giving talks at hundreds of events worldwide. He has been fortunate enough to speak at institutions like MIT and Stanford and internationally in Paris and Iceland. Dwayne currently lives in Chicago. Outside of tech, he loves karaoke, live music, and crochet. Thank you, Daniel, for having— or thank you, Dwayne, for having— finding some time to talk to us today.
B
Speaker B 0:47
Well, it's great to be here, Scott. Uh, we know each other from the PHP community, hence your hat. Uh, I'm an old Drupaler myself. That's part of the old school tech community I've been a part of. And that's what helped me transform my life into helping people figure stuff out. Once I embraced the world of Drupal and true open source, just the path became exceptionally clear. And ever since then, it's now I work in security, but that same spirit of let's help people figure this stuff out, whatever that is, has just permeated my life. And I'm very proud to be here.
Scott Keck-Warren Scott Keck-Warren 1:19
Yeah. Awesome. I, so like you came to my attention because you were at PHP Tech, I think this year and last year and gave some talks around security, especially about what it is that you're— the company that you work for, GitGuardian, does. Can you talk to us a little bit about what it is that GitGuardian does?
B
Speaker B 1:33
Sure. GitGuardian has been around since 2017, and we are a platform historically focused on secrets scanning. So secrets being the broad category of anything that allows access to another system. So API key, a token, an SSH key, just that broad bucket of passwords, anything that allows system A to authenticate to system B. In a perfect world, we will never see these. These are never shown in plaintext, but we don't live in a perfect world. We live in a world where people put them in plaintext all the time to the tune of last year, we found 23.77 million hardcoded credentials added to GitHub Public just in the year 2024. That's not cumulative. That's just added in that one single calendar year. So our platform is geared toward finding, A, those secrets out there on GitHub Public. We're one of the people that ingest the feed, events.api— or no, api.github.com/events. Anybody can go read this thing. It is literally public. That's the public in GitHub Public. But we're one of the people that ingest it, and we look at every single commit and say, there's a secret here or there's not a secret here. If there's a secret, if there's a password, if there's something that's compromising in our opinion, we're going to email you immediately and say, hey, you did this, you might not want to do that. That's how I found out the company existed a year before I worked for them. I was trying to migrate between 2 machines and bounced my private SSH key through what I thought was a private GitHub repo. Nope. I got an email message saying, hey, you pushed this to a public repo. And I'm like, no, I didn't. And sure enough, I did. So rotated that. I was safe. Nothing bad happened out of that incident. But that's how I found out GitGuardian exists. That same engine that detects secrets, we detect them both, like specifically our specific secrets. So we have specific detectors that look for things like pre-formatted things that match a certain pattern. And then we also have generic detectors that look for things like bearer tokens or that looks like a JWT or JWT. It looks like an X.509 certificate. So we can just take that general bucket. We don't know exactly what it goes to. We don't know, like, the background of that, but we can tell you this grants access from a contextual standpoint. So we can hook that same engine up that we look at everything on GitHub Public up to your internal sources. Now, of course, your internal Git repos, Git's in the name of the company, GitGuardian. That's where we started, but we have long expanded past then. We look in Jira, Slack, SharePoint now, your ticketing systems, your messaging systems, your CI/CD pipelines, your Docker containers, like container registries themselves. So anywhere where a plaintext credential might pop up anywhere along the software development lifecycle. That's the historical view of what we have done. And then in the past year, we have shifted our focus over away from just thinking about secrets independently of themselves and started seeing that in the broader context of what are they even doing? And that leads us into the world of non-human identities and security and governance around that.
Scott Keck-Warren Scott Keck-Warren 4:47
I think there was a lot there that was really kind of interesting. So the one piece that I didn't know about is like, so you're already scanning public repositories. And so then you email the project maintainer and say, hey, you made a mistake here.
B
Speaker B 4:58
We may email the committer. So part of Git is that you sign your commits. That's been there since the beginning. You sign it with an email, a username and email. Hopefully you're using a real email that actually works. So it's an automated system that we— there's billion, over 1.4 billion commits last year. So there's no way we could have done this by hand. So the system literally automates looking at the feed and then emailing that committer say, hey, you did this. So we're not trying to track down like who owns the project. We're saying this individual commit that ended up in public, you signed it, this is yours, please do something to fix this.
Scott Keck-Warren Scott Keck-Warren 5:36
Hmm. I, that wasn't, I didn't realize that. That's kind of a really nice thing that you guys are doing for the community.
B
Speaker B 5:41
It's also, we call it the Good Samaritan program. We're really, we want everybody to be safe out there, no matter if you can pay for the tools or not. We think that given a heads up because we know we're not the only people that are looking at the feed and ingesting it. We know there are certain bad actors out there that are archiving everything and trying to figure out what malicious things to do with it later. We're not one of them. We're literally just trying to alert everybody that this is a bad idea. Yeah.
Scott Keck-Warren Scott Keck-Warren 6:09
And I think like the thing I've, I've, I, I kind of appreciate about it is like that it's nice that you guys are giving back to the community and, and just the world in general and helping people like make those kinds of mistakes. But the thing I always find fascinating is just how, how easy is for like, if somebody gets ahold of, you know, your login credentials or, or an API key for, uh, Amazon Web Services, they can just like overnight, like that tens of thousands of dollars in charges. That's just like so fast. It's terrifying.
B
Speaker B 6:37
Um, it is astounding. So the, the, the Verizon puts out a, uh, Verizon Enterprise puts out a, a report every year called the DBIR, the Data Breach Investigation Report. It's a great read. I highly recommend anybody read it. It's very human consumable. It's written. It's actually funny in parts. The humor is built into it. But this past year's report, it was 22% of all breaches are through compromised credentials. 20% are through vulnerabilities. So even if you're patching everything, the main way people are getting in is through these compromised credentials. Phishing was like down to like 18%. Then everything else was like a mix of everything. But people aren't breaking in, they're logging in. And once they log in, it is so hard to detect anomaly. I actually had a conversation earlier today with someone and they're like, well, how fast could you tell if someone misused a credential? I'm like, that's a great question. How fine-tuned is your detection engine to say this goes against how we set up the system to run. If you're all of a sudden looking up all database tables, how fast is your system detecting that? Are you parsing logs days or weeks after the fact? If you're pushing your— if you're exfiltrating data through your DNS, through text message, like, are you set up to detect that? Like, that's a pretty way— pretty common way to exfiltrate data these days is to abuse DNS. So have you tuned the rest of your rules? But once you're in, it takes a while to figure out that someone's done something wrong. It's again, not someone breaking in, which is pretty obvious, like they're knocking a hole in our firewall. They've gone through this exploit that triggered a bunch of alarms. No, it's like they've just logged into the system, probably have admin access knowing most API keys we see, and have done malicious stuff. And how fast can you tell when an admin did something off script? Well, that's going to depend on how far you tuned,
Scott Keck-Warren Scott Keck-Warren 8:38
right? Yeah. And it's, it's always terrifying as well, because like, even, even if like that you have like a good IDS system, they might be just doing it very slowly, you know, like, because a lot of— I know that I've seen reports at least that some of these, some of these organizations, some of these like bad actors will get in and they'll just kind of slowly work their way around so they're not detected over like a couple of months because people don't usually rotate all their passwords the way that they should or whatever.
B
Speaker B 9:02
The average time for rotation according to Verizon's numbers was 97 days. We put out this report every year called the State of Secret Sprawl Report. You can freely look this up. Hopefully we'll throw in the show notes because you don't need to log in or give us your email. We just want everyone to read this report. You can download it through Tor. We don't really care. But one of the terrifying things, in my opinion, is we try to validate all the credentials we find. So if we can do a non-intrusive call to say, does this key work? So we went back and looked at the same secrets we found in 2022 over that year and picked out a random like 11,000 that had been proven valid. We went and tested those in January. 70% of those same credentials came back as still valid. in January 2025. So this isn't a— they didn't know. We sent them the emails, we reached out to these companies. And I'm not saying it's on us. We're really working hard here to make sure they do this. But credential rotation is a really massive, hard problem at scale, especially in legacy systems. Someone set up an API, they hand-rolled all the authentication. It's time to go rotate that credential. How do you set the permissions on that? Hopefully you wrote it down. Hopefully that developer's still at the company. Hopefully someone remembers. But the likelihood of being breached is a risk. It is a probability that it's going to happen. The reality that you break your entire DevOps workflow and break your application because you set the permissions way too narrow, that risk is more terrifying to the business than maybe someone's going to find this key and maybe get in and maybe do something bad. And once you start compiling the maybes and the risk assessment, then yeah, you're not going to break the system versus we're going to do this the right way from a secure perspective. Ultimately, we're going to get away from— and this is my great hope— we're going to get away from long-lived credentials all over the place. So I hope for a day in the not too distant future where If I find an API key, I'm just going to assume it's bad. And if I go to try it and it works, that's going to be a shocking day because it should have expired right after the workload request was finished. And the fact that it's in public in plain text is meaningless at that point. We're not there yet. We have a long way to go, trust me. But I think it's not that far out in the future if we all work together and start putting our minds toward how do we properly authenticate entities especially workload entities inside of these massive systems.
Scott Keck-Warren Scott Keck-Warren 11:42
Yeah. So it just sounds like there's all this like talk about AI agents and stuff like that, and those are all, you know, acting on your behalf essentially. And hopefully those things are all secured as well. So
B
Speaker B 11:52
hope is not a strategy. Um, the reality of AI is it's just another new tech. And yeah, it's cool that it's a probability engine that's guessing the next word and guessing the next action and able to do some pretty magical looking stuff when you see it. And if it's non-mission critical, if it's non-critical information, it's kind of the same way I used to look at Wikipedia. If it's non-critical information, like where was a certain actor born? Like what's the most common ingredients in bread from countries around the world? Wikipedia is amazing for that. If I want to know like very specific scientific knowledge that actually matters for my health, I'm not going to go to Wikipedia. I'm going to go Johns Hopkins and then go talk to a doctor or some other more profound source. I think if we treat AI the same way that, hey, this is a neat magic trick that can condense down my 5 sloppy paragraphs into 2 coherent ones, that's a great use for it. It's this agentic AI. It's these systems of agents that are interdependent and working together. We are seeing so many secret leaks out of these because there's so many points And this goes back to the non-human identity piece that I didn't really dig into, but all of these systems need to authenticate together. So what's the easiest way to do that? Well, you just plaintext hardcode the credential somewhere in the system. Except if you do that, you can easily ask AI to spit those out. And that's a concern. A larger concern is the fact that we cannot tune these agentic systems. There's no way to get in and fine-tune the internals. What we can do is log what we put in and log what comes out and then try and try again to refine the prompt along the way. If it spits out a credential that it found in a Confluence page or an old Jira ticket, well, guess what? Now it's in the log. Is that log in a proper S3 bucket that's properly secured? Do you know where it goes or is it going to a third party? There's all these questions around it and that's one of the larger concerns around RAG, uh, retrieval augmented generation and AI and these, these systems is they produce so much content, so much data that unless you're properly sanitizing, and we all should be in the habit of sanitizing our logs anyway, but it's at a scale and at a pace that I have never seen before in my career.
Scott Keck-Warren Scott Keck-Warren 14:19
Yeah, for sure. I, I find it like both fascinating and terrifying at the same time. Like it's a night, it's like, it's fun to see like what it can build, but it's also terrifying at how fast, like there's that, there's There was just that news story about that person who like had something that was doing something and just dropped its production database and like nobody— Yeah. And, and I, and I, yeah. And, and it's just terrifying, like what, how trusting people are of the AIs. Like, I know like my boss was like, uh, you know, he's like, well, it'd be really great if I could just give an AI my financial information and it could just do all my bills and all my credit. And I was like, that sounds like a terrible idea. It just sounds so terrible to just give trust like this entity with, with your access to your account.
B
Speaker B 14:59
Somebody said it really well when it comes to that is like, I would never trust my calculator to do my taxes. But at this point, I'd be kind of crazy not to do my taxes without, without using a calculator.
Scott Keck-Warren Scott Keck-Warren 15:11
And
B
Speaker B 15:12
the same thing, like I can ask for, hey, here's a scenario where I have this much money and the tax rules say this, what do you think I should do? And general advice like that,
Scott Keck-Warren Scott Keck-Warren 15:23
Great.
B
Speaker B 15:23
It's a good starting point to go talk to a CPA. It's like, here's what I think's going on. Can you clarify? And maybe get it right. Again, these are probability engines. I talk about this a lot when I talk about AI with people and like, these aren't deterministic systems. Like if I write a little bit of code that says spit out hello world, it's going to do that every time I run it forever. No matter if I did that in BASIC or R or Rust or whatever, it's going to do that. It's a deterministic system. A probabilistic system says, I'm going to guess the next word, and depending on how I wrote it, I might end up with hello world. And I think 99% of the time I will. But for mission critical stuff, for financial, actually my data and my identity online, no, I don't trust that at all personally. That's way too mission critical to trust a probability engine.
Scott Keck-Warren Scott Keck-Warren 16:13
Yeah, absolutely. It's kind of terrifying that people are willing to do all that. So, so for this like secret detection piece that you guys, uh, you guys have, like, what is the size of the kind of the organization that you are targeting on that? Is it, is it targeted towards enterprise-level people or can we do it as like a, as a small or medium business? Is that also something that we have access to?
B
Speaker B 16:33
One of my favorite things about working here is that we have a free tier for scanning your code. And that is if you're 25 developers or less, 25 people or less touch your code in your system, or you're an individual developer or a student, basically if you're not having more than 25 people touching your codebase, the scan your code piece and the CLI are free. We have a really powerful command line interface. We call it ggshield, and it can scan, you can do pre-commit scans. So we actually have a VS Code plugin as well. So upon save, it can tell you, hey, you hardcoded a secret even before you did a commit. And then we have a pre-commit hook that says it'll stop the commit from happening and say, hey, you put a secret here. You want to fix that before you make the commit. If you can fix it before the commit happens, that is the cleanest, safest, best way to deal with it early in the process. And that tool is always going to be free for individual developers. And then our actual platform, We are dealing with very large enterprises. We're dealing with some of the biggest companies in the world, and it's tuned for that use case. So we have the free tier that you are getting all the benefits of what we have done tuning for Fortune 500s. But honestly, our platform is geared toward the enterprise. The bigger you are, the more value you're going to get out of it. The more code bases you have, the more Jira instances, the more Slack instances, the more Teams instances, the more value you're going to derive from us.
Scott Keck-Warren Scott Keck-Warren 18:00
Because, because to be honest with you, like the thing that always terrifies me the most is like secret sharing within Slack, right? Like that, you know, it's just so easy to be like, well, here's the login information and then, you know, it's on Slack's servers now. So we'll be back after this word from our sponsors. Now I don't need to tell you that production monitoring can be complicated. There are tons of tools and techniques, but you just want to know that your app is up and your users are happy. When your customers encounter a problem, you need clear, actionable intelligence, not walls of charts and reams of logs. That's why they built Honey Badger, the monitoring tool you've always wanted. A tool that's there when you need it and gets out of your way when you don't. With Honey Badger, you'll know when critical errors occur and which customers are affected. Respond instantly when your systems go down, improve the health of your systems over time, and fix problems before your customers can even find them. Honey Badger is the application health monitoring tool built for you, the developer who cares about a quality product and happy customers. Start monitoring today at honeybadger.io. It's free to get started and the setup takes less than 5 minutes. Once again, that's honeybadger.io. Yeah. And then so the other thing that I really wanted to talk to you about is like, so I got to see you talk about your Honey Tokens product, which I find to be just like, fun and terrifying. Can you talk to us a little bit about like how that product or what that product is and kind of how it works?
B
Speaker B 19:14
Sure. So in the bigger, broader sense, we did not invent Honey Tokens, we'll never claim to do that. We have implemented them in a way that really Complements our product and does it in a sane, scalable way, in our opinion. It's a derivative of the concept of honeypot. Basically, honeypots are services, servers, boxes that you're never supposed to touch. So if someone logs into it or tries to log into it, that's a giant warning flag goes off and, hey, someone's attacking something. But you put it out there because there's nothing on it. You just want someone to attack it like, hey, That was the trigger. They told us they're in the system. A honey token is just a small piece of data that shouldn't move. That's how— I forget his name off the top of my head. Pablo Dibarro, I believe his name is, but the originator of the term honey token. That's what he meant in the message that he wrote in that email exchange was, what if we just had a piece of data that didn't move? And he started calling it honey token. So the idea of a honey token could mean anything. It could be an email account that should never, ever be touched. And if it ever is, you know something's wrong. It could be a file that you set up a file watcher on to go say, hey, if this ever moves, if anybody tries to open this, send me an alarm. Pretty trivial to set that up, but that's like a one-off thing. How this has come to be interpreted throughout the industry though, is a honey token means a false credential or not a false, a decoy credential. So it doesn't go to anything. It's a real credential, but it doesn't do anything. But if anybody tries to use it, it sets off alarm bells. The quick and dirty of it is our version, we offer AWS secrets as Honey Token. So we manage all of the AWS account for you separate than your stuff. You don't have to worry about like if someone compromised it. I mean, it's just, it's a thing we set up. And then when someone goes and tries to use one of these tokens or even validate So there's a lot of scanning tools out in the world. We're not the only one that can do the secret scanning. A lot of them have a validation step you can invoke. So upon that validation step, it will say, hey, I'm trying to use this. It will log that event into a bucket through CloudTrail— yeah, CloudTrail in AWS— and then send an alert by SMS or text or Slack or whatever you want. to say, or email, and say, hey, someone has tried to use that, and includes the full IP address and the, very importantly, the user agent of who tried to get in. Now that's our interpretation of it. There are a lot of other companies. In fact, if anybody out there wants to get their hands on honey tokens in general, I would highly recommend Canary Tokens. Just look up Canary Tokens. It's a product from for Thinkst, a company out of South Africa. They have a free tier that you can just set up fake emails, fake credit cards, fake, but they're all one-offs. If you're going to do this at scale, you want to partner with a company that has a managed system. We can build the PRs for you. We can build the files for you. We can insert these upon every new request, upon every new system you set up automatically. So, and then manage that from one dashboard. And that's what you're going to get into with enterprise tools anyway. But if you're just— this is a brand new concept for you, like, I would love to play around with a token that shouldn't ever be touched, but I'm gonna put it out there and see what happens. Um, yeah, just canarytokens.org, I believe, is the website. And, um, I don't work for Thinkst, but I think they make an awesome product line.
Scott Keck-Warren Scott Keck-Warren 22:53
Yeah, they also have like a box that you can buy and put on your network in case anybody like touches the box, which is a really interesting thing. I've never used it, but I know that people, people have. Um, but I like— I— the thing I like about the Honey tokens is it's like a really good just like dumb, like I can put a file on a server in my like home directory or whatever. And if my home directory, if someone gains access to that thing and tries to use the token, then like immediately I know that that account or that box has been, you know, has been attacked essentially. Right. Somebody was able to get data off of it, which means something is wrong and I need to go look at that server. So it's kind of like just nice to like scatter this throughout like, you know, my home directories as I go. And I'm like, okay, well, is this server safe? Is this server safe? And then it just kind of gives me like a little, you know, built-in suspenders, you know, in addition to like hard passwords, you know, multifactor authentication. It's just like another piece of the security, uh, I don't know, what do you call that? Like where it's like interlocking pieces to, to keep you—
B
Speaker B 23:52
I've heard it called Swiss cheese approach where you just keep layering to try to cover all the holes. So if you shot through the Swiss cheese, at some point the layer would stop it. But layered security, defense in depth, is also another way to say that.
Scott Keck-Warren Scott Keck-Warren 24:04
Thank you. Layered security is what I was looking for. Completely like blanked right out of my mind when I was trying to explain that. So
B
Speaker B 24:10
no worries.
Scott Keck-Warren Scott Keck-Warren 24:11
Yeah, awesome. So is there anything else that you'd like to direct our listeners to before we let you go for today?
B
Speaker B 24:14
Uh, yeah, I do a lot of writing on our blog, so blog.getguardian.com. That is the best way to catch up on my writing and thoughts about We didn't really dig into non-human identities and like what that really means. And like this whole idea of workload management and policy engines around like, is my NHI being offboarded properly? Is it living too long? Is it duplicated? Does it live in multiple vaults? That's all stuff that our platform is really focused on right now and that I've been focused on a lot in the last few months in my writing. and speaking out there in the world. So that's a good place to catch up with how I'm writing out there. And you can also see a lot of recaps, including for PHP Tech and other conferences I go to. I always try to write a recap if I go to a conference. And then if you go to our events page, just gitguardian.com/events, you can see what upcoming events we have and where I'm speaking next. And that would be where I would send everybody.
Scott Keck-Warren Scott Keck-Warren 25:15
I will try to— there was a bunch of links. I think we have like at least 6 in this now. So I'll try to collect those all and put those all in the description for anybody who's listening to this. So thank you again for, for finding some time to talk to us.
B
Speaker B 25:26
Well, thanks very much for having me. I really enjoyed the conversation and hopefully I'll see you again at PHP Tech 2026.
Scott Keck-Warren Scott Keck-Warren 25:34
Yeah, no, I hopefully, hopefully we do. Just say another heartfelt thank you to Duane for all of his time and also for you for listening. If you're not already a subscriber, make sure you subscribe with whatever your preferred method is and maybe leave us a 5-star review to help other people find us. This podcast is available both in an audio version on the PHP Architect website, as well as a video version on our YouTube channel. This is Scott Keck Warren for the PHP Architect Community Corner signing off and reminding you to keep listening, keep coding, and keep reading.