HomeBlogRed Hat GitLab: Secrets in Code
    DevSecOpsSecrets Management

    Red Hat's GitLab Had 570GB of Internal Repos Stolen — Including 800 Files With Live AWS Keys and VPN Configs

    The Crimson Collective stole 570GB from approximately 28,000 Red Hat GitLab repositories — including 800 credential exposure records containing live AWS tokens, VPN configurations, API keys, and client credentials for IBM, Cisco, the NSA, and American Express. The lesson: secrets hardcoded in source code are a breach waiting to happen.

    Leanops Compliance Team 7 min readOctober 18, 2025

    What was stolen

    • Volume: 570GB across approximately 28,000 repositories
    • Critical files: ~800 CERs (Credential Exposure Records) — files containing live secrets
    • Contents: AWS access tokens, VPN configurations, API keys, internal SSH keys
    • Downstream exposure: Client credentials for IBM, Cisco, NSA, American Express, DoD contractors
    • Attack: One credential theft → access to secrets for hundreds of other organisations

    Why secrets in code are the #1 developer security mistake

    Hardcoded credentials in source code is not a rare or exotic problem. It is the most common unintentional security mistake in software development. A developer under deadline pressure adds an AWS access key directly to a config file. A CI/CD pipeline stores a database password as a plain-text environment variable committed to the repo. A .env file gets added to version control by accident. These happen hundreds of times a day across the industry.

    The reason the Red Hat breach is particularly severe is the cascade effect: one stolen repository set — containing credentials for Red Hat's infrastructure — gave attackers access to credentials for Red Hat's clients. One breach, hundreds of downstream organisations exposed. This is the secrets management supply chain problem.

    Scan your repositories for exposed secrets — right now

    GitHub Secret Scanning
    Free

    Built into all GitHub repositories. Automatically detects common secret patterns (AWS keys, Google API tokens, private keys) and alerts you when they're committed. Enable it in Settings → Code security.

    GitGuardian
    Free

    Scans your entire commit history — not just new commits — for secrets. The free tier covers public and private repos. Used by thousands of engineering teams.

    truffleHog
    Free

    Open-source tool you can run locally or in CI/CD. Detects secrets using regex patterns and entropy analysis. Good for a one-time historical scan of your repos.

    git-secrets (AWS)
    Free

    A pre-commit hook that prevents AWS credentials from being committed in the first place. Install it in every developer's local environment as a first line of defence.

    The right way to handle secrets: a practical checklist

    Never hardcode credentials — use environment variables or secret managers

    AWS Secrets Manager, HashiCorp Vault, Google Secret Manager, or even a .env file excluded from version control are all acceptable. The key: secrets never live in your codebase.

    Add .env to .gitignore immediately on every new project

    This should be the first commit in every repository. It takes 10 seconds and prevents the most common accidental credential exposure.

    Rotate all credentials that have ever touched a repository

    If a key was ever committed — even briefly, even in a private repo — treat it as compromised. Rotate it immediately. Revoke the old one.

    Use short-lived, scoped credentials wherever possible

    AWS IAM roles, Google Workload Identity, and GitHub OIDC tokens let you use temporary, automatically-rotated credentials instead of long-lived access keys. Zero stored secrets.

    Audit who has access to your code repositories

    Former employees, contractors, and third-party integrations may still have read access to your GitLab or GitHub. Review access quarterly and revoke stale permissions.

    The SOC 2 angle: CC6.7 encryption and secrets management

    SOC 2 CC6.7 requires that sensitive data — including credentials and encryption keys — is protected in storage and transmission. Hardcoded credentials in a repository fail this control on multiple counts: they are stored in plaintext, accessible to everyone with repo access, and often inadvertently transmitted to external services (CI/CD, code review tools) without encryption at rest.

    In a SOC 2 audit, the auditor will ask: how do you manage credentials and API keys? A documented secrets management policy, combined with evidence of secret scanning in your CI/CD pipeline, is the expected answer.

    Check your domain's external security posture

    Our Domain Health Monitor checks your SSL, DNS, HTTP headers, and infrastructure — a quick way to spot external-facing gaps before attackers do.

    Run a Domain Health Check

    lean.ops

    IT Compliance & Global Readiness for Startups