⚡ ~/naveed Interview Prep
⚡ Portfolio Home 👤 About Naveed Bio & Credentials 📫 Contact Naveed Get In Touch ✍️ Engineering Blog Deep Dives 🎯 Interview Hub 1,000+ Scenarios ☸️ Kubernetes Mastery Hub 24 Modules 🎮 DevOps Arcade & Quizzes Subnet Blitz ⚡ 🗺️ DevOps Roadmaps PDFs & Guides 🤖 Morpheus Analysis AI Quant ↗ 🛠️ Developer Tools Utilities 🧪 Labs & Experiments 📄 Interactive CV & Certs 🔗 All Links & Socials ⚡ Join The Dispatch (Weekly SRE Newsletter) →
← Back to All CI/CD & GitOps Interview Questions Scenario 91 of 187 in CI/CD & GitOps
Senior DevOps / SRE [L2] CI/CD 🔐 Supply Chain Security & Advanced CI/CD Production Scenario [L2]
🎯 Target Role / Context: CI/CD Scenario #82 (L2) · 🔐 Supply Chain Security & Advanced CI/CD

Q: Your team runs `terraform plan` inside a GitHub Actions workflow. You notice that the plan output printed in the CI logs exposes the full contents of a secret stored in AWS Secrets Manager (because a developer added `output "db_password" { value = data.aws_secretsmanager_secret_version.db.secret_string }`). How do you prevent secret exfiltration via plan output?

Three controls must work together:

#CI/CD #L2 #DevOps #Automation #Pipelines
🎙️ Candidate Opening & Architectural Context
""When developers encounter this build or release bottleneck, my first goal is unblocking velocity safely. The interviewer is testing: Terraform sensitive outputs, CI log masking, least-privilege planning.. I structure my answer around systematic triage first, root cause analysis second, and permanent remediation third.""
Advertisement
⚡ Recommended Practice Lab

Want to master this scenario in a live sandbox? KodeKloud's Enterprise GitOps with ArgoCD & Kubernetes Rollouts covers this exact problem with hands-on terminal drills.

🛠️ Production Runbook & Step-by-Step Resolution

Direct Answer: "When developers encounter this build or release bottleneck, my first goal is unblocking velocity safely. The interviewer is testing: Terraform sensitive outputs, CI log masking, least-privilege planning.. I structure my answer around systematic triage first, root cause analysis second, and permanent remediation third."

1️⃣

Initial Diagnostics & Root Cause Analysis

Three controls must work together:

  • Mark outputs sensitive in Terraform: output "db_password" { value = "..." sensitive = true }. Terraform will redact its value in plan output with (sensitive value).
  • Use a read-only IAM role for plan jobs — the plan role has permissions to *read* state but not secretsmanager:GetSecretValue. This means the plan step never even retrieves the plaintext secret.
  • Scrub logs in CI: GitHub Actions allows adding secrets to the masked list dynamically: echo "::add-mask::$SECRET_VALUE". Any occurrence of that string in subsequent log output is replaced with ***.
2️⃣

Remediation & Permanent Safeguards

💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: Mark outputs sensitive in Terraform: output "db_password" { value = "..." sensitive = true }. Terraform will redact its value in p."
⚡ 60-Second Elevator Pitch Talking Points
  • Mark outputs sensitive in Terraform: output "db_password" { value = "..." sensitive = true }. Ter...
  • Use a read-only IAM role for plan jobs — the plan role has permissions to *read* state but not se...
  • Scrub logs in CI: GitHub Actions allows adding secrets to the masked list dynamically: echo "::ad...
⛔ Critical Candidate Mistakes to Avoid in This Scenario

Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:

  1. Promoting application releases to production without an automated, canary-validated rollback mechanism when configuring team runs terraform Pipelines that lack automated rollback mechanisms force engineering teams to scramble manual hotfixes during severe production regressions.
  2. Running concurrent deployment pipeline jobs without stage mutex locking on shared target environments when configuring team runs terraform Concurrent pipeline runs on the same environment race to apply state changes, causing out-of-order commits and unpredictable deployment state.
  3. Omitting dependency lockfiles (package-lock.json, go.sum, Cargo.lock) from continuous integration builds when configuring team runs terraform Omitting lockfiles allows upstream package updates to break builds unpredictably without any changes to application codebase.
  4. Failing to define dynamic cache invalidation keys for CI package managers and layer caches when configuring team runs terraform Stale build caches mask underlying dependency incompatibilities or pull outdated libraries, while un-cached runs slow feedback loops.
Advertisement
Want more CI/CD & GitOps scenarios?
Explore our complete collection of scenario-based CI/CD & GitOps interview runbooks.
Browse All CI/CD & GitOps Questions →