Skip to content

feat(enrichment): scan Terraform .tfvars and HCL files for IaC misconfig - #3400

Merged
loopover-orb[bot] merged 2 commits into
JSONbored:mainfrom
jeffrey701:feat/iac-misconfig-tfvars-hcl
Jul 5, 2026
Merged

feat(enrichment): scan Terraform .tfvars and HCL files for IaC misconfig#3400
loopover-orb[bot] merged 2 commits into
JSONbored:mainfrom
jeffrey701:feat/iac-misconfig-tfvars-hcl

Conversation

@jeffrey701

Copy link
Copy Markdown
Contributor

CONFIG_PATH_RE scanned .tf but its end-anchored group missed .tfvars / .hcl, so scanIacMisconfig skipped these canonical IaC files. Adds tfvars + hcl (combined cleanly with mains new dotenv-mode-suffix support) + a test. Rebased onto current main; rees green (971). (Supersedes closed #3395.)

CONFIG_PATH_RE already scanned .tf, but its extension group is end-anchored so
.tfvars (terraform.tfvars / *.auto.tfvars) and .hcl (Packer/Nomad/Consul/
Terraform) files ended after `tf` and never matched — scanIacMisconfig skipped
these canonical IaC files entirely, so their CORS/TLS/open-ingress issues went
unchecked. Add tfvars + hcl to the group. Extends the iac-misconfig test with
isRelevantConfigPath assertions (positive .tfvars/.hcl + the pre-existing .tf,
and a negative for a code file).
…tfvars-hcl

# Conflicts:
#	review-enrichment/src/analyzers/iac-misconfig.ts
#	review-enrichment/test/iac-misconfig.test.ts
@jeffrey701
jeffrey701 requested a review from JSONbored as a code owner July 5, 2026 06:12
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 5, 2026
@loopover-orb

loopover-orb Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-05 06:12:56 UTC

2 files · 1 AI reviewer · no blockers · readiness 80/100 · CI green · clean

⏸️ Suggested Action - Manual Review

Review summary
This change fixes the path gate at review-enrichment/src/analyzers/iac-misconfig.ts:7 by admitting .tfvars and .hcl alongside the existing .tf coverage, so scanIacMisconfig will no longer skip those IaC files before the rule scan runs. The regex remains end-anchored and the new alternatives are inside the existing extension group, so this does not broaden matching beyond extension-based config files. The added test covers plain .tfvars, mode-style .auto.tfvars, .hcl, the existing .tf case, and a non-config negative case; I do not see a reachable correctness defect in the diff.

Nits — 2 non-blocking
  • nit: review-enrichment/test/iac-misconfig.test.ts:8 exercises isRelevantConfigPath directly, but an entrypoint scanIacMisconfig assertion for a .tfvars or .hcl patch would better prove the real skipped-path bug is fixed end to end.
  • review-enrichment/test/iac-misconfig.test.ts:8: add one scanIacMisconfig case with path "infra/terraform.tfvars" and a Terraform finding such as cidr_blocks = ["0.0.0.0/0"] so the test drives the production path gate plus scanner, not only the predicate.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #3395
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ❌ 5/25 Preflight is holding this PR: the review lane is unavailable, so it is not ready for automated review.
Contributor workload ✅ 10/10 Author activity: 66 registered-repo PR(s), 35 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jeffrey701; Gittensor profile; 66 PR(s), 0 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: jeffrey701
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: Clojure, TypeScript
  • Official Gittensor activity: 66 PR(s), 0 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gittensory approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit b5cd833 into JSONbored:main Jul 5, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant