Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintReport ¶
func PrintReport(findings []Finding, opts ReportOptions)
PrintReport prints a human-readable summary of secret findings grouped by file, showing the resource address and attribute that contains each secret.
Types ¶
type Finding ¶
type Finding struct {
report.Finding
// ResourceAddress is the Terraform resource address (e.g. "jamfpro_webhook.slack_alerts")
ResourceAddress string
// AttrName is the HCL attribute that contains the secret (e.g. "authentication_password")
AttrName string
// InSupportFiles is true when the finding is inside support_files/
InSupportFiles bool
// SupportFileRef is the .tf file attribute that references this support file
// via file() (e.g. "support_files/app_configurations/Jamf_Trust.xml")
SupportFileRef string
}
Finding wraps a gitleaks finding with jamformer-specific metadata.
type RemediateResult ¶
type RemediateResult struct {
VariablesAdded int
TFFilesChanged int
SupportFiles int // support_files converted to templatefile()
Skipped int // secrets embedded in larger strings that couldn't be auto-replaced
}
RemediateResult summarises what the remediation changed.
func Remediate ¶
func Remediate(dir string, findings []Finding) (*RemediateResult, error)
Remediate moves detected secrets to sensitive Terraform variables.
For .tf file findings: replaces the literal value with var.<name> and appends the variable declaration + tfvars entry.
For support_files findings: replaces the secret with a template variable, renames the file to .tpl, updates the .tf reference from file() to templatefile(), and creates the variable + tfvars entry.