Where Did I Put My Keys? Preventing Data Leaks at Scale with Automation

Joshua Padman (Information Security professional · Red Hat)

BSides Canberra VIII (2025) · Day 1 · Main Track

Overview

In this compelling talk, Joshua Padman, an Information Security professional at Red Hat, addresses the critical and escalating problem of sensitive data leaks, particularly the inadvertent exposure of secrets like API keys, credentials, and tokens. Titled "Where Did I Put My Keys? Preventing Data Leaks at Scale with Automation," the presentation delves into the profound risks these leaks pose to organizations, highlighting how they serve as "ladders" for attackers to escalate privileges and compromise systems. Padman shares Red Hat's journey in combating this issue, detailing their robust, internally developed automated secret detection and remediation system.

Watch on YouTube

Visual summary for Where Did I Put My Keys? Preventing Data Leaks at Scale with Automation by Joshua Padman
Visual summary for Where Did I Put My Keys? Preventing Data Leaks at Scale with Automation by Joshua Padman

Key moments

  1. 2:20 Defining secrets and where they are found
  2. 6:20 Industry data: Rapid compromise, slow remediation
  3. 10:00 Red Hat's internal secret detection system: Pound Alert
  4. 18:40 Challenges of secret scanning in an open culture
  5. 27:40 What other companies are doing in secret detection
  6. 35:00 Introducing the Secret Scanning SIG for industry collaboration
  7. 41:30 Tracking secret resolution across thousands of repositories (Q&A)

Where Did I Put My Keys? Preventing Data Leaks at Scale with Automation

Speakers: Joshua Padman, Information Security professional, Red Hat

Conference: BSides Canberra

YouTube: https://www.youtube.com/watch?v=8Xi6f_GMvqY

Overview

In this compelling talk, Joshua Padman, an Information Security professional at Red Hat, addresses the critical and escalating problem of sensitive data leaks, particularly the inadvertent exposure of secrets like API keys, credentials, and tokens. Titled "Where Did I Put My Keys? Preventing Data Leaks at Scale with Automation," the presentation delves into the profound risks these leaks pose to organizations, highlighting how they serve as "ladders" for attackers to escalate privileges and compromise systems. Padman shares Red Hat's journey in combating this issue, detailing their robust, internally developed automated secret detection and remediation system.

The talk is particularly relevant given the pervasive nature of modern development workflows, which often involve vast, distributed systems, public open-source contributions, and numerous third-party integrations. Red Hat, as a major open-source company with an "upstream first" mentality, faces unique challenges in this landscape, making their experience and solutions highly valuable. Padman not only presents technical solutions but also emphasizes the crucial human element, advocating for empathy and collaboration when dealing with engineers who inadvertently expose secrets.

Beyond Red Hat's internal strategies, Padman extends the discussion to industry-wide challenges and proposes collaborative solutions. He introduces the nascent Secret Scanning SIG, an industry group aimed at fostering open collaboration to improve secret leak detection, remediation, and prevention across the ecosystem. This talk underscores that preventing data leaks is not merely a technical problem but a multifaceted challenge requiring advanced automation, cultural shifts, and collective industry effort to protect organizations and their users from increasingly sophisticated threats.

Background

▶ Watch: Defining secrets and where they are found (2:20)

A "secret" is broadly defined as any piece of sensitive information that, if exposed, could pose a risk to an individual or organization. The sensitivity is highly contextual; for instance, test data containing fake secrets might be benign, whereas the same data from a production system could be catastrophic if leaked. The focus of this talk is on development and deployment secrets: API keys, certificates, credentials, and session tokens, often found in configuration files, environment variables, hardcoded in code, or within logs.

Secrets are ubiquitous across an organization's disparate systems. Red Hat, for example, utilizes a vast array of platforms, including internal and external Source Code Management (SCM) systems like GitHub and GitLab, bug tracking systems, customer support portals, CI/CD pipelines and their associated logs and artifacts, container registries, pastebins, and chat platforms. The risk is compounded by reliance on numerous vendors and third parties, each presenting its own potential for exposure. For open-source companies like Red Hat, the challenge is amplified, as much of their work is public by default, leading to customer-uploaded debug logs or failure information often containing sensitive credentials that can inadvertently end up in public-facing bug trackers.

