DEV Community

Cover image for Secrets Are Still Killing Pipelines: The Rise of Secretless DevOps
Seth Keddy
Seth Keddy

Posted on

Secrets Are Still Killing Pipelines: The Rise of Secretless DevOps

Despite advances in DevOps practices and automation, one stubborn problem continues to undermine security and reliability: secrets management. Hardcoded secrets such as API keys, passwords, tokens, and certificates embedded directly into code, configuration files, or CI/CD pipelines remain a critical vulnerability. Attackers actively scan repositories and pipelines looking for exposed secrets to exploit.

This article explores why hardcoded secrets are still killing pipelines in 2025, how they are exploited, and how the emerging movement toward secretless DevOps is changing the landscape. We will also compare some of the leading tools and techniques for managing secrets securely without compromising developer velocity.


The Problem with Hardcoded Secrets

Hardcoded secrets are credentials or sensitive data embedded directly into source code, configuration files, or scripts. Common examples include:

  • AWS access keys in Terraform scripts
  • API tokens in GitHub Actions workflows
  • Database passwords in environment files checked into Git repos

These secrets are often committed to version control by accident or out of convenience. Once in GitHub or any public or private repository, they can be leaked, shared, or accidentally exposed. Even private repositories are not immune, especially when attackers gain access through compromised accounts or automated scanning tools.

Why Hardcoded Secrets Persist

Despite the known risks and repeated warnings, hardcoded secrets persist because:

  • Developers prioritize speed and convenience
  • Lack of centralized secret management tools or cultural adoption
  • Limited automation or enforcement during code review and CI/CD
  • Complexity in integrating secrets securely across diverse toolchains

Consequences of Exposed Secrets

  • Unauthorized access to cloud infrastructure
  • Data breaches and compliance violations
  • Service disruptions and downtime
  • Financial loss from unauthorized usage
  • Loss of customer trust and reputation damage

Exploitation of Secrets in GitHub Actions and Terraform

GitHub Actions and Terraform have become staples in modern infrastructure automation and continuous integration/delivery pipelines. However, they are common vectors for secret exposure.

  • GitHub Actions workflows often require access tokens to interact with APIs, cloud providers, or third-party services. Hardcoding these tokens in workflow files or environment variables checked into the repo creates a major risk. Attackers scanning public workflows can steal these tokens and gain access to downstream systems. Example 1: GitHub Actions Workflow Using Secrets from Vault (via Vault CLI)
name: Deploy Application

on:
  push:
    branches:
      - main

jobs:
  deploy:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Install Vault CLI
        run: |
          curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
          sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
          sudo apt-get update && sudo apt-get install vault

      - name: Authenticate to Vault
        env:
          VAULT_ADDR: ${{ secrets.VAULT_ADDR }}
          VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }}
        run: vault login $VAULT_TOKEN

      - name: Retrieve secret from Vault
        id: get_secret
        run: |
          secret=$(vault kv get -field=password secret/myapp/database)
          echo "::set-output name=db_password::$secret"

      - name: Use secret in deployment
        env:
          DB_PASSWORD: ${{ steps.get_secret.outputs.db_password }}
        run: |
          echo "Deploying with DB password: $DB_PASSWORD"
          # Add deployment commands here, e.g., connecting to DB with password

Enter fullscreen mode Exit fullscreen mode

Explanation:

The Vault CLI is installed and authenticated using secrets stored in GitHub Secrets (not hardcoded).

The database password is retrieved dynamically at runtime from Vault.

The secret is injected as an environment variable for subsequent steps.

  • Terraform scripts frequently embed cloud credentials and sensitive data. When these scripts are committed to Git repositories, attackers can use leaked credentials to spin up resources, exfiltrate data, or escalate privileges within cloud accounts.

Attackers use automated scanners like TruffleHog, GitRob, and GitLeaks to hunt for secrets in public and private repositories. Once discovered, they attempt to exploit those secrets immediately.

Terraform Provider Configuration Using Vault for AWS Credentials

provider "vault" {
  address = var.vault_addr
  token   = var.vault_token
}

data "vault_generic_secret" "aws_creds" {
  path = "aws/creds/my-role"
}

provider "aws" {
  region     = var.aws_region
  access_key = data.vault_generic_secret.aws_creds.data["access_key"]
  secret_key = data.vault_generic_secret.aws_creds.data["secret_key"]
}

Enter fullscreen mode Exit fullscreen mode

Explanation:

The Vault provider fetches temporary AWS credentials dynamically from Vault's AWS secrets engine.

