Join our Newsletter — 33% off our NHI Course

What do CI/CD logs and artifacts reveal about secret leakage?

 

(@nhi-mgmt-group)
Member Moderator
Joined: 2 years ago
Posts: 19717
Topic starter  

TL;DR: Truffle Security's analysis of CI/CD pipelines finds secrets still leak through logs, structured outputs, and public artifacts despite masking and secret scanning. Security teams need controls that separate secret-bearing jobs from public release steps and treat any exposed token as compromised.

Editorial analysis by NHI Mgmt Group, based on content published by Truffle Security: “How Secrets Leak in CI/CD Pipelines”.

Key questions

Q: Why do public build logs create so much risk for API keys and tokens?

A: Public build logs turn routine job output into an accessible collection point for credentials, especially in open-source or shared environments.

Q: How should security teams reduce secret leakage in CI/CD logs without blocking normal developer workflows?

A: Use layered controls that reduce exposure before secrets ever reach logs, then shorten the attack window when leakage still occurs.

Q: What breaks when secrets are stored in code and CI/CD tools?

A: Access becomes invisible, reusable, and hard to revoke, which means the organisation loses control of where authentication material exists.

Practitioner guidance

  • Separate private and public pipeline stages Run secret-handling steps in isolated jobs and keep release or publication work in a different job with no access to decrypted material.
  • Inventory every secret exposure path Map where credentials appear in logs, environment variables, decrypted files, structured config, and published artifacts so the same secret is not governed by only one path.
  • Rotate credentials after pipeline exposure Treat any leaked CI/CD token, key, or refresh credential as compromised and revoke it before it can be reused in downstream services.

Bottom line: CI/CD secret leakage persists because the same credential can appear in logs, structured output, decrypted files, and published artifacts.

Glossary terms: CI/CD Secret Leakage, Second-order secret, Artifact leakage, Secret Masking

What's in the full article

Truffle Security's full post covers the operational detail this analysis intentionally leaves for the source:

  • Example CI/CD configurations showing how secrets leak through verbose output and transformed values
  • Practical handling of encrypted files, third-party vaults, and second-order credential exposure
  • Specific workflow examples where public artifacts carry hidden API keys into distribution
  • Platform-by-platform notes on how TruffleHog scans current and previous CI/CD logs

👉 Read Truffle Security's analysis of how CI/CD pipelines leak secrets →

Explore further

View Full Forum →  |  NHI Foundation Course →  |  Our Services →  |  Read the full analysis →


This topic was modified 3 days ago 2 times by NHI Mgmt Group

   
Quote
(@mr-nhi)
Member Moderator
Joined: 6 months ago
Posts: 20207
 

CI/CD secrets exposure is a lifecycle failure, not a single control failure: the problem spans injection, transformation, reuse, and publication. Masking only addresses one moment in that lifecycle, while attackers exploit every later stage where the secret changes shape or leaves the job boundary. The practitioner lesson is to govern the full secret path, not just the initial variable value.

A few things that frame the scale:

  • 96% of organisations store secrets outside of secrets managers in vulnerable locations including code, config files, and CI/CD tools, according to the Ultimate Guide to NHIs.
  • 82% of detections were malware-free, with attackers using valid credentials and trusted tools, according to CrowdStrike's 2026 Global Threat Report.

A question worth separating out:

Q: What is the difference between log masking and secret governance in pipelines?

A: Log masking is a narrow detection layer that tries to hide known values in output, while secret governance controls where credentials are created, stored, transformed, and released. A pipeline can have strong masking and still leak secrets through files, artifacts, or derived outputs.

👉 Read our full editorial: Secrets leak in CI/CD pipelines despite masking and scanning


This post was modified 3 days ago by NHI Mgmt Group

   
ReplyQuote
Share:

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.