The stakes are high. Industry research paints a grim picture: GitGuardian reports a 25% increase in hard-coded credentials from 2023 to 2024, representing 23.8 million new leaks detected in 2024, up from 19.1 million in 2023. Alarmingly, 15% of all commit authors have committed a secret. Reversing Labs, quoting GitGuardian, notes that easily identifiable secrets published to GitHub can be compromised in "a matter of seconds" by attackers constantly monitoring new pushes. Despite this rapid compromise, remediation is notoriously slow, with many secrets remaining active after five days and an average remediation time of 94 days. This creates a significant window for attackers to exploit. The financial impact is substantial, with the average cost of a breach in 2024 estimated at $4.8 million USD, a figure that increases by an average of $1.78 million USD when security skill shortages are present. Such statistics underscore that leaving secrets exposed is akin to providing "ladders" for attackers, making their path to compromise significantly easier and more costly for the organization.

Red Hat's unique operational model further necessitates robust secret management. Their "upstream first" mentality means engineers work publicly on shared systems, contributing to foundational open-source projects like OpenShift, Kubernetes, and Linux. This global, asynchronous work culture, coupled with significant freedom in technology choices, empowers engineers but also expands the attack surface. Furthermore, as a customer-focused company selling support for open-source software, Red Hat bears a substantial responsibility to protect customer data and secrets, making comprehensive secret scanning an imperative.

Key Findings

▶ Watch: Red Hat's internal secret detection system: Pound Alert (10:00)

The talk highlights several critical findings regarding the state of secret management and Red Hat's approach to addressing it:

  1. Escalating Leak Volume and Rapid Exploitation: Secrets are being leaked at an unprecedented rate, with a substantial increase in hard-coded credentials year-over-year. Attackers are incredibly swift, often compromising newly leaked secrets within seconds. This rapid exploitation window is a stark contrast to the painfully slow industry average remediation times, creating a significant vulnerability gap.
  2. Red Hat's Leak-Alerting System Delivers Significant Improvements: Through years of development and refinement, Red Hat's internal leak-alerting system has drastically improved their ability to detect and mitigate secret leaks. The system has reduced the time to mitigation from days to hours, and in some cases, minutes (e.g., Jira leaks detected and alerted within 30 seconds). This demonstrates the power of automated, comprehensive scanning at scale.
  3. The Importance of Empathy and Culture in Remediation: A crucial non-technical learning is the necessity of approaching leak incidents with respect and empathy. Engineers often leak secrets accidentally. By partnering with them to solve the problem rather than assigning blame, Red Hat has found that individuals who caused incidents often become strong advocates for information security, fostering a more secure organizational culture.
  4. Beyond Detection: Prevention is Paramount: While detection and mitigation are vital, the talk emphasizes that reactive scanning alone is insufficient. A layered approach encompassing proactive prevention is essential. This includes adopting secret management platforms (like HashiCorp Vault), transitioning to short-lived credentials (e.g., AWS Security Token Service - STS), implementing pre-commit hooks, and enforcing secure defaults in platforms and tools.
  5. Industry-Wide Collaboration is Essential: The problem of secret leaks is systemic, affecting all organizations and platforms. No single entity can solve it alone. The emergence of the Secret Scanning SIG underscores the need for open collaboration among vendors, platforms, and open-source projects to standardize rules, improve tooling, share best practices, and collectively elevate the industry's ability to prevent and respond to leaks.
  6. Providers Bear Responsibility: Companies and platforms that issue API keys and credentials have a significant role to play. They should make keys easier to identify (e.g., prefixes), provide simple revocation APIs (like GitHub's personal access token quarantine), offer clear documentation, and enforce secure defaults with shorter lifespans, especially for powerful credentials.

Technical Deep Dive

▶ Watch: Challenges of secret scanning in an open culture (18:40)

Red Hat's primary defense against secret leaks at scale is an internally developed leak-alerting system that combines custom software with open-source tools. It’s designed to continuously monitor diverse systems, detect leaked secrets, and automate notification and mitigation.

The leak-alerting system's architecture comprises five main components:

  1. Monitor: This component actively observes various services for updates and new pushes. It integrates with platforms like GitHub's event stream, Jira, internal LDAP, and GitLab. Upon detecting changes, it generates scan requests, which are then passed to the scanner.
  2. Scanner: The core "workhorse" of the system, the scanner is responsible for analyzing content for secrets. It can ingest a wide range of data types, including Git repositories, container images, JSON blobs, and URLs. The underlying engine for the actual secret scanning is Gitleaks, a popular open-source tool. Red Hat has built a Go-based wrapper called LeakTK scanner around Gitleaks. This wrapper encapsulates Gitleaks and runs it in a persistent listen mode, significantly improving performance by avoiding repeated executable calls. Red Hat actively contributes upstream to Gitleaks, sharing improvements and rule sets.
  3. Pattern Server: This component serves custom rule sets and patterns to the scanner and other tools. For the leak-alerting system, it provides a broad, comprehensive set of rules to maximize detection coverage. For other uses, such as pre-commit hooks or CI/CD scans, it can generate smaller, more targeted rule sets, optimizing scan performance for specific contexts.
  4. Analyst: Once a scan is complete, the analyst component reviews the results. It determines who should be notified (e.g., the associate, the information security team) and, for certain high-risk systems, can trigger immediate mitigation actions such as disabling or quarantining credentials.
  5. Forwarder: The final step, the forwarder, disseminates information and initiates further automation. It sends out email notifications, dispatches "blank events" to internal systems, and calls webhooks to trigger other response workflows. The forwarder is designed for extensibility, allowing for easy integration with new notification or mitigation channels.

Rule Sets and Patterns: At the heart of the scanner's effectiveness are its rules, primarily defined using regular expressions (regex). A rule for a Google Cloud Platform API key, for instance, includes an ID, Description, the regex itself, a Secret Group (the specific part of the regex capturing the secret), and crucial Tags. These tags categorize the secret (e.g., type: secret) and dictate notification behavior (e.g., alert: infosec, alert: repo_owner). To optimize performance, rules also incorporate Keywords for a fast pre-check (skipping regex evaluation if the keyword isn't present) and Stop Words for post-regex filtering (ignoring findings if certain words are present within the detected secret).