These credentials are injected into the AWS provider configuration at runtime.

No AWS access keys are stored in the Terraform code or state files.

What Is Secretless DevOps?

Secretless DevOps is a modern approach to secure automation that eliminates hardcoded secrets from code and pipelines entirely. Instead of embedding secrets in source files or environment variables, secretless DevOps leverages external secret management services and dynamic injection at runtime.

Key principles include:

  • Centralized secret storage: Secrets are stored securely in a dedicated vault or management service, encrypted at rest and in transit.
  • Dynamic injection: Secrets are provided to applications or workflows only when needed and never stored on disk or in repos.
  • Least privilege: Access to secrets is tightly controlled with role-based access control and audit trails.
  • Automated rotation: Secrets are automatically rotated and revoked to minimize the impact of leaks.
  • Integration with existing tools: Secret management integrates seamlessly with CI/CD pipelines, container orchestration, and cloud platforms.

Comparing Emerging Tools and Approaches

Several tools and platforms have emerged to help teams implement secretless DevOps and reduce the risks associated with hardcoded secrets. Here is a comparison of four popular solutions:

Feature HashiCorp Vault Doppler Akeyless External KMS (AWS, Azure, GCP)
Secret Storage Centralized, encrypted vault Cloud-hosted secrets manager Cloud-native secrets platform Managed key stores
Access Control Role-based policies, tokens Teams, projects, and environment scopes Role-based access control IAM policies and permissions
Dynamic Secrets Yes (dynamic database creds, cloud tokens) No (static secrets) Yes (dynamic secrets and ephemeral credentials) Limited, depends on cloud
Secret Injection Methods API, CLI, SDKs, Kubernetes Injector CLI, API, environment variable sync API, CLI, Kubernetes integration SDK and API integration
Secret Rotation Automated rotation for dynamic secrets Manual rotation Automated rotation and revocation Manual or semi-automated
Audit Logging Detailed audit trail Basic logging Advanced audit and compliance Varies by cloud provider
Ease of Use Requires setup and learning curve User-friendly, SaaS-based Enterprise-grade, cloud-native Depends on cloud provider
Pricing Model Open source and enterprise plans SaaS subscription SaaS subscription Included with cloud service usage

HashiCorp Vault

Vault is the industry leader in secret management. It supports dynamic secrets that generate temporary credentials on demand. Vault’s integrations with Kubernetes, CI/CD, and cloud providers make it a powerful, albeit complex, option for secretless pipelines.

Doppler

Doppler offers a developer-friendly, cloud-hosted secrets manager with a focus on simplicity and team collaboration. It lacks dynamic secrets but provides robust environment and project management and smooth integration with GitHub Actions and other tools.

Akeyless

Akeyless provides a cloud-native secrets platform emphasizing dynamic secrets, ephemeral credentials, and unified key management. It supports multiple cloud providers and on-premises systems with a focus on security and compliance for enterprises.

External Key Management Services (KMS)

Cloud providers such as AWS KMS, Azure Key Vault, and Google Cloud KMS provide managed encryption key services. While powerful for encryption and key storage, they are not full-featured secrets managers and require additional tooling to manage secrets lifecycle and injection.


How to Move Toward Secretless Pipelines

  1. Audit existing repositories and pipelines for hardcoded secrets using automated tools like GitLeaks, TruffleHog, or GitRob.
  2. Select a secret management solution based on your team’s needs, complexity, and cloud environment.
  3. Refactor pipelines and infrastructure code to retrieve secrets at runtime via APIs or injected environment variables.
  4. Enforce policies and automation to prevent secret commits, such as Git hooks or CI checks.
  5. Train developers and operations teams on secretless best practices and tools.
  6. Regularly rotate and revoke credentials to limit exposure from leaks.
  7. Implement audit logging and monitoring to detect suspicious access to secrets.

Final Thoughts

Hardcoded secrets remain one of the biggest causes of pipeline breaches and cloud infrastructure compromises. The complexity and speed of modern DevOps workflows mean that any secret leakage can be rapidly exploited.

Secretless DevOps is not just a security best practice; it is becoming a necessary evolution. By centralizing secret management, dynamically injecting credentials, and automating lifecycle processes, organizations can protect their pipelines without sacrificing developer productivity.

The transition requires effort, culture change, and investment in tools. However, the cost of inaction is far greater. Your pipelines and infrastructure will only be as secure as your secrets are managed.

Start auditing your repos and pipelines today. Move toward secretless operations before the next leak kills your production environment.

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.