secret
Any value that grants access, such as a password, access token or private key, and must be kept out of code and version control.
A leaked secret lets whoever finds it act with its access until it is rotated.
In more detail
Secrets belong in a secret manager or an encrypted file, never in plain code, configuration, logs or a Git repository. If one leaks, rotate it; deleting the copy is not enough.
Examples
Ansible keeps secrets in Vault-encrypted files and hides them from output with no_log: true.Twelve-factor apps read secrets from the environment and never keep them in the codebase; the open source test catches secrets in version control. A proposed revision of the manifesto replaces long-lived secrets with short-lived workload identity.Committing a token to Git leaks it into every clone, even after the file is untracked.In Next.js only variables prefixed NEXT_PUBLIC_ reach the browser; keep secrets unprefixed and import them only from server-only modules.Never log a password or put a token in a span attribute or metric label..env files with passwords belong in .gitignore.Audit policies log access to Kubernetes Secrets at Metadata level so the secret value itself never lands in logs.sk-live-4d1f-demo, the fake payment key used throughout module twoIn Terraform, secrets must never go into committed .tfvars files. Supply them through environment variables or a secret manager, and remember that anything a resource uses ends up in state unless it is ephemeral or write-only. Rotate any secret that appears in a state snapshot someone should not have seen.In this course: A real payment client needs a secret key, which is one more reason tests use a double instead of calling it. Store secrets in a secret manager or the pipeline's secret store, never in test code.Related terms
- Ansible Vault — Ansible's built-in feature and command for encrypting secrets such as passwords and keys so the encrypted files can live in the project.
- secret store — A dedicated service that stores secrets such as passwords and keys, controls who may read them and records each access.
- no_log — A task keyword that hides the task's arguments and results from output and logs, used when a task handles a secret.
- key rotation — Replacing a password or key with a new one on a schedule or after a suspected leak, and re-encrypting what it protected.
- Authorization header — The request header that carries a client’s credentials, such as Authorization: Bearer <token> or Authorization: Basic <encoded>.
- redaction — Removing or hiding sensitive values, such as tokens or personal data, before data is logged, displayed or shared.
- leaky error — An error response that reveals private details such as a stack trace, a database query, a secret or internal names.
- repository secret — A secret stored on one repository that any workflow in that repository can read.
- environment secret — A secret attached to a deployment environment, readable only by jobs that declare they deploy to that environment.
- secret masking — The runner's replacement of known secret values with asterisks in job logs.
- GITHUB_TOKEN — A short-lived access token GitHub creates for each job so the workflow can call the GitHub API for its own repository.
- access key — A long-lived cloud credential made of a key ID and a secret key that works until someone deletes it.
- AWS Secrets Manager — An AWS service that stores passwords, keys and other secrets encrypted and hands them to programs that are allowed to read them.
- credential rotation — Replacing a secret, such as an access key or password, with a new one and retiring the old one.
- build secret — A password or token given to one build step without being saved in any image layer.
- environment variable — A named setting such as PORT=8000 that a program reads from its surroundings when it starts.
- ENV — The Dockerfile instruction that sets an environment variable in the image, visible during the build and in every container.
- access token — A generated string that proves who you are to a service, used instead of a password and revocable on its own.
- whiteout file — A marker in a higher layer that says a file from a lower layer has been deleted.
- NEXT_PUBLIC_ prefix — The naming rule in Next.js where only environment variables starting with NEXT_PUBLIC_ are copied into browser code.
- leaked secret — A password, token or key that has been exposed, for example by being committed to a repository, and must be treated as known to others.
- .gitignore — A text file of patterns naming untracked files Git should not report or add, such as build output and logs.
- image — A read-only package containing a program and everything it needs to run, used as the template for containers.
- server-only — A small npm package that makes the build fail if a module containing it is imported into client code.
- personally identifiable information — Any information that can identify a person, directly or combined with other data, such as a name, email address, location or account number.
- span attribute — A typed key and value recorded on a span, such as http.route="/checkout", that explains what the work did.
- secrets module — The standard library module for generating random values that are safe to use as passwords, tokens and other secrets.
- secret scanning — Searching code, commits and files for credentials such as keys and tokens, ideally before they are committed.
- hardcoded credential — A password, key or token written directly into source code or a configuration file in the repository.
- secret manager — A service that stores secrets centrally, controls who can read them and records every access.
- sensitive value — A variable or output marked sensitive = true, which Terraform hides in plan output and the terminal but still stores in state in plain text.
- ephemeral values — Values, added in Terraform 1.10, that exist only during a run and are never written to state or plan files.
- API key — A secret string that identifies and authorises a program calling an API, usually sent in a header.
Taught in
- What An AI Engineer Does — AI Engineering: LLM Apps, RAG & Agents
- Designing Tools A Model Can Use — AI Engineering: LLM Apps, RAG & Agents
- Threat-Model An LLM App — AI Engineering: LLM Apps, RAG & Agents
- Working With AI Coding Assistants — AI Engineering: LLM Apps, RAG & Agents
- Writing Your First Playbook — Ansible Configuration Management at Scale
- Securing Data With Ansible Vault — Ansible Configuration Management at Scale
- Vault IDs And Multiple Passwords — Ansible Configuration Management at Scale
- Environment Specific Configuration — Ansible Configuration Management at Scale
- Performance, Forks And Best Practices — Ansible Configuration Management at Scale
- Headers And Content Negotiation — Modern API Architecture: REST, GraphQL & gRPC
- Basic Auth, Tokens And Sessions — Modern API Architecture: REST, GraphQL & gRPC
- Security Best Practices — Modern API Architecture: REST, GraphQL & gRPC
- Observability: Logs, Metrics, Traces — Modern API Architecture: REST, GraphQL & gRPC
- Handling PII And Data Privacy — Modern API Architecture: REST, GraphQL & gRPC
- Staging Is Gone: Desired State, Declarations And The State Store — Certified GitOps Associate (CGOA) Exam Prep
- Terminology Sprint: One Incident, Nine Terms — Certified GitOps Associate (CGOA) Exam Prep
- Someone Cleaned Up The History: Versioned And Immutable — Certified GitOps Associate (CGOA) Exam Prep
- Twelve Keys To Production: Pulled Automatically — Certified GitOps Associate (CGOA) Exam Prep
- Two Clicks Nobody Wrote Down: Configuration And Infrastructure As Code — Certified GitOps Associate (CGOA) Exam Prep
- Friday At Five To Five: DevOps And DevSecOps — Certified GitOps Associate (CGOA) Exam Prep
- What Does CI Still Do? CI, CD And Where GitOps Starts — Certified GitOps Associate (CGOA) Exam Prep
- Three Minutes Of Waiting: Pull Versus Event-Driven — Certified GitOps Associate (CGOA) Exam Prep
- Three Regions By Spring: GitOps Architecture — Certified GitOps Associate (CGOA) Exam Prep
- Patterns Sprint: Eight Needs, One Pattern Each — Certified GitOps Associate (CGOA) Exam Prep
- A Bucket Nobody Wrote Down: State Stores Beyond Git — Certified GitOps Associate (CGOA) Exam Prep
- A Rollback Nobody Heard: Notifications, Observability And CI — Certified GitOps Associate (CGOA) Exam Prep
- Tooling Sprint: The CTO's Shopping List — Certified GitOps Associate (CGOA) Exam Prep
- The Evening Before: Final Review — Certified GitOps Associate (CGOA) Exam Prep
- Runners: Where Code Executes — Continuous Integration & Continuous Delivery Pipelines
- Triggers and the Event Model — Continuous Integration & Continuous Delivery Pipelines
- Securing Pipelines: Secrets Management — Continuous Integration & Continuous Delivery Pipelines
- Keyless Authentication: OIDC to the Cloud — Continuous Integration & Continuous Delivery Pipelines
- Generators Write The YAML, You Decide — Certified Kubernetes Administrator (CKA) Exam Prep
- What A Container Said Before It Died — Certified Kubernetes Administrator (CKA) Exam Prep
- Four Faults, Twelve Minutes — Certified Kubernetes Administrator (CKA) Exam Prep
- Helm And Kustomize For Cluster Components — Certified Kubernetes Administrator (CKA) Exam Prep
- Ingress: Hosts, Paths And The Class That Serves Them — Certified Kubernetes Administrator (CKA) Exam Prep
- Volumes By Hand: Access Modes, Binding And Reclaim — Certified Kubernetes Administrator (CKA) Exam Prep
- Persistent And Ephemeral Volumes — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Helm: Install, Upgrade And Roll Back — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Kustomize Bases, Overlays And Patches — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Monitoring With The Built-in CLI — Certified Kubernetes Application Developer (CKAD) Exam Prep
- ConfigMaps And Secrets — Certified Kubernetes Application Developer (CKAD) Exam Prep
- ServiceAccounts And Tokens — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Configuration And Security: Timed Drill And Checkpoint — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Services And Networking: Timed Drill And Checkpoint — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Mock Exam: Sixteen Tasks Against The Clock — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Six Seconds, Every Secret — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Ingress TLS: When The Padlock Lies — Certified Kubernetes Security Specialist (CKS) Exam Prep
- RBAC: Find The Path To Cluster Admin — Certified Kubernetes Security Specialist (CKS) Exam Prep
- ServiceAccounts: Take Back The Key — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Pod Security Admission: Created, Never Started — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Encryption At Rest: What etcd Really Holds — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Secrets In Use: Leaks Through Env, Specs And Images — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Audit Policy: Choosing What The Cluster Remembers — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Investigating An Attack: One Timeline, Two Logs — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Detection Review: Which Signal Catches It? — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Mock Exam: Seventeen Security Tasks Against The Clock — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Final Review: The Cluster You Would Defend — Certified Kubernetes Security Specialist (CKS) Exam Prep
- IAM as the Foundation — Cloud Infrastructure & Hyperscaler Architecture
- Users, Groups and Roles — Cloud Infrastructure & Hyperscaler Architecture
- Policies and Least Privilege — Cloud Infrastructure & Hyperscaler Architecture
- The Danger of Long-Lived Keys — Cloud Infrastructure & Hyperscaler Architecture
- Policy Simulation and Dry Runs — Cloud Infrastructure & Hyperscaler Architecture
- Elastic Compute Cloud (EC2) — Cloud Infrastructure & Hyperscaler Architecture
- Containers on AWS (ECS and EKS) — Cloud Infrastructure & Hyperscaler Architecture
- Managed Relational Databases (RDS) — Cloud Infrastructure & Hyperscaler Architecture
- Shared Responsibility Model & Cloud Threat Landscapes — Cloud Security & DevSecOps Engineering
- Security Landing Zones & Centralized Egress Inspection — Cloud Security & DevSecOps Engineering
- Cloud IAM Architecture & Permission Boundaries — Cloud Security & DevSecOps Engineering
- Workload Identity Federation: Eliminating Static Keys — Cloud Security & DevSecOps Engineering
- Cross-Account AssumeRole Chains & Temporary STS — Cloud Security & DevSecOps Engineering
- Least Privilege Enforcement & CIEM Architecture — Cloud Security & DevSecOps Engineering
- Shift-Left Security Principles & Automated Pipeline Gates — Cloud Security & DevSecOps Engineering
- Pre-Commit Secret Scanning with Gitleaks & Entropy — Cloud Security & DevSecOps Engineering
- Static Application Security Testing with Semgrep — Cloud Security & DevSecOps Engineering
- Software Composition Analysis with Trivy — Cloud Security & DevSecOps Engineering
- Supply Chain Security: SBOMs & Cosign Signing — Cloud Security & DevSecOps Engineering
- Runtime Anomaly Detection with Falco & eBPF — Cloud Security & DevSecOps Engineering
- Securing the Kubernetes Control Plane & Node Components — Cloud Security & DevSecOps Engineering
- Static IaC Scanning: Linting Terraform with Checkov — Cloud Security & DevSecOps Engineering
- Enforcing OPA Guardrails on Terraform Plan Payloads — Cloud Security & DevSecOps Engineering
- Continuous IaC Drift Detection & State Protection — Cloud Security & DevSecOps Engineering
- CloudTrail Logging, Integrity Validation & Athena — Cloud Security & DevSecOps Engineering
- Threat Detection with GuardDuty & Anomaly Analytics — Cloud Security & DevSecOps Engineering
- Envelope Encryption & Data Protection with KMS — Cloud Security & DevSecOps Engineering
- CIA Triad, Non-Repudiation & Parkerian Hexad — Cybersecurity Fundamentals, GRC & Cryptography
- Social Engineering, Phishing & Human Defense — Cybersecurity Fundamentals, GRC & Cryptography
- Symmetric Encryption: AES-GCM & ChaCha20 — Cybersecurity Fundamentals, GRC & Cryptography
- Asymmetric Cryptography: RSA, ECC & Diffie-Hellman — Cybersecurity Fundamentals, GRC & Cryptography
- Cryptographic Hashing: SHA-256, SHA-3 & Passwords — Cybersecurity Fundamentals, GRC & Cryptography
- Post-Quantum Cryptography & Key Lifecycles — Cybersecurity Fundamentals, GRC & Cryptography
- Data Classification Schemes & Sensitivity Labeling — Cybersecurity Fundamentals, GRC & Cryptography
- Data States: Security at Rest, in Transit, and in Use — Cybersecurity Fundamentals, GRC & Cryptography
- Data Loss Prevention & Egress Monitoring — Cybersecurity Fundamentals, GRC & Cryptography
- Backup Architectures: 3-2-1, Immutability & Air-Gaps — Cybersecurity Fundamentals, GRC & Cryptography
- Restoration: Failed Deployment Recovery Time — DevOps & Site Reliability Engineering
- Config And Backing Services — DevOps & Site Reliability Engineering
- Admin Processes And The Open Source Update — DevOps & Site Reliability Engineering
- Building And Versioning The Artifact — DevOps & Site Reliability Engineering
- Infrastructure As Code Context — DevOps & Site Reliability Engineering
- Containers And Orchestration Context — DevOps & Site Reliability Engineering
- Pipelines And GitOps Context — DevOps & Site Reliability Engineering
- Union Filesystems, Images And Writable Layers — Docker Architecture & Production Containers
- Build Context, Dockerignore And Your First Dockerfile — Docker Architecture & Production Containers
- RUN, SHELL And Efficient Layer Caching — Docker Architecture & Production Containers
- ARG, ENV, LABEL, EXPOSE And VOLUME — Docker Architecture & Production Containers
- CMD, ENTRYPOINT, USER And Process Signals — Docker Architecture & Production Containers
- Multi Stage Builds, Targets And Build Secrets — Docker Architecture & Production Containers
- Authenticate, Tag, Push And Pull From A Registry — Docker Architecture & Production Containers
- Minimal Bases, Non Root Users And Smaller Images — Docker Architecture & Production Containers
- Scan, Patch And Inspect The Software Supply Chain — Docker Architecture & Production Containers
- Bind Mounts, Permissions And Backups — Docker Architecture & Production Containers
- Port Publishing, Localhost And Network Troubleshooting — Docker Architecture & Production Containers
- Environment, Secret Files And Runtime Restrictions — Docker Architecture & Production Containers
- Define The Service And Database With Compose — Docker Architecture & Production Containers
- Build, Test And Promote The Same Image In CI — Docker Architecture & Production Containers
- Harden And Deliver The Complete Service Stack — Docker Architecture & Production Containers
- From Local Containers To Kubernetes — Docker Architecture & Production Containers
- The Options Pattern: Strongly Typed Configuration — Modern .NET Core, C# & Enterprise Microservices
- Environment Layering and User Secrets — Modern .NET Core, C# & Enterprise Microservices
- Manual Object Mapping — Modern .NET Core, C# & Enterprise Microservices
- Global Exception Handling and Problem Details — Modern .NET Core, C# & Enterprise Microservices
- Environment Configuration: Secrets & Multi-Stage — Production Full-Stack Engineering
- OAuth2 & OpenID Connect: Social Auth & PKCE Flows — Production Full-Stack Engineering
- JWT Verification: Asymmetric Keys & Refresh Rotation — Production Full-Stack Engineering
- Structured Logging & Correlation IDs: Context Stitching — Production Full-Stack Engineering
- Ignoring Files, And The Tracked File Trap — Advanced Git Internals & Distributed Workflows
- Configuration And Profiles — Modern Java: Virtual Threads & High-Throughput Services
- Packaging Into A Container — Modern Java: Virtual Threads & High-Throughput Services
- Bootstrap A Local Cluster And Check Your Context — Kubernetes: Production-Grade Container Orchestration
- Troubleshooting: ImagePullBackOff And Failed Rollouts — Kubernetes: Production-Grade Container Orchestration
- Ingress: Controllers, Hosts, Paths And TLS — Kubernetes: Production-Grade Container Orchestration
- ConfigMaps, Secrets And Configuration Updates — Kubernetes: Production-Grade Container Orchestration
- Authentication, ServiceAccounts And Short Lived Tokens — Kubernetes: Production-Grade Container Orchestration
- RBAC: Roles, Bindings And Least Privilege — Kubernetes: Production-Grade Container Orchestration
- Drain, Upgrade, Version Skew And Certificate Maintenance — Kubernetes: Production-Grade Container Orchestration
- Troubleshooting: API Server And Control Plane Failures — Kubernetes: Production-Grade Container Orchestration
- Server Components: Async Execution & Constraints — Next.js 15 & Modern App Router Architecture
- Component Tree Composition: Interleaving RSC & Client — Next.js 15 & Modern App Router Architecture
- Serialization Boundaries: Props & Server Guardrails — Next.js 15 & Modern App Router Architecture
- Server Action Security: Zod Validation & Auth Gates — Next.js 15 & Modern App Router Architecture
- Session Management: Secure Cookies & Token Validation — Next.js 15 & Modern App Router Architecture
- Cryptographic Primitives: node:crypto & Ciphers — Node.js Internals & Backend Services
- Structured Logging And Why Text Fails — Full-Stack Observability: Metrics, Tracing & Logging
- Prometheus Scraping And The Pull Model — Full-Stack Observability: Metrics, Tracing & Logging
- OpenTelemetry: The Vendor Neutral Path — Full-Stack Observability: Metrics, Tracing & Logging
- Instrumenting A Service With Client Libraries — Full-Stack Observability: Metrics, Tracing & Logging
- Installing Python On A Mac — Hands-on Python: Complete Video Course & Book
- Chapter Three In One Sitting — Hands-on Python: Complete Video Course & Book
- Dates, Times And Random — Hands-on Python: Complete Video Course & Book
- Shipping: scripts, entry points and git — Hands-on Python: Complete Video Course & Book
- Detection as Code: Authoring & Testing Sigma Rules — Security Operations & Threat Hunting (SOC)
- Windows Event Logs, Sysmon & Linux Auditd Telemetry — Security Operations & Threat Hunting (SOC)
- Cyber Kill Chain vs MITRE ATT&CK Framework — Security Operations & Threat Hunting (SOC)
- Adversary Tactics, Techniques & Procedures (TTP) Mapping — Security Operations & Threat Hunting (SOC)
- Detecting Persistence: Tasks, Registry & Services — Security Operations & Threat Hunting (SOC)
- Containment & Eradication: Host, Net & Identity — Security Operations & Threat Hunting (SOC)
- Recovery & System Validation Testing — Security Operations & Threat Hunting (SOC)
- Why Secrets Leak — Application Security & Threat Modeling for Engineers
- The Environment Variable Trap — Application Security & Threat Modeling for Engineers
- Moving To A Secret Manager — Application Security & Threat Modeling for Engineers
- Workload Identity — Application Security & Threat Modeling for Engineers
- Secret Scanning — Application Security & Threat Modeling for Engineers
- Parameterising With Input Variables — Infrastructure as Code with Terraform
- Querying Existing Infrastructure With Data Sources — Infrastructure as Code with Terraform
- The Problem With Local State — Infrastructure as Code with Terraform
- Configuring A Remote Backend — Infrastructure as Code with Terraform
- State Locking With Use Lockfile — Infrastructure as Code with Terraform
- Workspaces For Multiple Environments — Infrastructure as Code with Terraform
- Security: Secrets In State And Ephemeral Values — Infrastructure as Code with Terraform
- Provider Mocking For Tests — Infrastructure as Code with Terraform
- What Test Doubles Are For — Automated Testing, TDD & Quality Engineering
- What To Automate Away — Automated Testing, TDD & Quality Engineering
- Tuples: Fixed Length, Labeled Elements And Variadic Tuples — Production TypeScript
- The in Operator And Instanceof Narrowing — Production TypeScript
- Core Utilities: Partial, Required, Readonly, Pick And Omit — Production TypeScript
- One Hour, No Weights Published — HashiCorp Terraform Associate (004) Exam Prep
- Providers: How Terraform Reaches Every API — HashiCorp Terraform Associate (004) Exam Prep
- Versions, The Lock File And Provider Aliases — HashiCorp Terraform Associate (004) Exam Prep
- State: Terraform's Memory Of What It Built — HashiCorp Terraform Associate (004) Exam Prep
- Write, Plan, Apply, And What Init Prepares — HashiCorp Terraform Associate (004) Exam Prep
- Reading A Plan, Saving It, Applying It — HashiCorp Terraform Associate (004) Exam Prep
- Input Variables, Outputs, And Which Value Wins — HashiCorp Terraform Associate (004) Exam Prep
- Custom Conditions: Validation, Pre And Postconditions, Checks — HashiCorp Terraform Associate (004) Exam Prep
- ansible-navigator: The Settings File The Exam Reads — RHCE in Ansible (EX294): Automate Red Hat Systems
- File Systems And Mounts: mounted, present And UUIDs — RHCE in Ansible (EX294): Automate Red Hat Systems
- Users And Groups From A List, With Passwords That Settle — RHCE in Ansible (EX294): Automate Red Hat Systems
- Jinja Templates: One File, A Different Text Per Host — RHCE in Ansible (EX294): Automate Red Hat Systems
- Ansible Vault: Secrets Encrypted, Runs Without A Prompt — RHCE in Ansible (EX294): Automate Red Hat Systems
- Drill: People, Passwords And sudo From The Vault — RHCE in Ansible (EX294): Automate Red Hat Systems
References
- OWASP Secrets Management Cheat Sheet
- Protecting sensitive data with Ansible Vault
- GitHub Docs: Secrets
- GitHub Docs: Using secrets in GitHub Actions
- Secrets in Compose (Docker docs)
- Safe storage of app secrets in development
- OWASP Logging Cheat Sheet
- Manage sensitive data
Certification courses
- AWS AIP-C01 course and practice exam: AI engineering with LLM apps, RAG and agents
- CGOA course and practice exam: Certified GitOps Associate
- CKA course and practice exam: Certified Kubernetes Administrator
- CKAD course and practice exam: Certified Kubernetes Application Developer
- CKS course and practice exam: Certified Kubernetes Security Specialist
- Terraform Associate course and practice exam: HashiCorp Terraform Associate (004)
- RHCE course and practice exam: Red Hat Certified Engineer in Ansible (EX294)