Fix slack_webhook_url GPG — empty string breaks Salt pillar #47
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/pal-e-platform!47
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "hotfix-slack-webhook-empty-string"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
slack_webhook_urlwas encrypted fromecho -n ''in PR #45secrets:platformpillar returns empty, breakingmake tofu-secrets'unused'as the dormant placeholder valueChanges
salt/pillar/secrets/platform.sls— replacedslack_webhook_urlGPG block with non-empty valueTerraform Changes
No infra changes. Fixes
make tofu-secretsrendering (was returning 0 secrets, now returns 16).Test Plan
sudo salt-call pillar.get secrets:platform --out=jsonreturns 16 secrets (verified locally)make tofu-secretsrenders all 15 TF varsReview Checklist
Constraints
Related
arch-secrets-pipeline— private architecture docsop-secrets-management— proceduresCloses #46
Discovered Scope
sop-secrets-management: "Never encrypt empty strings — Salt GPG renderer treats PLAINTEXT_LENGTH 0 as failure. Use a placeholder like 'unused' for dormant secrets."PR #47 Review
BLOCKERS
1. Terraform conditional guard will break with
'unused'placeholderThe Terraform code in
terraform/main.tfusesvar.slack_webhook_url != ""as a guard to conditionally enable the Slack Alertmanager receiver (lines 168, 190, 300). With the GPG block now decrypting to"unused"instead of"", this guard evaluates totrue, which means:severity=~"critical|warning"alerts (line 168-173)api_urlis set to"unused"viaset_sensitive(line 300-304)Alertmanager will attempt to POST alerts to
"unused"as a URL and fail. This is a functional regression -- the old empty-string value (when the whole pillar worked) correctly disabled Slack routing via the!= ""guard.Fix options:
var.slack_webhook_url != "" && var.slack_webhook_url != "unused"(or usestartswith("https://"))"unused"in Salt but update the TF conditional to match2.
secrets_registry.slsdescription is stalesalt/pillar/secrets_registry.slsline 107 still says"dormant — empty string"and line 111 says"Empty string = dormant". The value is now"unused", not an empty string. The registry should be updated to match.NITS
The PR body's Test Plan shows one item unchecked:
[ ] make tofu-secrets renders all 15 TF vars. Given that this is the exact pipeline the fix is meant to repair, running this to completion before merge would provide confidence. (Though thesalt-call pillar.getverification is the more critical one and is checked.)The Discovered Scope section correctly identifies the SOP update needed for
sop-secrets-management. Good practice.The PR body says "returns 16 secrets" in one place and "renders all 15 TF vars" in another. The discrepancy is fine (16 pillar keys vs 15 TF vars could mean one pillar key is not mapped to TF), but worth a quick sanity check that the counts are intentional.
SOP COMPLIANCE
hotfix-slack-webhook-empty-string, not46-*. Hotfix naming is reasonable for urgency, but SOP expects issue-number prefix.Closes #46present in PR bodyslack_webhook_urlGPG block replaced (14 lines removed, 14 lines added). No other secrets touched.VERDICT: NOT APPROVED
The core fix (re-encrypting from
'unused'instead of empty string) correctly solves the Salt GPG PLAINTEXT_LENGTH 0 failure. However, the downstream Terraform conditional logic will silently break: Slack routing will activate with an invalid URL. This must be addressed before merge -- either by updating the TF guard or choosing a placeholder value that the existing!= ""guard handles correctly. The stale registry description should also be updated in the same PR.