Technical Implementation and Scaling:

Initially developed as a Python project, the system faced memory challenges when processing large JSON blobs in its custom message bus, consuming up to 6GB of RAM after a week. The transition to the Go-based LeakTK scanner significantly reduced its individual memory footprint. The entire system is hosted on OpenShift, Red Hat's Kubernetes platform. To eliminate I/O bottlenecks during operations like Git repository cloning, a RAM disk is used for all temporary files.

The performance gains from the LeakTK scanner are notable. By moving from direct calls to Gitleaks to running LeakTK scanner in a persistent listen mode, Red Hat managed to double the amount of data scanned or halve the time required for the same volume. With 8 CPUs assigned, the system scans over 350,000 repositories and hundreds of gigabytes of data from Jira and other systems weekly. It also monitors 11,000 Git accounts across the organization, a massive undertaking achieved through years of campaigning and associate self-reporting.

Beyond the core leak-alerting system, Red Hat has implemented additional prevention mechanisms:

  • Pre-commit hooks: Software streamlines the installation of these hooks for engineers, preventing secrets from being committed in the first place.
  • GCS filters: A function-as-a-service scans all new files uploaded to Google Cloud Storage for secrets, quarantining any detected.
  • Similar scanning capabilities are integrated into Jenkins and GitLab CI/CD pipelines.

Communication between the system's components is standardized using standard I/O and JSON. For horizontal scaling and message brokering, Red Hat utilizes NATS, an open-source messaging system. They even contributed upstream changes to the NATS CLI to facilitate piping data directly from their tools onto the message bus. This robust and scalable architecture allows Red Hat to maintain high visibility and rapid response capabilities across its vast and complex open-source ecosystem.

Demo / Proof of Concept

▶ Watch: Introducing the Secret Scanning SIG for industry collaboration (35:00)

While the talk did not feature a live, interactive demonstration of the leak-alerting system, its efficacy and operational capabilities serve as the primary proof of concept. Joshua Padman detailed the system's architecture, its components, and its real-world performance metrics, effectively showcasing how it functions at scale within Red Hat. The evidence provided includes quantitative data on scan volumes (350,000+ repos/week, hundreds of GBs of JSON from Jira), significant reductions in time-to-mitigation (from days to hours or even minutes), and the rapid alerting capabilities (e.g., an email within 30 seconds for a secret uploaded to Jira). These operational successes and the architectural breakdown collectively demonstrate the system's practical application and its tangible impact on Red Hat's security posture.

Defensive Implications

▶ Watch: Tracking secret resolution across thousands of repositories (Q&A) (41:30)

