Join our Newsletter — 33% off our NHI Course

How to Securely Manage Secrets in Docker

 

(@nhi-mgmt-group)
Member Moderator
Joined: 1 year ago
Posts: 16876
Topic starter  

TL;DR: GitGuardian’s ggshield cheat sheet shows how terminal-first secrets scanning can cover repos, paths, archives, Docker images, packages, CI pipelines, hooks, Honeytokens, and leaked-secret checks, rather than relying on a one-time repository scan. The underlying lesson is that secrets governance has to move left, stay continuous, and fit the way developers actually work.

Editorial analysis by NHI Mgmt Group, based on content published by GitGuardian: “How To Use ggshield To Avoid Hardcoded Secrets [cheat sheet included]”.

By the numbers:

Key questions

Q: What breaks when secret scanning is only done before commit?

A: The main break point is enforcement.

Q: Why do developer workflows matter for secrets governance?

A: Because developers create and package code in the terminal, the governance model has to meet them there.

Q: How do Honeytokens help detect secrets exposure?

A: Honeytokens act as decoy credentials that should never be used legitimately, so any access attempt becomes an alert signal.

Practitioner guidance

  • Embed scanning before commit and push Use pre-commit and pre-push checks so secrets are blocked while developers still have enough context to fix them.
  • Scan artefacts beyond source repositories Extend scanning to local files, commit ranges, archives, Docker images, and packages so exposed credentials are not missed simply because they are outside the repo tree.
  • Pair prevention with tripwires Use Honeytokens for decoy credentials and HasMySecretLeaked checks for public exposure so you can detect both active use and prior leakage.

Bottom line: Secrets management fails when scanning is treated as a repository task instead of a workflow control across files, builds, and packages.

What's in the full article

GitGuardian's full article covers the operational detail this post intentionally leaves for the source:

  • Exact ggshield command syntax for repo, path, archive, Docker, and PyPI scans
  • Step-by-step examples for pre-commit, pre-push, and pre-receive hook setup
  • Authentication and configuration options, including login scopes and token handling
  • HasMySecretLeaked workflow details, including fingerprinting and decrypted output

👉 Read GitGuardian's ggshield cheat sheet on terminal-based secrets scanning →

Explore further

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



   
Quote
(@mr-nhi)
Member Moderator
Joined: 5 months ago
Posts: 17366
 

Secrets governance fails when it is limited to the repository boundary: The article shows that credentials can appear in files, archives, container exports, packages, commit ranges, and CI outputs, not just in git history. That means the governing assumption that one repo scan is enough no longer holds. The practical conclusion is that secrets control has to follow the artefact lifecycle, not the developer’s preferred location.

A few things that frame the scale:

  • 28.65 million new hardcoded secrets were detected in public GitHub commits in 2025 alone, a 34% year-over-year increase and the largest single-year jump ever recorded, according to the State of Secrets Sprawl 2026.
  • Internal repositories are 6x more likely to contain secrets than public ones (32.2% vs 5.6%), contradicting the assumption that private repos are safe, according to the State of Secrets Sprawl 2026.

A question worth separating out:

Q: What is the difference between prevention and leaked-secret checking?

A: Prevention tries to stop new secrets from entering code, while leaked-secret checking asks whether a credential fingerprint already exists in public exposure. Both are needed because a secret can be removed locally and still remain valid in other places. Governance needs both front-end blocking and back-end verification.

👉 Read our full editorial: ggshield cheat sheet shows how secrets scanning fits terminal workflows



   
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.