Repository navigation
Prevent sensitive YAML function value leaks - #2783
Conversation
|
Tip Atmos Pro
No affected stacks workflow was detected for this pull request. |
Dependency Review✅ No vulnerabilities or license issues found.Scanned FilesNone |
Resource Changes Found for
|
|
Warning Review limit reached
Next review available in: 4 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughTerraform execution now rejects unresolved computed values before varfile or shell preparation, detects module-declared sensitive variables, excludes them from masked disk output, and injects them through ChangesTerraform input safety
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant TerraformExecution
participant InputValidation
participant VarfileGeneration
participant SecretEnvironment
TerraformExecution->>InputValidation: validate component vars
InputValidation-->>TerraformExecution: accept or reject computed values
TerraformExecution->>VarfileGeneration: generate disk-safe tfvars
VarfileGeneration->>SecretEnvironment: inject masked sensitive vars
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
internal/exec/terraform_execute_helpers.go (1)
41-41: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse the repository’s static error definition.
Move this sentinel to
errors/errors.goand reference it here so error definitions follow the shared contract.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@internal/exec/terraform_execute_helpers.go` at line 41, Move the errUnresolvedComputedTerraformVar sentinel definition from the Terraform execution helpers into the repository’s shared errors/errors.go definitions, then update its references in the relevant execution code to use the shared errors package symbol.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@internal/exec/terraform_execute_helpers.go`:
- Line 41: Move the errUnresolvedComputedTerraformVar sentinel definition from
the Terraform execution helpers into the repository’s shared errors/errors.go
definitions, then update its references in the relevant execution code to use
the shared errors package symbol.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 5ee1c4d1-fb9a-4309-846e-80c1ca8c3fa5
📒 Files selected for processing (12)
internal/exec/terraform_execute_helpers.gointernal/exec/terraform_execute_helpers_exec.gointernal/exec/terraform_execute_helpers_test.gointernal/exec/terraform_generate_varfile.gointernal/exec/terraform_generate_varfile_test.gointernal/exec/terraform_shell.gointernal/exec/yaml_func_utils.gopkg/utils/yaml_utils_test.gotests/fixtures/scenarios/yaml-sensitive-state-varfile/atmos.yamltests/fixtures/scenarios/yaml-sensitive-state-varfile/components/terraform/consumer/variables.tftests/fixtures/scenarios/yaml-sensitive-state-varfile/components/terraform/producer/main.tftests/fixtures/scenarios/yaml-sensitive-state-varfile/stacks/dev.yaml
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/fixes/2026-07-22-sensitive-yaml-function-varfiles.md`:
- Around line 34-39: Update the Validation section of the fix note to include
the exact required commands `atmos lint --changed` and `atmos test`, and use the
full build command rather than the abbreviated “Go build” description. If any
required checks were not run, explicitly identify them as not run.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: dce43cec-1aec-497f-b4b5-a9011fa03b2c
📒 Files selected for processing (1)
docs/fixes/2026-07-22-sensitive-yaml-function-varfiles.md
|
Tip Atmos Pro
No affected stacks workflow was detected for this pull request. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2783 +/- ##
=======================================
Coverage ? 81.70%
=======================================
Files ? 1778
Lines ? 170709
Branches ? 0
=======================================
Hits ? 139483
Misses ? 23497
Partials ? 7729
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
These changes were released in v1.223.1-rc.4. |
what
TF_VAR_*during execution.(computed)values from Terraform handoff paths and add function-aware debug logging for graceful YAML-function degradation.why
references
Summary by CodeRabbit
sensitive = trueare excluded from generated*.terraform.tfvars.jsonwhen masking is enabled, including--with-secrets.TF_VAR_<name>environment variables (not written to disk).