Repository navigation
Add a Snowflake coverage audit and findings checklist - #94
Conversation
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
|
Great scope and a genuinely useful deliverable. These findings are all in the audit tool itself ( Confirmed:
Plausible, not independently verified (worth a look):
Suggestions for verifying this class of thing going forward:
None of this blocks |
8b5d280 to
a44022e
Compare
|
Thanks for the review, @noel. This round also answers GitGuardian and fixes the failing test check. The branch is now one commit, GitGuardian: 4 secretsAll 4 values were made up for the live tests (two base64 Azure master keys, one OAuth client id and secret pair). None was ever a real credential, so nothing needs rotation. They still must not be in the repo.
Failing test checkpytest collected Your findings
|
|
Reviewed the new commit ( Five findings, severity order. All of them are in
I also spot-checked two of the "Other code findings" claims against the source and both hold: Nitpicks, not worth filing:
|
Add tools/snowflake_coverage: an inventory of 164 Snowflake objects and
their properties from the docs, a static map to snowcap fields, a live
audit that tests each sampled property on a real account in throwaway
databases, and FINDINGS.md, a checklist that report.py generates from
the inventory.
The inventory holds no credential value, real or made up. Every
credential input is a {secret:NAME} placeholder that the audit fills
for the run and writes back as the placeholder. Evidence redacts the
account locator and Snowflake-generated AWS external ids.
The live audit isolates each object: a failure clears that object's
results and the run continues. Cleanup attempts every drop and keeps
failed objects tracked for the object's final retry. The static map
follows fetch functions that return a helper's result.
a44022e to
def81ac
Compare
|
Follow-up: GitGuardian flagged a placeholder name ( |
|
Reviewed the full branch at
Seven findings. The first two are the ones that affect whether the checklist can be trusted, the rest are tooling sharp edges.
Nothing here blocks the approach, and the deliverable is solid. I'd want 1 and 2 fixed before merge since they're the two that put wrong information into the artifact people will act on. The rest can land as follow-ups if you'd rather get this in. |
|
@GClunies checking in, no movement since my review of To restate where I landed so nothing is ambiguous: the approach and the deliverable are solid, and I only want findings 1 and 2 before merge, the plan-time read errors recorded as L2 create failures, and Are you planning to make those updates? If you'd rather get this in and chase the rest later, fixing just 1 and 2 is enough from my side. |
Each change answers a finding from noel's reviews of a44022e and def81ac. - A plan only reads the account, so an error while snowcap plans is now a read failure (ReadFailed): L3 fetch_crash for the create, L4 fetch_crash for the change. Before, a rejected fetch query (VIEW, MATERIALIZED VIEW, DATABASE ROLE tags) or a missing fetch function (HYBRID TABLE, EXTERNAL FUNCTION) showed as an L2 create failure, and a read error while planning the change showed as L4 bad_sql. - A truth key that reports no value no longer passes L2 or L4. norm(None) was "none", so it matched an expected NONE or null (STORAGE INTEGRATION:s3 storage_aws_object_acl passed L2 vacuously). - create_sql is kept before the apply, so a create that Snowflake rejects shows the SQL it rejected. - The combined test leaves out rows that share a field. It sent only the last row's value and then checked the other rows against it. - The ACCOUNT object puts back each account parameter that had an account-level value. Its cleanup UNSETs each one, which reset a customized value to the default. - select_objects exits with an error for a label that names no modeled object. A typo audited nothing and exited 0. - testable_rows skips a sampled row with field: null (TypeError). - l1 accepts a path that ends in [] (IndexError). - report.py labels an untested object "Not tested live" (KeyError), and derives the owner limit from the inventory (3 owner rows have samples). - returned_keys stops at a recursive helper, and secret() refuses a name past the 61 values it can encode. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011dXsGHmirL884VdCkJuMYY
A missing value now stays untested only when the expected value is NONE or null. The first fix for the review made every missing value untested. The rerun showed that this hid 5 real CREATE failures: TABLE columns[].tags, columns[].collation and row_access_policy, MATERIALIZED VIEW columns[].tags, and ICEBERG TABLE:snowflake columns[].tags. The CREATE SQL leaves out each value. test_a_value_snowflake_does_not_report_fails_when_a_value_was_expected fails without the fix. All 76 live objects ran again on snowcap 584e44b. Compared with def81ac: - 36 rows move from an L2 create failure to an L3 read failure: the tags of DATABASE ROLE, MATERIALIZED VIEW and VIEW, 15 EXTERNAL FUNCTION rows and 18 HYBRID TABLE rows. - STORAGE INTEGRATION:s3 storage_aws_object_acl: L2 is untested, not pass. - 15 L4 crashes in snowcap's fetch code are read failures now. - 35 of 37 create failures keep the SQL that snowcap sent. The other 2 fail before snowcap compiles SQL. The ACCOUNT run restored a customized STATEMENT_TIMEOUT_IN_SECONDS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011dXsGHmirL884VdCkJuMYY
|
@noel thanks for both reviews. I fixed all of them, not only 1 and 2. What the rerun changed, against
|
| Change | Rows |
|---|---|
L2 create → L3 fetch_crash (finding 1) |
36: DATABASE ROLE, MATERIALIZED VIEW and VIEW tags, 15 EXTERNAL FUNCTION, 18 HYBRID TABLE |
L2 pass → untested (finding 2) |
1: STORAGE INTEGRATION:s3 storage_aws_object_acl |
L4 update_crash → fetch_crash (last nitpick) |
15: AUTHENTICATION POLICY (8), SECURITY INTEGRATION:snowflake_oauth_partner (6), api_auth_client_credentials (1) |
| ACCOUNT combined message (finding 3) | 1 |
No other level or failure kind changed. The summary counts stay at 279 pass, 268 fail, 600 not modeled, and 381 without a sample. "CREATE leaves out the value or fails" drops from 73 to 37. "snowcap fails while it reads the object" goes from 30 to 66.
Review of def81ac
- Plan-time read errors as L2 failures. Fixed.
Account.plannow raisesReadFailedfor a Snowflake error during the plan.snowcap_errorraises it for any crash that has asnowcap.data_providerframe.test_rowrecords the error as L3fetch_crashand sets L2 to untested. The VIEW row now readssnowcap's read fails while it plans the create: ProgrammingError: 391806 (0A000): SQL compilation error: Invalid value VIEW for argument OBJECT_TYPE. Tests:test_a_failed_read_while_planning_the_create_fails_l3_not_l2andtest_plan_reports_snowflake_errors_and_fetch_crashes_as_failed_reads. The second test uses the realdata_provider.fetch_resourceon EXTERNAL FUNCTION. norm(None) == norm("NONE"). Fixed.norm(None)returns None now, so a missing value never equalsNONE. A missing value is untested when the expected value is NONE or null, in L2 and in L4 throughlanded. When the expected value is a real value, a missing value fails, as before. My first fix made every missing value untested. The rerun showed that it hid 5 real CREATE failures, for example TABLEcolumns[].tags, whose CREATE SQL leaves out the tag.d2ff854corrects this. Tests:test_a_value_snowflake_does_not_report_never_passesandtest_a_value_snowflake_does_not_report_fails_when_a_value_was_expected.storage_aws_object_aclkeeps its checkbox, because L4 and L5 pass on a reported value (bucket-owner-full-control). That is the documented rule: every tested level passes. L2 no longer passes.
- Combined test collapses shared fields. Fixed.
test_combinedleaves out rows that share a field and lists them undershared. Themissedcheck runs only over the rows that it applied. ACCOUNT now readsuntested (needs two or more fields, and rows that share value cannot combine). Tests:test_combined_leaves_out_rows_that_share_a_fieldandtest_combined_of_rows_that_all_share_one_field_is_untested. l1()IndexError oncolumns[]. Fixed.headandhead[]both name the field itself. Test:test_l1_models_a_list_field_path.- No "snowcap sent" SQL for L2 failures. Fixed.
Account.createsavescreate_sqlbefore the apply. Now 35 of 37 create failures show the SQL. The other 2 fail before snowcap compiles SQL: CATALOG INTEGRATION:object_storagetable_format(snowcap rejects the declaration) and ICEBERG TABLE:snowflakeexternal_volume(MissingResourceExceptionforSNOWFLAKE_MANAGED). Test:test_a_create_that_snowflake_rejects_keeps_the_sql_it_sent. - Limits wrong about
owner. Fixed. The report now takes the limit from the data: "ownerhas a live sample only for PROCEDURE:python, SCHEMA, TABLE." Test:test_limits_name_the_objects_whose_owner_is_sampled. - Mistyped label exits 0. Fixed.
select_objectsexits 1 withNo modeled object has the label: NOPE. Test:test_select_objects_refuses_a_label_that_names_no_modeled_object.
Review of a44022e
Items 1 and 3 are the same as items 2 and 3 above.
- 2. ACCOUNT resets account parameters. Fixed. Before CREATE DATABASE,
test_objectreadsSHOW PARAMETERS ... IN ACCOUNTfor each parameter row. The teardown puts back each value set at levelACCOUNT. The "How to update" section now says this. I tested it on the live account:Test:SET STATEMENT_TIMEOUT_IN_SECONDS = 171717 → 171717, level ACCOUNT live_audit.py ACCOUNT → 5 rows pass L2–L5 SHOW after the run → 171717, level ACCOUNT UNSET → 172800, level ''test_account_parameter_restores_put_back_only_customized_values. - 4.
testable_rowsTypeError onfield: null. Fixed with afieldguard. Test:test_testable_rows_skips_a_sampled_row_that_snowcap_does_not_model. - 5. Non-live object labeled "Docs only". Fixed.
docs_onlyprints "Docs only: ...". Any other value prints "Not tested live", plus the reason if the row has one. Test:test_object_section_names_each_test_value.
Nitpicks
secret()past 61 names. Fixed. It raisesValueErrorpastMAX_SECRETS = 61. Test:test_secret_refuses_a_name_past_the_values_it_can_encode.- No cycle guard in
returned_keys. Fixed. It tracks the functions it has seen. Test:test_returned_keys_stops_at_a_cycle. snowflake.connector.errors.Errorin a plan read recorded as L4bad_sql. Fixed throughReadFailed, as in item 1. The 15 rows in the table above now show as read failures, not change crashes. All 76bad_sqlrows are still ALTER errors.static_mapuses ENTERPRISE. No change.static_map.pyhas no account connection, so it has no real edition to pass.live_audit.pyuses the realaccount.editionfor every live level.
Checks on d2ff854
uv run pytest --ignore=tests/integration: 2288 passed.make lintandmake typecheckpass.- I set each changed source file back to its
def81acversion, one at a time. Its new tests failed each time. The fix ind2ff854has the same check. report.pygives the sameFINDINGS.mdon two runs.static_map.pyleavesinventory.yamlbyte-identical.- After the run,
SHOW DATABASES LIKE 'COVERAGE%'returns nothing.
|
@GClunies thanks for taking all of them, not only 1 and 2. Re-reviewed One thing before merge: the results are stale against Two small notes, neither blocking:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011dXsGLBEG2amgh6CdUmCP5
Since norm(None) stays None, a truth key that reports 'NONE' failed L2 and L4 against an expected null, though both mean no value. The new same() treats that pair as a match in L2, in landed() (L4 and the combined test), and in the L3 read-back reference. A missing value still matches nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011dXsGLBEG2amgh6CdUmCP5
Rerun live_audit.py on every object at snowcap 6ce5c12, so FINDINGS.md reflects current main, as the review asked. main changed three things that the inventory had to follow: - RESOURCE MONITOR: triggers is a field now (datacoves#86). The truth query joins SHOW's notify_at, suspend_at, and suspend_immediately_at columns, and the row has samples. It passes L2 to L5. - SECURITY INTEGRATION:saml2: SAML2SecurityIntegration models it now. The object has create_args, truth queries, and samples for 11 rows. The rows without a sample say why. The x509 samples are self-signed test certificates with no private key. - EXTERNAL FUNCTION: fqn now carries the argument signature (datacoves#90), so the DESCRIBE in the truth query doubled it and failed. The query names the function without a signature now. NOTEBOOK now fails L2, because Snowflake disabled new Legacy Notebooks on the test account (BCR: no Legacy Notebook activity in the 60 days before November 1, 2026). snowcap's Notebook renders only the legacy CREATE NOTEBOOK, so the finding is correct for current snowcap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011dXsGLBEG2amgh6CdUmCP5
|
Thanks @noel. I merged
Note 1: the fix
Proof: What
|
Before (584e44b) |
After (6ce5c12) |
|
|---|---|---|
| Supported by snowcap | 83 | 84 |
| Properties that pass | 279 | 299 |
| Properties that fail L2 to L5 | 268 | 260 |
| Modeled, without a live sample | 381 | 389 |
The main row changes:
- ALERT:
actionandconditionnow pass L4 and L5. - EXTERNAL FUNCTION: 15 rows no longer crash at L3. Six rows now reach L4 and fail it. snowcap sends
ALTER FUNCTION ... SETforreturns,url,volatility,null_handling,return_not_null, and argument names, and Snowflake rejects each one. - TASK
after[]: L4 changed frombad_sqlto "snowcap refuses a change that ALTER supports", which follows Split task and alert updates into one ALTER per clause #88. - NOTEBOOK: L2 now fails, with
Creation of legacy notebooks has been disabled for this account. Snowflake blocks new Legacy Notebooks on accounts that had no Legacy Notebook activity in the 60 days before November 1, 2026 (BCR). snowcap'sNotebookrenders only the legacyCREATE NOTEBOOK, so I kept this finding.
Checks
uv run pytest tools/snowflake_coverage: 23 passed.uv run pytest --ignore=tests/integration: 2404 passed.ruff checkandruff format --check: clean.report.pygives byte-identical output on a second run, and a secondstatic_map.pyrun leavesinventory.yamlunchanged.- After the run,
SHOW ... LIKE 'COVERAGE%'returns 0 rows for databases, warehouses, integrations, resource monitors, roles, users, and external volumes.
Could you take another look?
|
@GClunies thanks, re-reviewed A few latent issues for a follow-up. None of them affects a row in the current
Small one: |
What and why
snowcap aims to manage every Snowflake object and every property. This PR measures how close it is and lists what is left as one checklist. It does not change snowcap itself.
tools/snowflake_coverage/inventory.yamllists 164 objects and variants from the Snowflake docs (GA and public preview), with every property and its CREATE, ALTER, and SHOW behavior.static_map.pymaps each property to a snowcap field (L1).live_audit.pytests each sampled property on a real account in a throwaway database: created (L2), read back (L3), changed (L4), and a clean plan after (L5).report.pygeneratesFINDINGS.mdfrom the inventory. Every box is derived. A box is checked when snowcap supports the object, or when every tested level of the property passes. A fix PR rerunslive_audit.pyfor its object andreport.py, and its items become checked.Current state: 84 of 164 objects are supported. In those objects, 299 properties pass, 260 fail at least one live level, and 601 are not modeled.
I chose one document over filing a large number of issues. The maintainer can decide how to split the work.
Validation
6ce5c12(main with fix(lifecycle): transfer ownership with the object type GRANT OWNERSHIP accepts #84, feat(resource_monitor): manage triggers, several notify users, and non-ACCOUNTADMIN owners #86, Split task and alert updates into one ALTER per clause #88, fix(external-function): manage signatures and grants #90, Escape the remaining hand-quoted string literals #93, and feat(security-integration): add SAML2 resource for SSO #96 to docs: real meta descriptions and TechArticle schema on every page #100) on 2026-11-21, ENTERPRISE edition on AWS US_WEST_2. Each object'stestedblock records its own run facts. Thesnowcap/package is unchanged.584e44b, these results changed:triggers[]is a field now, and it passes L2 to L5.actionandconditionpass L4 and L5.ALTER FUNCTION ... SET.after[]: snowcap refuses the change now, and ALTER supports it.report.pyoutput is the same on two runs. The checklist has 964 open and 414 checked boxes.{secret:NAME}placeholder that the audit fills for the run only. The evidence redacts the account locator and Snowflake-generated AWS external ids.SHOW DATABASES LIKE 'COVERAGE%'returns nothing.STATEMENT_TIMEOUT_IN_SECONDSto 171717, and the run restored it.uv run pytest --ignore=tests/integrationpasses (2404), including the tests intools/snowflake_coverage/.make lintandmake typecheckpass.How to review
FINDINGS.md, thenlive_audit.py(test_rowholds the level rules).inventory.yamlis data (about 77,000 lines). Skim one object, for example TABLE.🤖 Generated with Claude Code
https://claude.ai/code/session_011dXsGLBEG2amgh6CdUmCP5