본문으로 건너뛰기
cccskills
무료GitHub에 공개

schema-field-redaction

Add redaction annotations to sensitive fields in schemas to block or hash PII. Use when configuring GDPR/HIPAA compliance, protecting credentials, or blocking internal fields from materializations. Use when user says "protect PII", "hide sensitive data", "hash field", "redact field", "GDPR compliance", "don't capture field", "remove field from Estuary", or "prevent Estuary from capturing field".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md8.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Protect Sensitive Data with Field Redaction

Add redaction annotations to your collection schema to protect sensitive data at the source. Redacted fields are blocked or hashed before documents are stored or materialized.

When to Use

  • PII Protection: Hash emails, SSNs, phone numbers for GDPR/HIPAA/CCPA compliance
  • Credential Security: Block passwords, API keys, tokens from ever leaving the capture
  • Internal Fields: Remove internal-only metadata before materialization
  • Data Minimization: Ensure only necessary data reaches downstream systems

How Redaction Works

Redaction is applied at write time — sensitive data never reaches Estuary storage, logs, or downstream materializations. This is the earliest point to remove fields, before derivations or materialization field selection.

Redaction only applies to documents captured after publishing the annotation. To redact historical data, trigger a dataflow reset backfill on the capture.

Redaction Strategies

StrategyEffectUse When
blockRemoves the field entirelyField should never exist downstream
sha256Replaces value with salted hashNeed to join/match on field (hash is deterministic per task)

Prerequisites

  • flowctl installed and authenticated
  • Write access to the collection you want to modify
  • Know which fields contain sensitive data

