Repository navigation
Scrub environment-specific Sigma values and add a leak guard - #10
Merged
Merged
Conversation
…st regressions - Folder and data model ids follow the connection id: project vars reading SIGMA_FOLDER_ID and SIGMA_DATA_MODEL_ID with placeholder defaults; golden files store <folderId> and <dataModelId>. - Assertions now compare folderId and dataModelId with the vars (they only checked truthiness), and the script's override step covers all three ids. - README examples use placeholders; remove the stale 'repository is private' paragraph; drop the references to Sigma's own build plugin. - Add scripts/test_no_leaked_ids.py: fails on real-looking ids, non-example emails, non-public Sigma hosts and local paths in tracked files, with tests proving it can find each. - AGENTS.md: never commit real ids, emails, internal hosts or local paths. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The guard scans tracked files, and its scanner tests contained literal fake ids, addresses and paths, so it reported itself in CI (locally the file was still untracked, so it was skipped). Assemble the fixtures at run time so the source holds no literal leaks, rather than exempting the file. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Adds .pre-commit-config.yaml with a local hook that runs scripts/test_no_leaked_ids.py before every commit, so a leak is stopped before it enters history (which is permanent). Verified it passes on the clean tree and fails, naming file and line, on a staged file holding a real-looking id. Documented in AGENTS.md and the integration tests README. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
A scan of the tracked files and the full git history found environment-specific Sigma values in the repo. This PR removes everything that can be removed from the current tree and adds a guard so it can't come back. (#9 already handled the connection id; this finishes the job.)
Ids
sigma_folder_idand the data model id follow the connection id pattern: project vars inintegration_tests/dbt_project.ymlthat readSIGMA_FOLDER_ID/SIGMA_DATA_MODEL_IDand default to00000000-0000-0000-0000-0000000000NNplaceholders.<folderId>and<dataModelId>(check_golden.pynormalizes them on both sides, likeconnectionId). The golden diff is exactly those 7 lines.assert_workbooksnow comparesfolderIdanddataModelIdwith the vars. Before, the folder assertion only checked truthiness while its message claimed it checked the var. The script's override step re-runs the assertions with all three ids overridden.<your-sigma-...-id>placeholders.Wording
dbt depsneeds credentials" paragraph (with its credential-token snippet).Guard
scripts/test_no_leaked_ids.pyscans tracked files and fails on: any UUID that isn't a placeholder, any email address not atexample.com, any*.sigmacomputing.comhost other thanhelp.,assets.,api.andapp., and local paths (/Users/<name>/,/home/<name>/). It runs in CI with the other script tests. Tests prove it can find each kind (and that it scans tracked files only, not local ignored ones), and I planted a real-looking id in the README to confirm it fails with the file and line.AGENTS.mdrecords the rule.Verification
Passes on dbt 1.x with
--warn-error(also with all threeSIGMA_*variables set to other values, with no golden churn) and on dbt 2.x: 30 negative cases, 45 Python tests. A re-run of the original scan over tracked files finds only the three placeholder defaults.What this cannot fix: git history
The following are still in the history of every branch and PR ref, and merging this does not remove them:
matt.senick@sigmacomputing.com, and "Matt Senick (Sigma)" on the merge commits GitHub made).Whether that matters depends on how the repo reaches
Matts52: a transfer or mirror carries all of it, while publishing a squashed snapshot of the cleaned tree does not. Rewriting this repo's history is possible but destructive (all branches and PRs would need re-pushing), so it is left as a decision. Also worth checking: the configuredgit user.emailon any machine that will keep committing.If the real connection or folder ids were ever in use, whether they need rotating depends on your org's policy.
🤖 Generated with Claude Code