协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
snowflake-strong-auth-migration-pilot【开发与工程】Pilot a Snowflake authentication modernization without lockouts or credential exposure. Inventory PERSON, SERVICE, and LEGACY_SERVICE users; map named workloads to WIF, key pair, OAuth, or bounded PAT; and audit managed MCP/OAuth session controls. Use when replacing Snowflake passwords, reviewing service identities, planning workload identity federat…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Convert an uncertain Snowflake identity estate into an owner-backed, least-privilege authentication pilot. The useful unit is a named workload and its runtime—not a blanket account-wide password deadline. The pilot classifies PERSON, SERVICE, LEGACY_SERVICE, and SERVICE_AGENT principals, maps each bound workload to a supported target, and checks that managed MCP/OAuth primary-role scopes, client behavior, and secondary-role controls cannot silently broaden access.
SHOW USERS, delayed
Account Usage USERS, and the latency-settled portion of a bounded trailing
seven-day LOGIN_HISTORY horizon.
Record the final bundle SHA-256 outside the bundle when it crosses the
controlled local collection boundary; an embedded self-checksum is not provenance.This skill's analyzer is offline and intentionally has no credential or token
authentication flow. If live Snowflake evidence is collected, use the
organization's approved session/authentication process and record method names
only; never place credentials in the inventory or report. This skill has no
Edit authority and never edits local source or Snowflake objects. The Python
analyzer may write only the explicitly requested sanitized report path via
--out; never use that capability for credentials or mutation commands.
This package does not provide an MCP server, OAuth client, or token broker. Any connector is configured separately. Supply only sanitized read-only evidence and verify account, edition, connector, client behavior, and feature availability.
SNOWFLAKE_SERVICE rows remain in receipt cap accounting
but are excluded from the operator migration denominator. SERVICE_AGENT
remains an operator-owned service classification.DEFAULT_ROLE, allowed/blocked roles, and
OAUTH_USE_SECONDARY_ROLES. Never collapse those into one invented role list.Read current-evidence-contract.md, then collect all three independent read-only surfaces under the same account, collector identity, primary role, secondary-role configuration, and CLI profile:
AUTH_PROFILE="replace-with-approved-readonly-profile"
python3 "${CLAUDE_SKILL_DIR}/scripts/collect_snowflake_evidence.py" \
--surface auth-current --connection "${AUTH_PROFILE}" \
--output snowflake-auth-current.json
python3 "${CLAUDE_SKILL_DIR}/scripts/collect_snowflake_evidence.py" \
--surface auth --connection "${AUTH_PROFILE}" \
--output snowflake-auth-history.json
python3 "${CLAUDE_SKILL_DIR}/scripts/collect_snowflake_evidence.py" \
--surface auth-login-history --connection "${AUTH_PROFILE}" \
--output snowflake-auth-login-history.json
Do not use --input-json: offline normalization cannot bind live posture or
execution context. A cap hit, collector error, stale receipt, context mismatch,
privilege-filtered SHOW row, or user-hash drift blocks scoped completeness.
Build one schema-2 bundle containing those receipts, the exact expected
hashed organization-plus-account/user/role authorization context, an explicit digest
coverage denominator, owner-backed users/workloads, and one approved bounded
enforcement window per workload. Operator type and current authentication
method declarations must match receipted posture. Include method names and
booleans only; omit credential values and all canary/break-glass payloads.
Workload names must be unique. MFA posture is a separate factor observation,
not a primary auth_methods value.
The reference defines the exact envelope.
At the controlled local boundary, compute and separately record the final canonical bundle digest:
python3 "${CLAUDE_SKILL_DIR}/scripts/analyze_auth_evidence.py" \
--input snowflake-auth-bundle.json --print-input-sha256
The digest is an operator assertion of byte identity, not a signature or collector identity proof. Never place it inside the bundle it authenticates.
Run the evidence-gated analyzer with that out-of-band digest:
python3 "${CLAUDE_SKILL_DIR}/scripts/analyze_auth_evidence.py" \
--input snowflake-auth-bundle.json \
--trusted-input-sha256 sha256:<recorded-digest> \
--out snowflake-auth-pilot.json
The wrapper validates exact reviewed SQL hashes, sources, dataset fields,
row counts/caps, live mode, wall-clock freshness, declared authorization context, coverage, and
current/history reconciliation before allowing receipt rows into analysis.
analyze_auth.py remains the metadata-only planning engine; it cannot certify evidence.
Load mcp-oauth-role-scoping.md when an MCP/OAuth integration appears. Verify feature support and live role mapping; the report is not evidence that an integration is enabled.
Produce the dry-run cutover packet. For each workload include owner, current path, selected target, capability evidence, role scope, canary, rollback, and the exact authorized operator/change window. Read cutover-and-recovery.md.
Require both positive and negative receipts: target login and allowed action; old-path rejection only after replacement/recovery; out-of-scope role/object denial; and independent recovery. Keep the current path until receipts are accepted.
MANUAL_REVIEW, not a
guessed migration.Return a JSON report plus a human-readable packet containing:
edit_authority: false, and separately
tested break-glass/canary evidence;| Condition | Response |
|---|---|
| Missing/mismatched out-of-band digest | Quarantine receipt rows and return UNTRUSTED, INVALID_TRUST_ANCHOR, or DIGEST_MISMATCH. |
| SHOW-only, stale, capped, errored, or context-mismatched evidence | Block scoped completeness and cutover approval; recollect all required surfaces. |
| Raw username, email, IP, event ID, factor ID, connection ID, or free-form error appears in receipt rows | Reject the receipt; use only the reviewed pseudonymous projection. |
| Credential-bearing field appears | Stop; remove it and rerun with metadata only. |
| Service has no workload/owner | Do not disable it; open ownership discovery. |
| WIF support is not proven | Treat supported_auth as an unverified operator declaration; verify the exact runtime, driver, connector, integration, and target login before approval. |
| MCP OAuth controls are missing or broad | Stop; capture scopes, client behavior, default role/warehouse, allow/block lists, and secondary-role mode. |
| Canary or recovery test fails | Preserve the current path, use the approved recovery route, and record the failure. |
| User requests mass disable/rotation | Convert to a staged, owner-approved packet; this skill does not execute mutations. |
Declare a password-backed ETL_SVC as LEGACY_SERVICE, bind it to etl-prod, and list only supported
target methods such as ["WIF", "KEY_PAIR"]. The analyzer selects WIF first,
then requires canary login, allowed-action, denied-old-path, and recovery receipts.
Declare OAUTH_SCOPES_SUPPORTED, whether the client requests a named role or
session:role:all, the user's DEFAULT_ROLE and DEFAULT_WAREHOUSE, the
integration allow/block lists, and OAUTH_USE_SECONDARY_ROLES. A missing or
overbroad control stops the packet; the analyzer never broadens it.