Key Constraints

  1. Cannot redact key fields — Would break collection semantics.
  2. block on required fields — Validation fails with `block` redact strategy cannot be applied at '/path/to/field' because it must exist (the path is a JSON Pointer to the field) UNLESS the read schema references the inferred schema (flow://inferred-schema), in which case the validator suppresses that error automatically. For explicit schemas, remove the field from required first (see Troubleshooting).
  3. sha256 on non-string-typed fields — At runtime the hasher accepts any type. But at publish time, validation fails with /path/to/field has 'sha256' redact strategy but cannot be a string (types are "<type>") if the field's declared type set has no overlap with string. A union like ["string","null"] or ["string","integer"] passes — only a field that cannot be a string at all (e.g., pure integer or pure object) is rejected.

Procedure

Step 1: Pull the Collection Spec

flowctl catalog pull-specs --name <tenant>/<collection-name>

This creates a local directory with flow.yaml and potentially referenced schema files.

Step 2: Add Redaction Annotations

Add redact annotations to the writeSchema (not the readSchema — this is a write-time operation). If the collection uses a simple schema (no separate write/read), add annotations there instead.

Placement depends on how the writeSchema is structured:

  • Captures using $ref: flow://connector-schema (most SQL captures): add redact annotations at the top level of the writeSchema, alongside the $ref — this ensures they survive auto-discovery updates of the connector-schema.
  • Captures with an inline writeSchema (HTTP ingest, MongoDB, or older SQL captures): annotate the field directly on its existing property definition. The redact: key lives alongside type:, description:, etc.

Example - Hash PII, block credentials (connector-schema capture):

collections:
  acmeCo/customers:
    writeSchema:
      $ref: flow://connector-schema
      properties:
        # Hash for pseudonymization (can still join on hashed value)
        email:
          redact: { strategy: sha256 }
        phone:
          redact: { strategy: sha256 }
        ssn:
          redact: { strategy: sha256 }
        # Block entirely (field removed from documents)
        password_hash:
          redact: { strategy: block }
        internal_notes:
          redact: { strategy: block }

Example - Inline writeSchema (annotate field directly):

collections:
  acmeCo/users:
    writeSchema:
      type: object
      required: [id]
      properties:
        id:
          type: string
        email:
          type: string
          redact: { strategy: sha256 }
        api_key:
          type: string
          redact: { strategy: block }

Example - Nested fields:

properties:
  user:
    type: object
    properties:
      profile:
        type: object
        properties:
          email:
            type: string
            redact: { strategy: sha256 }
          private_key:
            redact: { strategy: block }

Step 3: Publish the Changes

flowctl catalog publish --source flow.yaml --auto-approve

Step 4: Verify Redaction

After publishing, new documents will have redaction applied. Check by reading the collection:

flowctl collections read --collection <collection> | head -5

Expected output:

  • sha256 fields show hashed values: "email": "sha256:a3f2b8c9d4e5..."
  • block fields are absent from documents entirely

Troubleshooting

"Cannot redact key field"

Cause: Attempted to redact a field that's part of the collection key.

Solution: Key fields cannot be redacted. Consider:

  1. Using a different field as the key
  2. Creating a derivation that re-keys documents before redaction

"block redact strategy cannot be applied at '/path/to/field' because it must exist"

Cause: block removes the field, but the schema requires the field to be present (it's listed in required:, or otherwise constrained to exist).

When this errors and when it doesn't:

  • Read schemas using flow://inferred-schema: the validator suppresses this error automatically. Publish proceeds and block simply makes the field absent in captured documents — schema inference will eventually drop the field from required.
  • Explicit schemas (no inferred-schema reference): validation fails. Remove the field from required before publishing:
required: [id]  # Remove the field you're blocking
properties:
  id: { type: string }
  sensitive_field:
    type: string
    redact: { strategy: block }

"/path/to/field has 'sha256' redact strategy but cannot be a string (types are "<type>")"

Cause: The field's declared type set excludes string entirely (e.g., type: integer or type: object). At publish time, validation rejects sha256 on a field that can never be a string.

Note: At runtime the hasher itself accepts any type (it hashes bool/int/float bytes, JSON-serializes arrays/objects before hashing). The error is a publish-time schema-shape check, not a runtime restriction. A union like ["string", "null"] or ["string", "integer"] passes — only a field declared to never be a string fails.

Solutions:

  • Add string to the field's type union: type: ["string", "null"]
  • Or convert to a string in a derivation first and apply sha256 on the derived field
  • For non-string fields you don't need to look up by, use block instead

Redaction not appearing on existing documents

Cause: Redaction only applies to new documents captured after publishing.

Solution: If you need to redact historical data:

  1. Increment the backfill counter on the capture binding
  2. This re-captures all data with redaction applied

Hash values differ between tasks

Cause: Each capture/derivation has its own salt for sha256 hashing.

Explanation: This is intentional for security. The same email hashed in different captures will produce different hashes.

If you need consistent hashes across tasks: Estuary auto-generates a per-task salt, but you can override it by setting the top-level redactSalt field on the capture spec or under a derivation's derive: block. The value is a base64-encoded byte string (e.g., "c29tZS1zZWNyZXQtc2VjcmV0LWFiYw==" — use a high-entropy secret in production). Specifying the same redactSalt across tasks produces matching hashes for matching inputs. See docs/features/redaction.

Hash output format: sha256: + 64 lowercase hex characters (71 chars total).

Related Skills

  • schema-field-selection — Exclude fields at materialization (less secure, field still in collection)
  • schema-define-fields — Define fields in the readSchema alongside connector-schema reference

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Create an Alpaca capture using flowctl to stream stock trade data into Estuary collections. Use when setting up an Alpaca Market Data source for historical and real-time stock trades. Use when user says "capture Alpaca", "stream stock trades", "Alpaca market data", or "connect Alpaca to Estuary".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

estuary/agent-skills72026년 9월 25일 업데이트

Create a capture for ANY Estuary connector using dynamic schema discovery. Use when the user wants to capture from a source that doesn't have a dedicated skill (e.g., Kafka, Salesforce, HubSpot, Stripe, S3, GCS, Kinesis, or any of the 148+ connectors). Use when user says "capture from <source>", "stream from <source>", "connect <source> to Estuary", or "set up <source> capture" and no connector-specific skill exists.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

estuary/agent-skills72026년 9월 25일 업데이트

Create an HTTP Ingest (webhook) capture to receive data via HTTP POST requests. Use when setting up webhooks from GitHub, Shopify, Stripe, or any JSON source. Use when user says "set up webhook capture", "HTTP ingest to Estuary", "receive POST requests to Estuary", or "webhook capture".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

estuary/agent-skills72026년 9월 25일 업데이트

Create a HubSpot Real-Time capture using flowctl to stream CRM data into Estuary collections. Use when setting up a HubSpot source for contacts, companies, deals, tickets, or other HubSpot resources. Use when user says "capture HubSpot", "stream from HubSpot", "HubSpot CDC", or "connect HubSpot to Estuary".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

estuary/agent-skills72026년 9월 25일 업데이트

Create a MongoDB CDC capture using flowctl. Use when setting up real-time streaming from MongoDB Atlas, DocumentDB, or self-hosted MongoDB. Use when user says "capture MongoDB", "stream from Mongo", "MongoDB CDC", or "connect MongoDB to Estuary".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

estuary/agent-skills72026년 9월 25일 업데이트

Create a MySQL CDC capture using flowctl with binlog replication. Use when setting up streaming from MySQL, Amazon RDS MySQL, or Aurora MySQL. Use when user says "capture MySQL", "stream from MySQL", "MySQL CDC", "binlog replication", or "connect MySQL to Estuary".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

estuary/agent-skills72026년 9월 25일 업데이트

estuary의 스킬 모두 보기

이 스킬의 문제 신고