How foadtalsi/tf-predeploy-firewall works
TF Pre-Deploy Firewall is a local-first Terraform change scanner. Its workflow is CLI selection of repository changes, HCL parsing and rule evaluation (optionally informed by provider schemas, plan JSON, and AWS reads), then findings, threshold verdict, and rendered or code-host-published reports. The graph preserves documented checks and integrations even where their implementation was not sampled; those branches are shown only where README or indexed references support the relationship.
Main entry points: pipeline.py Scan pipeline · forges.py Forge publishing · engine.py Rule engine · client.py Hosted licensing
Components 27
Scan orchestration
- CLI entry
src/tfpdf/cli/main.py - Scan pipeline
src/tfpdf/cli/pipeline.py - Forge publishing
src/tfpdf/cli/forges.py
Terraform inputs
- Git changes
src/tfpdf/diff/git.py - Local changes
src/tfpdf/diff/local.py - HCL parser
src/tfpdf/hcl/parser.py - HCL AST and evaluation
src/tfpdf/hcl/ast.py - Terraform model
src/tfpdf/parser/hcl.py - Terragrunt inputs
src/tfpdf/terragrunt.py - Variable inputs
src/tfpdf/tfvars.py - Plan JSON
src/tfpdf/planjson.py
Rules and knowledge
- Rule engine
src/tfpdf/rules/engine.py - Change risks
src/tfpdf/rules/changedattrs.py - Rule packs
src/tfpdf/ruledef/rules.py - Provider schemas
src/tfpdf/schema/loader.py
Findings and reports
- Findings
src/tfpdf/report/finding.py - Report renderers
src/tfpdf/report/markdown.py - SARIF output
src/tfpdf/report/sarif.py - Review suggestions
src/tfpdf/report/review.py - Accepted risks
src/tfpdf/baseline.py
External services
- AWS read checks
src/tfpdf/cloudread.py - Hosted licensing
src/tfpdf/licensing/client.py - HTTP JSON client
src/tfpdf/_httpjson.py - GitHub / GitLab
Other components
- Engineer / CI
- AWS
- Hosted service
Connections 28
- Engineer / CI → CLI entry: starts scan
README.md - CLI entry → Scan pipeline: runs scan
src/tfpdf/cli/main.py - Scan pipeline → Git changes: selects changes
src/tfpdf/cli/pipeline.py - Scan pipeline → Local changes: selects changes
src/tfpdf/cli/pipeline.py - Scan pipeline → Terraform model: scans Terraform
src/tfpdf/cli/pipeline.py - Scan pipeline → Terragrunt inputs: checks files
README.md - Scan pipeline → Variable inputs: checks variables
README.md - Scan pipeline → Plan JSON: loads plan
src/tfpdf/cli/pipeline.py - Terraform model → HCL parser: parses HCL
src/tfpdf/parser/hcl.py - HCL parser → HCL AST and evaluation: builds AST
src/tfpdf/hcl/parser.py - Scan pipeline → Rule packs: loads rules
src/tfpdf/cli/pipeline.py - Scan pipeline → Provider schemas: loads schemas
src/tfpdf/cli/pipeline.py - Scan pipeline → Rule engine: runs analysis
src/tfpdf/cli/pipeline.py - Rule engine → Change risks: checks changes
src/tfpdf/rules/engine.py - Rule engine → Findings: emits findings
src/tfpdf/rules/engine.py - Scan pipeline → Findings: collects results
src/tfpdf/cli/pipeline.py - Scan pipeline → Accepted risks: filters accepted
src/tfpdf/cli/pipeline.py - Scan pipeline → AWS read checks: checks cloud state
src/tfpdf/cli/pipeline.py - AWS read checks → AWS: reads resources
README.md - Scan pipeline → Hosted licensing: requests features
src/tfpdf/cli/pipeline.py - Hosted licensing → HTTP JSON client: uses client
src/tfpdf/licensing/client.py - Hosted licensing → Hosted service: calls hosted API
README.md - Scan pipeline → Report renderers: renders report
src/tfpdf/cli/pipeline.py - Scan pipeline → SARIF output: renders SARIF
README.md - Report renderers → Findings: formats findings
src/tfpdf/report/__init__.py - Scan pipeline → Forge publishing: publishes results
src/tfpdf/cli/pipeline.py - Forge publishing → Review suggestions: renders suggestions
src/tfpdf/cli/forges.py - Forge publishing → GitHub / GitLab: posts comments
README.md