Conversation
A variable or output names its secret in the block label, so the literal
sits under the generic key default/value and the key-name check never
flags it: variable "db_password" { default = "..." } reached graph.json
verbatim. Redact default/value when the label matches the sensitive-key
pattern or the block sets Terraform's own sensitive = true.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Graphify reviewed this change.
Worth a look — the grounded gate found no coupling regressions or blocking issues, but 1 advisory finding(s) below merit a look before merge.
Graphify review — findings
Redacts the default/value literal of variable and output blocks in extract_terraform when the block label matches the sensitive-name pattern or the block sets sensitive = true, closing the gap where key-name matching missed secrets stored under generic keys. Leaves ordinary variables/outputs and non-secret attributes like type untouched.
Worth a look
- Label-less variable/output blocks now raise IndexError during extraction —
graphify/extractors/terraform.py:438· Escalate · medium- agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 1448 functions depend on the 52 functions this change touches.
Health — this change adds coupling hotspots:
- new:
extract()— 703 callers, 47 callees - new:
_rebuild_code()— 144 callers, 55 callees - new:
main()— 98 callers, 3 callees - new:
dispatch_command()— 2 callers, 125 callees - new:
extract_terraform()— 22 callers, 8 callees - new:
run_pipeline()— 8 callers, 13 callees - new:
watch()— 5 callers, 7 callees - new:
_build()— 7 callers, 3 callees - …and 10 more — each is listed as a finding
Verification — 1448 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 785 function(s) in the blast radius were not formally verified this run
Test selection
Test selection
2 of 300 test file(s) selected (1%) via static blast radius.
tests/test_terraform.py— impact, changed-testtests/test_terraform_modules.py— impact
Selection is safe under the controlled-regression assumption; always-run tests + a periodic full run are the backstops. Advisory — it never changes the check verdict.
· 18 more finding(s) on lines outside this diff (see the check run).
|
Re the Graphify review finding "Label-less variable/output blocks now raise IndexError during extraction" ( The redaction runs after the block-type dispatch. Repro on 01e4171 with the |
Windows hash-seed re-exec wait (#3816/#3799), Terraform secret-named variable-default/output redaction (#3817), COBOL fixed-format sequence-number detection (#3813) and PERFORM...THRU both-endpoint linking (#3814), and gate the GRAPH_REPORT undocumented-components reason on a real semantic layer (#3828/#3801). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Shipped in v0.9.68 (now on PyPI) via an authorship-preserving cherry-pick, so your commit keeps contributor-graph credit. Thanks @breken-ai! Terraform secret-named variable-default/output redaction. Release: https://github.com/Graphify-Labs/graphify/releases/tag/v0.9.68 |
What does this PR do?
Terraform secret redaction (#3644, #3762) keys off the attribute name, so it misses a secret named by the block label.
variableandoutputblocks keep the secret's name in their label and the literal under a generic key (defaultfor a variable,valuefor an output). This input:wrote
"default": "hunter2"and"value": "tok-123"intograph.json, and the MCPquery/get_nodesurface returned them unredacted. Apassword = ...attribute in the same file was already redacted.The fix is in
graphify/extractors/terraform.py, where attributes are attached to their owner block. For avariableoroutputblock, it redactsdefault/valuein two cases: the block label matches the existing_SENSITIVE_KEY_RE, or the block sets Terraform's ownsensitive = true. Ordinary variables and outputs such asvariable "region"andoutput "bucket_name"are unchanged. All other keys on the block, such astype, stay visible.This PR does not overlap #3787, which covers the
{ name = "DB_PASSWORD", value = ... }pair idiom. This PR covers the block-label andsensitive = truecases.Type of change
How was this tested?
Tested on macOS with Python 3.12 (uv).
Graphify-specific checklist
This change was prepared with AI assistance (Claude) and verified with the commands above.
🤖 Generated with Claude Code