@intentius/chant-lexicon-terraform 0.57.0 → 0.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/composites/terraform-adopt-op.d.ts +131 -0
- package/dist/composites/terraform-adopt-op.d.ts.map +1 -0
- package/dist/composites/terraform-apply-op.d.ts +70 -17
- package/dist/composites/terraform-apply-op.d.ts.map +1 -1
- package/dist/composites/terraform-watch-op.d.ts +104 -37
- package/dist/composites/terraform-watch-op.d.ts.map +1 -1
- package/dist/config.d.ts +49 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/describe-resources.d.ts +256 -16
- package/dist/describe-resources.d.ts.map +1 -1
- package/dist/hcl/descend.d.ts +98 -0
- package/dist/hcl/descend.d.ts.map +1 -0
- package/dist/hcl/marker.d.ts +130 -0
- package/dist/hcl/marker.d.ts.map +1 -0
- package/dist/hcl/parse.d.ts +156 -9
- package/dist/hcl/parse.d.ts.map +1 -1
- package/dist/hcl/references.d.ts +76 -0
- package/dist/hcl/references.d.ts.map +1 -0
- package/dist/hcl/roots.d.ts +22 -3
- package/dist/hcl/roots.d.ts.map +1 -1
- package/dist/hcl/suppressions.d.ts +54 -0
- package/dist/hcl/suppressions.d.ts.map +1 -0
- package/dist/hcl/value.d.ts +77 -0
- package/dist/hcl/value.d.ts.map +1 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/integrity.json +34 -5
- package/dist/lint/audit-catalog.d.ts +3 -2
- package/dist/lint/audit-catalog.d.ts.map +1 -1
- package/dist/lint/audit-lineage.d.ts +95 -0
- package/dist/lint/audit-lineage.d.ts.map +1 -1
- package/dist/lint/post-synth/blocks.d.ts +53 -0
- package/dist/lint/post-synth/blocks.d.ts.map +1 -0
- package/dist/lint/post-synth/fixtures/load.d.ts +37 -0
- package/dist/lint/post-synth/fixtures/load.d.ts.map +1 -0
- package/dist/lint/post-synth/index.d.ts.map +1 -1
- package/dist/lint/post-synth/module-source.d.ts +38 -0
- package/dist/lint/post-synth/module-source.d.ts.map +1 -0
- package/dist/lint/post-synth/scope.d.ts +65 -0
- package/dist/lint/post-synth/scope.d.ts.map +1 -0
- package/dist/lint/post-synth/tf001.d.ts +58 -6
- package/dist/lint/post-synth/tf001.d.ts.map +1 -1
- package/dist/lint/post-synth/tf002.d.ts +32 -0
- package/dist/lint/post-synth/tf002.d.ts.map +1 -0
- package/dist/lint/post-synth/tf003.d.ts +22 -0
- package/dist/lint/post-synth/tf003.d.ts.map +1 -0
- package/dist/lint/post-synth/tf004.d.ts +22 -0
- package/dist/lint/post-synth/tf004.d.ts.map +1 -0
- package/dist/lint/post-synth/tf005.d.ts +28 -0
- package/dist/lint/post-synth/tf005.d.ts.map +1 -0
- package/dist/lint/post-synth/tf006.d.ts +21 -0
- package/dist/lint/post-synth/tf006.d.ts.map +1 -0
- package/dist/lint/post-synth/tf007.d.ts +21 -0
- package/dist/lint/post-synth/tf007.d.ts.map +1 -0
- package/dist/lint/post-synth/tf008.d.ts +22 -0
- package/dist/lint/post-synth/tf008.d.ts.map +1 -0
- package/dist/lint/post-synth/tf009.d.ts +24 -0
- package/dist/lint/post-synth/tf009.d.ts.map +1 -0
- package/dist/lint/post-synth/tf010.d.ts +19 -0
- package/dist/lint/post-synth/tf010.d.ts.map +1 -0
- package/dist/lint/post-synth/tf011.d.ts +18 -0
- package/dist/lint/post-synth/tf011.d.ts.map +1 -0
- package/dist/lint/post-synth/tf012.d.ts +17 -0
- package/dist/lint/post-synth/tf012.d.ts.map +1 -0
- package/dist/lint/post-synth/tf013.d.ts +21 -0
- package/dist/lint/post-synth/tf013.d.ts.map +1 -0
- package/dist/lint/post-synth/tf014.d.ts +25 -0
- package/dist/lint/post-synth/tf014.d.ts.map +1 -0
- package/dist/lint/post-synth/tf015.d.ts +30 -0
- package/dist/lint/post-synth/tf015.d.ts.map +1 -0
- package/dist/lint/post-synth/tf016.d.ts +30 -0
- package/dist/lint/post-synth/tf016.d.ts.map +1 -0
- package/dist/lint/post-synth/tf017.d.ts +19 -0
- package/dist/lint/post-synth/tf017.d.ts.map +1 -0
- package/dist/lint/post-synth/tf018.d.ts +20 -0
- package/dist/lint/post-synth/tf018.d.ts.map +1 -0
- package/dist/lint/post-synth/tf019.d.ts +25 -0
- package/dist/lint/post-synth/tf019.d.ts.map +1 -0
- package/dist/lint/post-synth/tf020.d.ts +38 -0
- package/dist/lint/post-synth/tf020.d.ts.map +1 -0
- package/dist/lint/post-synth/tf021.d.ts +41 -0
- package/dist/lint/post-synth/tf021.d.ts.map +1 -0
- package/dist/lint/post-synth/tf022.d.ts +24 -0
- package/dist/lint/post-synth/tf022.d.ts.map +1 -0
- package/dist/lint/post-synth/tf024.d.ts +24 -0
- package/dist/lint/post-synth/tf024.d.ts.map +1 -0
- package/dist/lint/post-synth/tf025.d.ts +29 -0
- package/dist/lint/post-synth/tf025.d.ts.map +1 -0
- package/dist/lint/post-synth/tf026.d.ts +28 -0
- package/dist/lint/post-synth/tf026.d.ts.map +1 -0
- package/dist/lint/post-synth/tf027.d.ts +30 -0
- package/dist/lint/post-synth/tf027.d.ts.map +1 -0
- package/dist/lint/post-synth/tf028.d.ts +33 -0
- package/dist/lint/post-synth/tf028.d.ts.map +1 -0
- package/dist/lint/rules/fixtures/load.d.ts +13 -0
- package/dist/lint/rules/fixtures/load.d.ts.map +1 -0
- package/dist/lint/rules/plan-before-apply.d.ts +11 -0
- package/dist/lint/rules/plan-before-apply.d.ts.map +1 -1
- package/dist/lint/secret-shape.d.ts +68 -0
- package/dist/lint/secret-shape.d.ts.map +1 -0
- package/dist/live-ownership.d.ts +55 -0
- package/dist/live-ownership.d.ts.map +1 -0
- package/dist/lsp/option-keys.d.ts.map +1 -1
- package/dist/manifest.json +1 -1
- package/dist/okf/index.md +26 -0
- package/dist/okf/rules/TF002.md +11 -0
- package/dist/okf/rules/TF003.md +11 -0
- package/dist/okf/rules/TF004.md +11 -0
- package/dist/okf/rules/TF005.md +11 -0
- package/dist/okf/rules/TF006.md +11 -0
- package/dist/okf/rules/TF007.md +11 -0
- package/dist/okf/rules/TF008.md +11 -0
- package/dist/okf/rules/TF009.md +11 -0
- package/dist/okf/rules/TF010.md +11 -0
- package/dist/okf/rules/TF011.md +11 -0
- package/dist/okf/rules/TF012.md +11 -0
- package/dist/okf/rules/TF013.md +11 -0
- package/dist/okf/rules/TF014.md +11 -0
- package/dist/okf/rules/TF015.md +11 -0
- package/dist/okf/rules/TF016.md +11 -0
- package/dist/okf/rules/TF017.md +11 -0
- package/dist/okf/rules/TF018.md +11 -0
- package/dist/okf/rules/TF019.md +11 -0
- package/dist/okf/rules/TF020.md +11 -0
- package/dist/okf/rules/TF021.md +11 -0
- package/dist/okf/rules/TF022.md +11 -0
- package/dist/okf/rules/TF024.md +11 -0
- package/dist/okf/rules/TF025.md +11 -0
- package/dist/okf/rules/TF026.md +11 -0
- package/dist/okf/rules/TF027.md +11 -0
- package/dist/okf/rules/TF028.md +11 -0
- package/dist/op/activities/index.d.ts +13 -6
- package/dist/op/activities/index.d.ts.map +1 -1
- package/dist/op/activities/live-detect.d.ts +51 -0
- package/dist/op/activities/live-detect.d.ts.map +1 -0
- package/dist/op/activities/terraform.d.ts +466 -17
- package/dist/op/activities/terraform.d.ts.map +1 -1
- package/dist/op/activity-contracts.d.ts +148 -0
- package/dist/op/activity-contracts.d.ts.map +1 -0
- package/dist/op/adoption.d.ts +118 -0
- package/dist/op/adoption.d.ts.map +1 -0
- package/dist/op/builders.d.ts +48 -6
- package/dist/op/builders.d.ts.map +1 -1
- package/dist/op/resolve-root-mode.d.ts +59 -0
- package/dist/op/resolve-root-mode.d.ts.map +1 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/rules/blocks.ts +109 -0
- package/dist/rules/module-source.ts +121 -0
- package/dist/rules/plan-before-apply.ts +11 -0
- package/dist/rules/scope.ts +107 -0
- package/dist/rules/tf001.ts +98 -18
- package/dist/rules/tf002.ts +151 -0
- package/dist/rules/tf003.ts +71 -0
- package/dist/rules/tf004.ts +63 -0
- package/dist/rules/tf005.ts +76 -0
- package/dist/rules/tf006.ts +53 -0
- package/dist/rules/tf007.ts +78 -0
- package/dist/rules/tf008.ts +75 -0
- package/dist/rules/tf009.ts +59 -0
- package/dist/rules/tf010.ts +51 -0
- package/dist/rules/tf011.ts +49 -0
- package/dist/rules/tf012.ts +47 -0
- package/dist/rules/tf013.ts +63 -0
- package/dist/rules/tf014.ts +72 -0
- package/dist/rules/tf015.ts +72 -0
- package/dist/rules/tf016.ts +75 -0
- package/dist/rules/tf017.ts +50 -0
- package/dist/rules/tf018.ts +72 -0
- package/dist/rules/tf019.ts +72 -0
- package/dist/rules/tf020.ts +123 -0
- package/dist/rules/tf021.ts +126 -0
- package/dist/rules/tf022.ts +61 -0
- package/dist/rules/tf024.ts +70 -0
- package/dist/rules/tf025.ts +101 -0
- package/dist/rules/tf026.ts +84 -0
- package/dist/rules/tf027.ts +74 -0
- package/dist/rules/tf028.ts +96 -0
- package/dist/skills/chant-terraform.md +1 -1
- package/dist/validate.d.ts.map +1 -1
- package/package.json +7 -2
- package/src/__fixtures__/ACCEPTANCE.md +181 -0
- package/src/__fixtures__/live/main.tf +28 -0
- package/src/__fixtures__/live-adopt/estate.chdf.hcl +6 -0
- package/src/__fixtures__/live-adopt/main.tf +21 -0
- package/src/__fixtures__/live-estate/README.md +58 -0
- package/src/__fixtures__/live-estate/compute.tf +10 -0
- package/src/__fixtures__/live-estate/estate.chdf.hcl +1 -0
- package/src/__fixtures__/live-estate/logs.tf +8 -0
- package/src/__fixtures__/live-estate/network.tf +24 -0
- package/src/__fixtures__/live-estate/rule.tf +11 -0
- package/src/__fixtures__/live-estate/unowned.tf +21 -0
- package/src/__fixtures__/live-estate/versions.tf +31 -0
- package/src/__fixtures__/live-ls.json +98 -0
- package/src/__fixtures__/live-plan.json +285 -0
- package/src/__fixtures__/live-sidecar/estate.chdf.hcl +3 -0
- package/src/__fixtures__/live-sidecar/main.tf +24 -0
- package/src/__fixtures__/module-tree/README.md +16 -0
- package/src/__fixtures__/module-tree/cycle/main.tf +3 -0
- package/src/__fixtures__/module-tree/cycle/modules/a/main.tf +9 -0
- package/src/__fixtures__/module-tree/cycle/modules/b/main.tf +9 -0
- package/src/__fixtures__/module-tree/missing/main.tf +9 -0
- package/src/__fixtures__/module-tree/outside/root/main.tf +9 -0
- package/src/__fixtures__/module-tree/root/main.tf +28 -0
- package/src/__fixtures__/module-tree/root/modules/cdn/main.tf +15 -0
- package/src/__fixtures__/module-tree/root/modules/cdn/modules/bucket/main.tf +11 -0
- package/src/__fixtures__/module-tree/shared/main.tf +5 -0
- package/src/__fixtures__/references/main.tf +56 -0
- package/src/__fixtures__/remote-backend/main.tf +34 -0
- package/src/__fixtures__/with-backend/main.tf +7 -0
- package/src/codegen/lint-rules-page.test.ts +45 -0
- package/src/composites/terraform-adopt-op.acceptance.test.ts +193 -0
- package/src/composites/terraform-adopt-op.test.ts +175 -0
- package/src/composites/terraform-adopt-op.ts +202 -0
- package/src/composites/terraform-apply-op.acceptance.test.ts +188 -5
- package/src/composites/terraform-apply-op.test.ts +179 -19
- package/src/composites/terraform-apply-op.ts +123 -30
- package/src/composites/terraform-watch-op.test.ts +169 -29
- package/src/composites/terraform-watch-op.ts +183 -75
- package/src/config.ts +32 -3
- package/src/describe-resources.live.test.ts +598 -0
- package/src/describe-resources.test.ts +53 -0
- package/src/describe-resources.ts +811 -28
- package/src/hcl/descend.test.ts +162 -0
- package/src/hcl/descend.ts +273 -0
- package/src/hcl/marker.test.ts +147 -0
- package/src/hcl/marker.ts +235 -0
- package/src/hcl/parse.test.ts +69 -0
- package/src/hcl/parse.ts +269 -27
- package/src/hcl/references.test.ts +116 -0
- package/src/hcl/references.ts +172 -0
- package/src/hcl/roots.ts +59 -5
- package/src/hcl/suppressions.test.ts +147 -0
- package/src/hcl/suppressions.ts +204 -0
- package/src/hcl/value.test.ts +73 -0
- package/src/hcl/value.ts +106 -0
- package/src/index.ts +31 -1
- package/src/lint/audit-catalog.ts +288 -3
- package/src/lint/audit-lineage.ts +384 -1
- package/src/lint/audit.test.ts +210 -3
- package/src/lint/post-synth/blocks.ts +109 -0
- package/src/lint/post-synth/fixtures/TF001/negative-cloud.tf +28 -0
- package/src/lint/post-synth/fixtures/TF001/negative.tf +30 -0
- package/src/lint/post-synth/fixtures/TF001/positive-local.tf +31 -0
- package/src/lint/post-synth/fixtures/TF001/positive.tf +24 -0
- package/src/lint/post-synth/fixtures/TF002/negative.tf +17 -0
- package/src/lint/post-synth/fixtures/TF002/positive-legacy.tf +10 -0
- package/src/lint/post-synth/fixtures/TF002/positive-no-version.tf +12 -0
- package/src/lint/post-synth/fixtures/TF002/positive.tf +7 -0
- package/src/lint/post-synth/fixtures/TF003/negative.tf +10 -0
- package/src/lint/post-synth/fixtures/TF003/positive.tf +8 -0
- package/src/lint/post-synth/fixtures/TF004/negative-git.tf +3 -0
- package/src/lint/post-synth/fixtures/TF004/negative-local.tf +3 -0
- package/src/lint/post-synth/fixtures/TF004/negative.tf +4 -0
- package/src/lint/post-synth/fixtures/TF004/positive.tf +3 -0
- package/src/lint/post-synth/fixtures/TF005/negative-local.tf +3 -0
- package/src/lint/post-synth/fixtures/TF005/negative-registry.tf +3 -0
- package/src/lint/post-synth/fixtures/TF005/negative-sha.tf +3 -0
- package/src/lint/post-synth/fixtures/TF005/negative.tf +3 -0
- package/src/lint/post-synth/fixtures/TF005/positive-branch.tf +3 -0
- package/src/lint/post-synth/fixtures/TF005/positive-non-semver.tf +3 -0
- package/src/lint/post-synth/fixtures/TF005/positive.tf +3 -0
- package/src/lint/post-synth/fixtures/TF006/negative.tf +5 -0
- package/src/lint/post-synth/fixtures/TF006/positive-empty-default.tf +11 -0
- package/src/lint/post-synth/fixtures/TF006/positive.tf +6 -0
- package/src/lint/post-synth/fixtures/TF007/negative.tf +10 -0
- package/src/lint/post-synth/fixtures/TF007/positive.tf +9 -0
- package/src/lint/post-synth/fixtures/TF008/negative-variable.tf +10 -0
- package/src/lint/post-synth/fixtures/TF008/negative.tf +8 -0
- package/src/lint/post-synth/fixtures/TF008/positive-other-provider.tf +10 -0
- package/src/lint/post-synth/fixtures/TF008/positive.tf +5 -0
- package/src/lint/post-synth/fixtures/TF009/negative.tf +10 -0
- package/src/lint/post-synth/fixtures/TF009/positive.tf +4 -0
- package/src/lint/post-synth/fixtures/TF010/negative.tf +5 -0
- package/src/lint/post-synth/fixtures/TF010/positive.tf +4 -0
- package/src/lint/post-synth/fixtures/TF011/negative.tf +5 -0
- package/src/lint/post-synth/fixtures/TF011/positive-blank.tf +5 -0
- package/src/lint/post-synth/fixtures/TF011/positive.tf +4 -0
- package/src/lint/post-synth/fixtures/TF012/negative.tf +4 -0
- package/src/lint/post-synth/fixtures/TF012/positive.tf +3 -0
- package/src/lint/post-synth/fixtures/TF013/negative.tf +8 -0
- package/src/lint/post-synth/fixtures/TF013/positive-data.tf +8 -0
- package/src/lint/post-synth/fixtures/TF013/positive.tf +8 -0
- package/src/lint/post-synth/fixtures/TF014/negative/main.tf +26 -0
- package/src/lint/post-synth/fixtures/TF014/negative/modules/cdn/main.tf +19 -0
- package/src/lint/post-synth/fixtures/TF014/positive/main.tf +16 -0
- package/src/lint/post-synth/fixtures/TF014/positive/modules/cdn/main.tf +15 -0
- package/src/lint/post-synth/fixtures/TF015/negative/main.tf +13 -0
- package/src/lint/post-synth/fixtures/TF015/negative/modules/cdn/main.tf +16 -0
- package/src/lint/post-synth/fixtures/TF015/positive/main.tf +13 -0
- package/src/lint/post-synth/fixtures/TF015/positive/modules/cdn/main.tf +14 -0
- package/src/lint/post-synth/fixtures/TF016/negative-template.tf +7 -0
- package/src/lint/post-synth/fixtures/TF016/negative.tf +16 -0
- package/src/lint/post-synth/fixtures/TF016/positive-shared-file.tf +12 -0
- package/src/lint/post-synth/fixtures/TF016/positive.tf +13 -0
- package/src/lint/post-synth/fixtures/TF017/negative.tf +4 -0
- package/src/lint/post-synth/fixtures/TF017/positive.tf +5 -0
- package/src/lint/post-synth/fixtures/TF018/negative.tf +9 -0
- package/src/lint/post-synth/fixtures/TF018/positive-data.tf +9 -0
- package/src/lint/post-synth/fixtures/TF018/positive.tf +4 -0
- package/src/lint/post-synth/fixtures/TF019/negative.tf +14 -0
- package/src/lint/post-synth/fixtures/TF019/positive-output.tf +5 -0
- package/src/lint/post-synth/fixtures/TF019/positive.tf +16 -0
- package/src/lint/post-synth/fixtures/TF020/negative.tf +43 -0
- package/src/lint/post-synth/fixtures/TF020/positive.tf +32 -0
- package/src/lint/post-synth/fixtures/TF020/scoped/main.tf +21 -0
- package/src/lint/post-synth/fixtures/TF020/scoped/modules/cdn/main.tf +13 -0
- package/src/lint/post-synth/fixtures/TF021/negative.tf +31 -0
- package/src/lint/post-synth/fixtures/TF021/positive-length.tf +8 -0
- package/src/lint/post-synth/fixtures/TF021/positive.tf +8 -0
- package/src/lint/post-synth/fixtures/TF022/negative-locator.tf +7 -0
- package/src/lint/post-synth/fixtures/TF022/negative.tf +10 -0
- package/src/lint/post-synth/fixtures/TF022/positive-nested.tf +10 -0
- package/src/lint/post-synth/fixtures/TF022/positive.tf +6 -0
- package/src/lint/post-synth/fixtures/TF023/negative/main.tf +15 -0
- package/src/lint/post-synth/fixtures/TF023/positive/main.tf +9 -0
- package/src/lint/post-synth/fixtures/TF023/positive/state.json +24 -0
- package/src/lint/post-synth/fixtures/TF024/live-clean/main.tf +9 -0
- package/src/lint/post-synth/fixtures/TF024/live-with-backend/main.tf +14 -0
- package/src/lint/post-synth/fixtures/TF024/live-with-cloud/main.tf +16 -0
- package/src/lint/post-synth/fixtures/TF025/live-clean/main.tf +13 -0
- package/src/lint/post-synth/fixtures/TF025/live-with-workspace-ref/main.tf +13 -0
- package/src/lint/post-synth/fixtures/TF026/live-default/main.tf +9 -0
- package/src/lint/post-synth/fixtures/TF026/live-explicit-delete/main.tf +13 -0
- package/src/lint/post-synth/fixtures/TF026/live-keep/main.tf +13 -0
- package/src/lint/post-synth/fixtures/TF027/live-default/main.tf +9 -0
- package/src/lint/post-synth/fixtures/TF027/live-untagged-delete/main.tf +13 -0
- package/src/lint/post-synth/fixtures/TF027/live-untagged-delete-scoped/main.tf +17 -0
- package/src/lint/post-synth/fixtures/TF027/live-untagged-report/main.tf +13 -0
- package/src/lint/post-synth/fixtures/TF028/live/main.tf +9 -0
- package/src/lint/post-synth/fixtures/TF028/stock/main.tf +10 -0
- package/src/lint/post-synth/fixtures/load.ts +108 -0
- package/src/lint/post-synth/index.ts +52 -0
- package/src/lint/post-synth/live-refusals-config-format.test.ts +143 -0
- package/src/lint/post-synth/module-rules.test.ts +153 -0
- package/src/lint/post-synth/module-source.test.ts +75 -0
- package/src/lint/post-synth/module-source.ts +121 -0
- package/src/lint/post-synth/post-synth.test.ts +73 -16
- package/src/lint/post-synth/scope.ts +107 -0
- package/src/lint/post-synth/single-block.test.ts +263 -0
- package/src/lint/post-synth/suppression.test.ts +110 -0
- package/src/lint/post-synth/tf001.ts +98 -18
- package/src/lint/post-synth/tf002.test.ts +93 -0
- package/src/lint/post-synth/tf002.ts +151 -0
- package/src/lint/post-synth/tf003.test.ts +75 -0
- package/src/lint/post-synth/tf003.ts +71 -0
- package/src/lint/post-synth/tf004.test.ts +47 -0
- package/src/lint/post-synth/tf004.ts +63 -0
- package/src/lint/post-synth/tf005.test.ts +57 -0
- package/src/lint/post-synth/tf005.ts +76 -0
- package/src/lint/post-synth/tf006.ts +53 -0
- package/src/lint/post-synth/tf007.ts +78 -0
- package/src/lint/post-synth/tf008.ts +75 -0
- package/src/lint/post-synth/tf009.ts +59 -0
- package/src/lint/post-synth/tf010.ts +51 -0
- package/src/lint/post-synth/tf011.ts +49 -0
- package/src/lint/post-synth/tf012.ts +47 -0
- package/src/lint/post-synth/tf013.ts +63 -0
- package/src/lint/post-synth/tf014.ts +72 -0
- package/src/lint/post-synth/tf015.ts +72 -0
- package/src/lint/post-synth/tf016.ts +75 -0
- package/src/lint/post-synth/tf017.ts +50 -0
- package/src/lint/post-synth/tf018.ts +72 -0
- package/src/lint/post-synth/tf019.ts +72 -0
- package/src/lint/post-synth/tf020.ts +123 -0
- package/src/lint/post-synth/tf021.ts +126 -0
- package/src/lint/post-synth/tf022.ts +61 -0
- package/src/lint/post-synth/tf024.test.ts +42 -0
- package/src/lint/post-synth/tf024.ts +70 -0
- package/src/lint/post-synth/tf025.test.ts +46 -0
- package/src/lint/post-synth/tf025.ts +101 -0
- package/src/lint/post-synth/tf026.test.ts +56 -0
- package/src/lint/post-synth/tf026.ts +84 -0
- package/src/lint/post-synth/tf027.test.ts +62 -0
- package/src/lint/post-synth/tf027.ts +74 -0
- package/src/lint/post-synth/tf028.test.ts +92 -0
- package/src/lint/post-synth/tf028.ts +96 -0
- package/src/lint/presets.test.ts +72 -0
- package/src/lint/rules/fixtures/TF101/negative-op.ts +2 -0
- package/src/lint/rules/fixtures/TF101/positive-op.ts +2 -0
- package/src/lint/rules/fixtures/load.ts +53 -0
- package/src/lint/rules/plan-before-apply.test.ts +112 -7
- package/src/lint/rules/plan-before-apply.ts +11 -0
- package/src/lint/secret-shape.test.ts +150 -0
- package/src/lint/secret-shape.ts +159 -0
- package/src/live-ownership.ts +60 -0
- package/src/lsp/completions.test.ts +3 -2
- package/src/lsp/option-keys.ts +12 -6
- package/src/op/activities/choudoufu.acceptance.test.ts +127 -0
- package/src/op/activities/choudoufu.test.ts +725 -0
- package/src/op/activities/index.ts +40 -4
- package/src/op/activities/live-detect.test.ts +143 -0
- package/src/op/activities/live-detect.ts +162 -0
- package/src/op/activities/registry.test.ts +11 -3
- package/src/op/activities/terraform.test.ts +7 -3
- package/src/op/activities/terraform.ts +861 -69
- package/src/op/activity-contracts.test.ts +147 -0
- package/src/op/activity-contracts.ts +178 -0
- package/src/op/adoption.test.ts +170 -0
- package/src/op/adoption.ts +241 -0
- package/src/op/builders.test.ts +60 -5
- package/src/op/builders.ts +95 -5
- package/src/op/resolve-root-mode.test.ts +85 -0
- package/src/op/resolve-root-mode.ts +86 -0
- package/src/plugin.test.ts +106 -0
- package/src/plugin.ts +186 -29
- package/src/skills/chant-terraform.md +1 -1
- package/src/validate.ts +10 -1
|
@@ -25,6 +25,17 @@ import type { LintRule } from "@intentius/chant/lint/rule";
|
|
|
25
25
|
* silent — the same deliberately shallow "bail rather than guess" posture
|
|
26
26
|
* `validateStepOutputRefs` takes, since the runtime brand on a real
|
|
27
27
|
* `StepOutputRef` is invisible to a source-level AST match.
|
|
28
|
+
*
|
|
29
|
+
* Fires on every `terraformApply` call, live root or stock. #2106 exempted
|
|
30
|
+
* live roots for one release, because choudoufu refused `-out` and
|
|
31
|
+
* `apply <planfile>` and the activity ran a bare `apply -auto-approve` with no
|
|
32
|
+
* plan file to pair. choudoufu v0.13.0 admits both under a `live` block
|
|
33
|
+
* ([choudoufu #878](https://github.com/INTENTIUS/choudoufu/issues/878)), and
|
|
34
|
+
* there the pairing matters more than on a stock root, not less: the apply
|
|
35
|
+
* re-plans the live system and compares its fresh plan against the file it was
|
|
36
|
+
* handed, so a plan file spelled out as a literal is an approval for a run
|
|
37
|
+
* nobody can trace back to a plan step. The exemption is gone with the
|
|
38
|
+
* condition that produced it, and this rule reads no project config at all.
|
|
28
39
|
*/
|
|
29
40
|
export declare const planBeforeApplyRule: LintRule;
|
|
30
41
|
//# sourceMappingURL=plan-before-apply.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan-before-apply.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/plan-before-apply.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAA+B,MAAM,4BAA4B,CAAC;AAExF
|
|
1
|
+
{"version":3,"file":"plan-before-apply.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/plan-before-apply.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAA+B,MAAM,4BAA4B,CAAC;AAExF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,eAAO,MAAM,mBAAmB,EAAE,QAgHjC,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two heuristics the secrets rules of the TF family share: does this
|
|
3
|
+
* attribute's NAME read like a credential, and does its VALUE look like one.
|
|
4
|
+
*
|
|
5
|
+
* tfsec shipped `general-secrets-sensitive-in-variable`,
|
|
6
|
+
* `-in-local` and `-in-attribute`, and trivy dropped all three when it
|
|
7
|
+
* absorbed tfsec, so no maintained tool checks them today (#2107's survey).
|
|
8
|
+
* TF007, TF008, TF009 and TF022 are chant's versions, and they only stay
|
|
9
|
+
* consistent with each other if "secret-shaped" means one thing. That is what
|
|
10
|
+
* this module is.
|
|
11
|
+
*
|
|
12
|
+
* Nothing here re-implements a detector `packages/core/src/audit/secrets.ts`
|
|
13
|
+
* already has. The value heuristic runs a candidate through `scanForSecrets`
|
|
14
|
+
* first, so every vendor prefix the SEC family knows (AWS key ids, GitHub,
|
|
15
|
+
* Slack, Google, Stripe), the PEM block shape and the connection-string shape
|
|
16
|
+
* are recognised here for free, and it reuses that module's placeholder
|
|
17
|
+
* vocabulary, its identifier-slug filter and its entropy function. What it
|
|
18
|
+
* adds is what a Terraform attribute needs and a raw text scan does not: the
|
|
19
|
+
* JWT and bare PEM-header shapes, and a lower length floor than SEC010's 24
|
|
20
|
+
* characters, because an attribute value is already a single token rather
|
|
21
|
+
* than a line of prose to fish tokens out of.
|
|
22
|
+
*/
|
|
23
|
+
/** Minimum length for a value to be worth judging at all. */
|
|
24
|
+
export declare const MIN_SECRET_LENGTH = 8;
|
|
25
|
+
/**
|
|
26
|
+
* Does this attribute or variable name read like a credential? Case-insensitive
|
|
27
|
+
* and word-bounded, with the locator suffixes excluded.
|
|
28
|
+
*/
|
|
29
|
+
export declare function isSecretName(name: string): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Is this a plain string literal, as opposed to an expression? `hcl2json`
|
|
32
|
+
* renders every expression as a `"${...}"` template, so a value carrying one
|
|
33
|
+
* is a reference (`var.db_password`, `data.aws_secretsmanager_secret_version.x.secret_string`)
|
|
34
|
+
* or an interpolation, never a committed constant. Those are the fix, not the
|
|
35
|
+
* finding.
|
|
36
|
+
*/
|
|
37
|
+
export declare function isLiteralString(value: unknown): value is string;
|
|
38
|
+
/**
|
|
39
|
+
* A placeholder rather than a credential. Core's list is checked twice: once
|
|
40
|
+
* as written, once with separators stripped, so the `CHANGE_ME` and
|
|
41
|
+
* `YOUR_API_KEY` spellings land on the same `changeme` / `your-api-key`
|
|
42
|
+
* entries as the unseparated ones.
|
|
43
|
+
*/
|
|
44
|
+
export declare function isPlaceholderValue(value: string): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Does this value look like a live credential on its own, whatever it is
|
|
47
|
+
* called? A known vendor shape (through core's detectors), a JWT, a PEM key,
|
|
48
|
+
* or a high-entropy token.
|
|
49
|
+
*/
|
|
50
|
+
export declare function isCredentialShapedValue(value: unknown): boolean;
|
|
51
|
+
/** Which heuristic fired, so a diagnostic can say why it is complaining. */
|
|
52
|
+
export type SecretShapeReason = "name" | "value";
|
|
53
|
+
export interface SecretShape {
|
|
54
|
+
reason: SecretShapeReason;
|
|
55
|
+
/** The value's length, for a message that never quotes the value itself. */
|
|
56
|
+
length: number;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The combined test the rules use: is `value`, assigned to an attribute called
|
|
60
|
+
* `name`, a committed secret? Either heuristic is enough, but both sides of the
|
|
61
|
+
* gate are the same, since the value has to be a literal, long enough to be a
|
|
62
|
+
* credential, and not a placeholder, so `sensitive = true`-style
|
|
63
|
+
* remediation advice is never given for `password = "changeme"`.
|
|
64
|
+
*
|
|
65
|
+
* Findings never carry the value. Callers get the reason and the length.
|
|
66
|
+
*/
|
|
67
|
+
export declare function secretShapedAssignment(name: string, value: unknown): SecretShape | undefined;
|
|
68
|
+
//# sourceMappingURL=secret-shape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secret-shape.d.ts","sourceRoot":"","sources":["../../src/lint/secret-shape.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAyBH,6DAA6D;AAC7D,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAmBnC;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAIlD;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAE/D;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEzD;AAqBD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAU/D;AAED,4EAA4E;AAC5E,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,OAAO,CAAC;AAEjD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,WAAW,GAAG,SAAS,CAO5F"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The live root's ownership channel (#2104): choudoufu's two marker tags.
|
|
3
|
+
*
|
|
4
|
+
* Sibling of `./state-ownership.ts`, and here for the same mechanical reason:
|
|
5
|
+
* `plugin.ts` declares `ownershipChannel` eagerly while `describeResources`
|
|
6
|
+
* is behind a dynamic import, so the key names cannot live in the reader
|
|
7
|
+
* without dragging the reader, and `node:child_process` with it, into every
|
|
8
|
+
* plugin load.
|
|
9
|
+
*
|
|
10
|
+
* ## Why the keys are declared and the verdicts are set by hand
|
|
11
|
+
*
|
|
12
|
+
* The issue that added this asked which of two ways to go: widen core's
|
|
13
|
+
* `OwnershipChannel` so a lexicon can supply its own classifier, or declare
|
|
14
|
+
* the keys for discoverability and set the verdicts in the reader, the way
|
|
15
|
+
* `lexicons/fly/src/ownership.ts` does for its two tiers. The second, and the
|
|
16
|
+
* reason is that the first buys nothing.
|
|
17
|
+
*
|
|
18
|
+
* Core's `classifyOwnership` tests one thing: does `tags[keys.managedBy]`
|
|
19
|
+
* equal the literal `"chant"`. Nothing in core ever calls it on a lexicon's
|
|
20
|
+
* behalf. `packages/core/src/ownership.ts` exports it, every lexicon calls it
|
|
21
|
+
* itself where the test happens to fit, and the ones it does not fit, fly's
|
|
22
|
+
* app boundary and aws's stack tags, already set verdicts directly. Adding a
|
|
23
|
+
* `classify` member to `OwnershipChannel` would give core a field only this
|
|
24
|
+
* lexicon passes and only this lexicon reads back, which is a longer way of
|
|
25
|
+
* writing the function `./describe-resources.ts` already has.
|
|
26
|
+
*
|
|
27
|
+
* What the declaration is still for is the claim it makes. Declaring
|
|
28
|
+
* `describeResources` on the channel is what turns the observation
|
|
29
|
+
* conformance suite's ownership assertion from a shape check into a
|
|
30
|
+
* behavioural one, and that claim holds on a live root exactly as it does on
|
|
31
|
+
* a stock one, from a different reading. The suite runs for both modes in
|
|
32
|
+
* `./describe-resources.test.ts`.
|
|
33
|
+
*
|
|
34
|
+
* ## The keys, and the slot that does not fit
|
|
35
|
+
*
|
|
36
|
+
* `ChannelKeys` is a managed-by / stack / env triple, because everywhere else
|
|
37
|
+
* chant stamps three tags. choudoufu's marker is two tags and no managed-by
|
|
38
|
+
* key at all: per `live/MARKERS.md`'s "Ownership semantics", a resource
|
|
39
|
+
* carrying `tofu-estate` belongs to that estate and there is no secondary
|
|
40
|
+
* check, so `tofu-estate` is both the managed-by claim and the stack
|
|
41
|
+
* identity. `tofu-address` takes the third slot because it is the marker's
|
|
42
|
+
* other half, not because it is an environment: a choudoufu marker has no
|
|
43
|
+
* environment in it, which is why `ResourceMetadata.marker` on a live read
|
|
44
|
+
* carries the estate as its `stack` and leaves `env` absent rather than
|
|
45
|
+
* filling it with an address.
|
|
46
|
+
*/
|
|
47
|
+
import type { ChannelKeys } from "@intentius/chant/ownership";
|
|
48
|
+
/**
|
|
49
|
+
* The two tag keys `live/MARKERS.md` spec version 1 defines, named here so a
|
|
50
|
+
* reader of the plugin can see what a live root's verdict is read from.
|
|
51
|
+
* `./hcl/marker.ts` holds the constants the reader itself uses, along with
|
|
52
|
+
* the escaping and the ownership semantics that go with them.
|
|
53
|
+
*/
|
|
54
|
+
export declare const TERRAFORM_LIVE_MARKER_KEYS: ChannelKeys;
|
|
55
|
+
//# sourceMappingURL=live-ownership.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-ownership.d.ts","sourceRoot":"","sources":["../src/live-ownership.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,EAAE,WAIxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"option-keys.d.ts","sourceRoot":"","sources":["../../src/lsp/option-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wEAAwE;AACxE,eAAO,MAAM,qBAAqB,EAAE,SAAS,EAG5C,CAAC;AAEF,wFAAwF;AACxF,eAAO,MAAM,eAAe,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"option-keys.d.ts","sourceRoot":"","sources":["../../src/lsp/option-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wEAAwE;AACxE,eAAO,MAAM,qBAAqB,EAAE,SAAS,EAG5C,CAAC;AAEF,wFAAwF;AACxF,eAAO,MAAM,eAAe,EAAE,SAAS,EAMtC,CAAC;AAEF,wEAAwE;AACxE,eAAO,MAAM,aAAa,EAAE,SAAS,EAYpC,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,eAAe,EAAE,SAAS,EAEtC,CAAC;AAQF,mGAAmG;AACnG,eAAO,MAAM,cAAc,EAAE,SAAS,EAKrC,CAAC;AAEF,mGAAmG;AACnG,eAAO,MAAM,cAAc,EAAE,SAAS,EAKrC,CAAC;AAEF,qGAAqG;AACrG,eAAO,MAAM,eAAe,EAAE,SAAS,EAStC,CAAC;AAEF,mGAAmG;AACnG,eAAO,MAAM,cAAc,EAAE,SAAS,EAIrC,CAAC;AAEF,oGAAoG;AACpG,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,CAK5D,CAAC;AAEF,iPAAiP;AACjP,eAAO,MAAM,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAW/C,CAAC"}
|
package/dist/manifest.json
CHANGED
package/dist/okf/index.md
CHANGED
|
@@ -5,4 +5,30 @@ okf_version: '0.2'
|
|
|
5
5
|
# Rules
|
|
6
6
|
|
|
7
7
|
* [TF001](/rules/TF001.md) - Root module declares no remote backend
|
|
8
|
+
* [TF002](/rules/TF002.md) - A provider the root implies has no required_providers entry, or an incomplete one
|
|
9
|
+
* [TF003](/rules/TF003.md) - Root module's terraform block has no required_version
|
|
10
|
+
* [TF004](/rules/TF004.md) - Registry-sourced module block has no version
|
|
11
|
+
* [TF005](/rules/TF005.md) - Git/hg module source is unpinned, or pinned to a mutable ref
|
|
12
|
+
* [TF006](/rules/TF006.md) - Sensitive variable declares a default value
|
|
13
|
+
* [TF007](/rules/TF007.md) - Secret-shaped literal in a variable default or a locals value
|
|
14
|
+
* [TF008](/rules/TF008.md) - Provider block configures a hardcoded credential
|
|
15
|
+
* [TF009](/rules/TF009.md) - Credential-named variable is not marked sensitive
|
|
16
|
+
* [TF010](/rules/TF010.md) - Variable declares no type constraint
|
|
17
|
+
* [TF011](/rules/TF011.md) - Variable declares no description
|
|
18
|
+
* [TF012](/rules/TF012.md) - Output declares no description
|
|
19
|
+
* [TF013](/rules/TF013.md) - lifecycle ignore_changes is set to all
|
|
20
|
+
* [TF014](/rules/TF014.md) - Child module configures a provider block
|
|
21
|
+
* [TF015](/rules/TF015.md) - Child module declares a backend or cloud block
|
|
22
|
+
* [TF016](/rules/TF016.md) - Attribute value is a quoted interpolation of a single expression
|
|
23
|
+
* [TF017](/rules/TF017.md) - Module block uses depends_on
|
|
24
|
+
* [TF018](/rules/TF018.md) - Output value is a whole resource or data source
|
|
25
|
+
* [TF019](/rules/TF019.md) - Meta-argument explicitly set to its default of false
|
|
26
|
+
* [TF020](/rules/TF020.md) - Declaration is never referenced in its module scope
|
|
27
|
+
* [TF021](/rules/TF021.md) - count builds instance identities from count.index where for_each is safer
|
|
28
|
+
* [TF022](/rules/TF022.md) - Credential-named resource attribute holds a plaintext literal
|
|
29
|
+
* [TF024](/rules/TF024.md) - Live root declares a backend or cloud block, which choudoufu refuses
|
|
30
|
+
* [TF025](/rules/TF025.md) - Live root references a non-default terraform.workspace, which choudoufu refuses
|
|
31
|
+
* [TF026](/rules/TF026.md) - Live root declares delete: "never" but its policy leaves undeclared_tagged at "delete"
|
|
32
|
+
* [TF027](/rules/TF027.md) - Live root's policy block sets undeclared_untagged = "delete", which deletes resources chant does not own
|
|
33
|
+
* [TF028](/rules/TF028.md) - A live root is watched by a TerraformWatchOp built without live: true
|
|
8
34
|
* [TF101](/rules/TF101.md) - terraformApply's planFile must reference a preceding terraformPlan step.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: TF002
|
|
4
|
+
description: A provider the root implies has no required_providers entry, or an incomplete one
|
|
5
|
+
id: TF002
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: terraform
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/terraform/rules/
|
|
10
|
+
---
|
|
11
|
+
A provider the root implies has no required_providers entry, or an incomplete one
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: TF003
|
|
4
|
+
description: Root module's terraform block has no required_version
|
|
5
|
+
id: TF003
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: terraform
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/terraform/rules/
|
|
10
|
+
---
|
|
11
|
+
Root module's terraform block has no required_version
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: TF004
|
|
4
|
+
description: Registry-sourced module block has no version
|
|
5
|
+
id: TF004
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: terraform
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/terraform/rules/
|
|
10
|
+
---
|
|
11
|
+
Registry-sourced module block has no version
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: TF005
|
|
4
|
+
description: Git/hg module source is unpinned, or pinned to a mutable ref
|
|
5
|
+
id: TF005
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: terraform
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/terraform/rules/
|
|
10
|
+
---
|
|
11
|
+
Git/hg module source is unpinned, or pinned to a mutable ref
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: TF006
|
|
4
|
+
description: Sensitive variable declares a default value
|
|
5
|
+
id: TF006
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: terraform
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/terraform/rules/
|
|
10
|
+
---
|
|
11
|
+
Sensitive variable declares a default value
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: TF007
|
|
4
|
+
description: Secret-shaped literal in a variable default or a locals value
|
|
5
|
+
id: TF007
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: terraform
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/terraform/rules/
|
|
10
|
+
---
|
|
11
|
+
Secret-shaped literal in a variable default or a locals value
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: TF008
|
|
4
|
+
description: Provider block configures a hardcoded credential
|
|
5
|
+
id: TF008
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: terraform
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/terraform/rules/
|
|
10
|
+
---
|
|
11
|
+
Provider block configures a hardcoded credential
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: TF009
|
|
4
|
+
description: Credential-named variable is not marked sensitive
|
|
5
|
+
id: TF009
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: terraform
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/terraform/rules/
|
|
10
|
+
---
|
|
11
|
+
Credential-named variable is not marked sensitive
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: TF010
|
|
4
|
+
description: Variable declares no type constraint
|
|
5
|
+
id: TF010
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: terraform
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/terraform/rules/
|
|
10
|
+
---
|
|
11
|
+
Variable declares no type constraint
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: TF011
|
|
4
|
+
description: Variable declares no description
|
|
5
|
+
id: TF011
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: terraform
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/terraform/rules/
|
|
10
|
+
---
|
|
11
|
+
Variable declares no description
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: TF012
|
|
4
|
+
description: Output declares no description
|
|
5
|
+
id: TF012
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: terraform
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/terraform/rules/
|
|
10
|
+
---
|
|
11
|
+
Output declares no description
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: TF013
|
|
4
|
+
description: lifecycle ignore_changes is set to all
|
|
5
|
+
id: TF013
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: terraform
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/terraform/rules/
|
|
10
|
+
---
|
|
11
|
+
lifecycle ignore_changes is set to all
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: TF014
|
|
4
|
+
description: Child module configures a provider block
|
|
5
|
+
id: TF014
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: terraform
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/terraform/rules/
|
|
10
|
+
---
|
|
11
|
+
Child module configures a provider block
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: TF015
|
|
4
|
+
description: Child module declares a backend or cloud block
|
|
5
|
+
id: TF015
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: terraform
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/terraform/rules/
|
|
10
|
+
---
|
|
11
|
+
Child module declares a backend or cloud block
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: TF016
|
|
4
|
+
description: Attribute value is a quoted interpolation of a single expression
|
|
5
|
+
id: TF016
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: terraform
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/terraform/rules/
|
|
10
|
+
---
|
|
11
|
+
Attribute value is a quoted interpolation of a single expression
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: TF017
|
|
4
|
+
description: Module block uses depends_on
|
|
5
|
+
id: TF017
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: terraform
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/terraform/rules/
|
|
10
|
+
---
|
|
11
|
+
Module block uses depends_on
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: TF018
|
|
4
|
+
description: Output value is a whole resource or data source
|
|
5
|
+
id: TF018
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: terraform
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/terraform/rules/
|
|
10
|
+
---
|
|
11
|
+
Output value is a whole resource or data source
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: TF019
|
|
4
|
+
description: Meta-argument explicitly set to its default of false
|
|
5
|
+
id: TF019
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: terraform
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/terraform/rules/
|
|
10
|
+
---
|
|
11
|
+
Meta-argument explicitly set to its default of false
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: TF020
|
|
4
|
+
description: Declaration is never referenced in its module scope
|
|
5
|
+
id: TF020
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: terraform
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/terraform/rules/
|
|
10
|
+
---
|
|
11
|
+
Declaration is never referenced in its module scope
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: TF021
|
|
4
|
+
description: count builds instance identities from count.index where for_each is safer
|
|
5
|
+
id: TF021
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: terraform
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/terraform/rules/
|
|
10
|
+
---
|
|
11
|
+
count builds instance identities from count.index where for_each is safer
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: TF022
|
|
4
|
+
description: Credential-named resource attribute holds a plaintext literal
|
|
5
|
+
id: TF022
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: terraform
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/terraform/rules/
|
|
10
|
+
---
|
|
11
|
+
Credential-named resource attribute holds a plaintext literal
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: TF024
|
|
4
|
+
description: Live root declares a backend or cloud block, which choudoufu refuses
|
|
5
|
+
id: TF024
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: terraform
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/terraform/rules/
|
|
10
|
+
---
|
|
11
|
+
Live root declares a backend or cloud block, which choudoufu refuses
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: TF025
|
|
4
|
+
description: Live root references a non-default terraform.workspace, which choudoufu refuses
|
|
5
|
+
id: TF025
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: terraform
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/terraform/rules/
|
|
10
|
+
---
|
|
11
|
+
Live root references a non-default terraform.workspace, which choudoufu refuses
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: TF026
|
|
4
|
+
description: 'Live root declares delete: "never" but its policy leaves undeclared_tagged at "delete"'
|
|
5
|
+
id: TF026
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: terraform
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/terraform/rules/
|
|
10
|
+
---
|
|
11
|
+
Live root declares delete: "never" but its policy leaves undeclared_tagged at "delete"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: TF027
|
|
4
|
+
description: Live root's policy block sets undeclared_untagged = "delete", which deletes resources chant does not own
|
|
5
|
+
id: TF027
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: terraform
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/terraform/rules/
|
|
10
|
+
---
|
|
11
|
+
Live root's policy block sets undeclared_untagged = "delete", which deletes resources chant does not own
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: TF028
|
|
4
|
+
description: 'A live root is watched by a TerraformWatchOp built without live: true'
|
|
5
|
+
id: TF028
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: terraform
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/terraform/rules/
|
|
10
|
+
---
|
|
11
|
+
A live root is watched by a TerraformWatchOp built without live: true
|
|
@@ -8,15 +8,22 @@
|
|
|
8
8
|
* - terraformInit — `init` with the root's `backendConfig`.
|
|
9
9
|
* - terraformPlan — `plan -detailed-exitcode -out=<planFile>`, plus both
|
|
10
10
|
* `show` renders of the written plan.
|
|
11
|
-
* - terraformApply
|
|
11
|
+
* - terraformApply: `apply <planFile>` on a stock root, a saved plan only;
|
|
12
|
+
* `apply -auto-approve` with no plan file on a live root (#2103).
|
|
12
13
|
* - terraformShow — state, or a saved plan, as JSON and as text.
|
|
14
|
+
* - choudoufuLivePlan: `live-plan -detailed-exitcode -json -estate=<estate>`,
|
|
15
|
+
* plus a second `live-plan` for the human render (#2103).
|
|
16
|
+
* - choudoufuLiveLs: `live-ls -estate=<estate> -json [-consistent]` (#2103).
|
|
17
|
+
* - choudoufuLiveCheck: `live-check -json`, no cloud calls (#2103).
|
|
18
|
+
* - choudoufuAdopt: the tag writes that claim an adoption ledger's matches (#2105).
|
|
13
19
|
*
|
|
14
20
|
* The module is dependency-light on purpose: it shells out to the configured
|
|
15
21
|
* binary and reads the `terraform` config namespace, and never touches the
|
|
16
|
-
* lexicon's HCL parse or serializer, so
|
|
17
|
-
* The pure command and environment builders are exported alongside
|
|
18
|
-
* activities because they are what the tests assert on.
|
|
22
|
+
* lexicon's HCL parse or serializer, so `loadActivities` imports it cheaply at
|
|
23
|
+
* run time. The pure command and environment builders are exported alongside
|
|
24
|
+
* the activities because they are what the tests assert on.
|
|
19
25
|
*/
|
|
20
|
-
export { terraformInit, terraformPlan, terraformApply, terraformShow, terraformInitCommand, terraformPlanCommand, terraformApplyCommand, terraformShowCommand, terraformEnvironment, terraformBinary, countPlanChanges, quoteArg, DEFAULT_PLAN_FILE, DEFAULT_TERRAFORM_BINARY, } from "./terraform.js";
|
|
21
|
-
export type { TerraformRootArgs, TerraformInitArgs, TerraformPlanArgs, TerraformApplyArgs, TerraformShowArgs, TerraformInitResult, TerraformPlanResult, TerraformApplyResult, TerraformShowResult, PlanChangeCounts, } from "./terraform.js";
|
|
26
|
+
export { terraformInit, terraformPlan, terraformApply, terraformShow, choudoufuLivePlan, choudoufuLiveLs, choudoufuLiveCheck, choudoufuAdopt, terraformInitCommand, terraformPlanCommand, terraformApplyCommand, terraformShowCommand, choudoufuLivePlanCommand, choudoufuLiveLsCommand, choudoufuLiveCheckCommand, terraformEnvironment, terraformBinary, countPlanChanges, countLivePlanUnowned, isOlderVersion, parseChoudoufuVersion, quoteArg, DEFAULT_PLAN_FILE, DEFAULT_TERRAFORM_BINARY, DEFAULT_LIVE_PLAN_DOCUMENT_FILE, MIN_CHOUDOUFU_VERSION, classifyApprovalRefusal, CHOUDOUFU_LIVE_PLAN_OUT_REFUSAL, CHOUDOUFU_APPROVAL_EXIT_CODE, CHOUDOUFU_APPROVAL_MISMATCH_REFUSAL, CHOUDOUFU_WRONG_ESTATE_REFUSAL, } from "./terraform.js";
|
|
27
|
+
export type { TerraformRootArgs, TerraformInitArgs, TerraformPlanArgs, TerraformApplyArgs, TerraformShowArgs, ChoudoufuLivePlanArgs, ChoudoufuLiveLsArgs, ChoudoufuLiveCheckArgs, ChoudoufuAdoptArgs, TerraformInitResult, TerraformPlanResult, TerraformApplyResult, TerraformApprovalRefusal, TerraformShowResult, ChoudoufuLivePlanResult, ChoudoufuLiveLsResult, ChoudoufuLiveCheckResult, ChoudoufuAdoptResult, AdoptionRefusal, PlanChangeCounts, LivePlanUnownedCounts, } from "./terraform.js";
|
|
28
|
+
export { detectLiveEstate } from "./live-detect.js";
|
|
22
29
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/op/activities/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/op/activities/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EACL,aAAa,EACb,aAAa,EACb,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,sBAAsB,EACtB,yBAAyB,EACzB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACrB,QAAQ,EACR,iBAAiB,EACjB,wBAAwB,EACxB,+BAA+B,EAC/B,qBAAqB,EACrB,uBAAuB,EACvB,+BAA+B,EAC/B,4BAA4B,EAC5B,mCAAmC,EACnC,8BAA8B,GAC/B,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A fast, regex-based read of whether a root module directory declares a
|
|
3
|
+
* live estate: an `estate.chdf.hcl` sidecar, or a `live { ... }` block nested
|
|
4
|
+
* inside a `terraform { ... }` block of some `.tf` file (#2103).
|
|
5
|
+
*
|
|
6
|
+
* Deliberately separate from `../../hcl/parse.ts`'s AST-accurate detection
|
|
7
|
+
* (`blocksToEntities`'s `liveBlocksIn`), which the build and lint paths use.
|
|
8
|
+
* `op/activities/terraform.ts` is imported by core's activity registry at run
|
|
9
|
+
* time and is dependency-light on purpose, since it shells out to the
|
|
10
|
+
* configured binary and never touches the lexicon's HCL parse or serializer,
|
|
11
|
+
* so it never pulls in
|
|
12
|
+
* the ~1.8 MB `@cdktf/hcl2json` wasm parser just to decide whether an apply
|
|
13
|
+
* should run `apply -auto-approve` with no plan file. Plain text and a
|
|
14
|
+
* hand-rolled brace counter are enough for that narrower question, and the
|
|
15
|
+
* literal sidecar filename below is kept in sync with `LIVE_SIDECAR_FILENAME`
|
|
16
|
+
* in `../../hcl/parse.ts` by hand rather than by importing it, for the same
|
|
17
|
+
* reason.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* The declared estate name for the root module directory `dir`, or
|
|
21
|
+
* `undefined` when none is declared. Checks the `estate.chdf.hcl` sidecar
|
|
22
|
+
* first (cheaper: one file, no brace matching), then every `.tf` file in
|
|
23
|
+
* directory order for a `live { }` block nested in a `terraform { }` block.
|
|
24
|
+
* Returns the first estate name found; a directory with no `.tf` files and
|
|
25
|
+
* no sidecar (or one this function cannot read) yields `undefined` rather
|
|
26
|
+
* than throwing, since this is a best-effort check, not the authoritative parse.
|
|
27
|
+
*/
|
|
28
|
+
export declare function detectLiveEstate(dir: string): string | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* The `undeclared_tagged`/`undeclared_untagged` verbs a live root's `policy {
|
|
31
|
+
* }` block assigns, or `undefined` when the directory declares no `policy`
|
|
32
|
+
* block at all (#2106). Same best-effort posture as {@link detectLiveEstate}:
|
|
33
|
+
* a plain read of the in-block form only (the `estate.chdf.hcl` sidecar's own
|
|
34
|
+
* `policy` block, if choudoufu ever admits one there, is not read here — a
|
|
35
|
+
* known, narrower gap than the estate check above, which does read the
|
|
36
|
+
* sidecar). `TerraformApplyOp` (`../../composites/terraform-apply-op.ts`)
|
|
37
|
+
* uses this to refuse a root whose `policy` sets
|
|
38
|
+
* `undeclared_untagged = "delete"` outright, at build time, before any
|
|
39
|
+
* activity runs; TF026 (`../../lint/post-synth/tf026.ts`) checks the same
|
|
40
|
+
* block's `undeclared_tagged` verb against a root's declared `delete: "never"`
|
|
41
|
+
* from the parsed HCL entities instead, since a post-synth check already has
|
|
42
|
+
* the block body in hand and has no need of this file-reading version.
|
|
43
|
+
*/
|
|
44
|
+
export interface LivePolicyVerbs {
|
|
45
|
+
/** The `undeclared_tagged` quadrant's verb, verbatim, or `undefined` when the attribute is absent (defaults to `"delete"`). */
|
|
46
|
+
undeclaredTagged?: string;
|
|
47
|
+
/** The `undeclared_untagged` quadrant's verb, verbatim, or `undefined` when the attribute is absent. */
|
|
48
|
+
undeclaredUntagged?: string;
|
|
49
|
+
}
|
|
50
|
+
export declare function detectLivePolicyVerbs(dir: string): LivePolicyVerbs | undefined;
|
|
51
|
+
//# sourceMappingURL=live-detect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-detect.d.ts","sourceRoot":"","sources":["../../../src/op/activities/live-detect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AA6CH;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAoChE;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,eAAe;IAC9B,+HAA+H;IAC/H,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,wGAAwG;IACxG,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CA8B9E"}
|