The insights from Red Hat's experience and the broader industry landscape offer critical defensive implications for organizations aiming to prevent and mitigate data leaks:

  1. Implement Comprehensive Secret Scanning: Organizations must deploy automated secret scanning across their entire digital footprint. This includes all Source Code Management (SCM) systems (Git, GitLab, GitHub, personal accounts), CI/CD pipelines (logs and artifacts), bug tracking systems (Jira), internal systems, chat platforms, container registries, and cloud storage. Tools like Gitleaks, TruffleHog, GitGuardian, and platform-native solutions like GitHub Advanced Security and GitLab Secret Detection should be considered.
  2. Prioritize Proactive Prevention: Reactive scanning, while essential, is not enough. Defenders should shift left by implementing:
  • Secret Management Platforms: Centralize the storage and access of secrets using dedicated platforms like HashiCorp Vault. This keeps secrets out of code, environment files, and configuration, provides better access logs, and enables fine-grained control.
  • Short-Lived Credentials: Transition away from long-lived static keys to ephemeral, short-lived credentials, such as those provided by AWS Security Token Service (STS). This limits the exposure window even if a credential is leaked.
  • Pre-Commit Hooks and CI/CD Scanning: Integrate secret scanning directly into developer workflows (e.g., pre-commit hooks) and CI/CD pipelines to prevent secrets from ever entering repositories or being deployed.
  • Secure Defaults and API Design: Advocate for and prioritize platforms and services that offer secure defaults for key creation, enforce shorter lifespans for powerful credentials, and provide easily identifiable keys (e.g., with prefixes) and robust APIs for quick revocation.
  1. Build Rapid Remediation Capabilities: Time is of the essence when a secret is leaked. Defensive strategies must include:
  • Automated Revocation: Develop or integrate systems that can automatically disable or quarantine leaked credentials immediately upon detection.
  • Clear and Accessible Documentation: Provide developers with concise, actionable instructions for rotating and revoking secrets across various platforms (resources like howtorotate.com are invaluable).
  • Effective Notification and Escalation: Ensure that alerts are sent quickly to the right individuals (the owner, their manager, security teams) with clear calls to action. Implement escalation paths for unaddressed leaks.
  1. Foster a Culture of Empathy and Education: Recognize that most leaks are accidental. Security teams should partner with engineers, approaching incidents with respect and empathy, focusing on problem-solving rather than blame. This approach turns incidents into learning opportunities, reduces defensiveness, and helps transform engineers into security advocates. Regular training and guidance on secure coding practices and secret management are crucial.
  2. Engage in Industry Collaboration: Participate in initiatives like the Secret Scanning SIG to contribute to and benefit from shared knowledge, standardized rule sets, detection benchmarking, and best practices. This collective effort strengthens the security posture of the entire ecosystem.
  3. Understand Your Organization's Exposure: Regularly assess where employees are storing and sharing secrets, what accounts they use (personal vs. corporate), and the overall coverage of secret scanning tools across all relevant systems. Use quantifiable data from scanning efforts to track trends, demonstrate value, and direct future improvements.

Key Takeaways

  • Secret leaks are a pervasive and escalating threat, with millions of new hard-coded credentials appearing annually. Attackers exploit these within seconds, while remediation often takes months, creating a critical window of vulnerability.
  • Automated, comprehensive secret scanning, as demonstrated by Red Hat's internal leak-alerting system, is crucial for detecting leaks at scale. Such systems can drastically reduce time-to-mitigation from days to minutes, significantly limiting attacker opportunities and potential financial losses.
  • Effective secret management requires a layered, proactive approach that extends beyond mere detection. This includes adopting secret management platforms, utilizing short-lived credentials, implementing pre-commit hooks and CI/CD scanning, and ensuring secure defaults in all development tools and platforms.
  • Handling secret leak incidents demands empathy, respect, and clear communication. By partnering with engineers to solve problems rather than assigning blame, organizations can transform incidents into valuable learning experiences and cultivate security advocates within their development teams.
  • The industry must collaborate to address this systemic problem. Initiatives like the Secret Scanning SIG aim to standardize rule formats, benchmark tooling, and share best practices, fostering an ecosystem where detection, remediation, and prevention are more accessible and effective for everyone.
  • Providers of API keys and credentials have a responsibility to design their offerings securely. This includes making keys easily identifiable, providing simple and robust APIs for quick revocation, offering clear documentation on rotation, and enforcing secure defaults like shorter lifespans for powerful credentials.

About the Speaker(s)

Joshua Padman, known affectionately as "Wizzy," is an experienced Information Security professional currently working at Red Hat. He has been with Red Hat for eight years, initially spending five years in product security before transitioning to the information security team. His current role focuses heavily on incident response and automation, where he leads projects such as the internal leak-alerting system discussed in his talk. Padman is also a long-term attendee and dedicated volunteer for BSides Canberra, demonstrating his commitment to the broader security community. His work at Red Hat involves navigating the unique challenges of securing one of the world's largest open-source companies, balancing the necessities of security with an open culture and upstream-first mentality.

Reviews

→ Top-rated talks at BSides Canberra VIII (2025)

All talks from BSides Canberra VIII (2025)