Skip to main content

Redacting field data from your Elasticsearch indices and Searchable Snapshots

Project description

Did you find PII (Personally Identifiable Information) in your Elasticsearch indices that doesn’t belong there? This is the tool for you!

The elastic-pii-redacter can help you redact information from even Searchable Snapshot mounted indices. It works with deeply nested fields, too!

Client Configuration

The tool connects using the es_client Python module.

The configuration file structure requires elasticsearch at the root level:

---
elasticsearch:
  client:
    hosts: https://10.11.12.13:9200
    cloud_id:
    bearer_auth:
    opaque_id:
    request_timeout: 60
    http_compress:
    verify_certs:
    ca_certs:
    client_cert:
    client_key:
    ssl_assert_hostname:
    ssl_assert_fingerprint:
    ssl_version:
  other_settings:
    master_only:
    skip_version_test:
    username:
    password:
    api_key:
      id:
      api_key:
      token:

logging:
  loglevel: INFO
  logfile: /path/to/file.log
  logformat: default
  blacklist: []

REDACTIONS_FILE Configuration

---
redactions:
  - job_name_20230731_redact_hot:
      pattern: hot-*
      query: {'match': {'message': 'message1'}}
      fields: ['message']
      message: REDACTED
      expected_docs: 1
      restore_settings: {'index.routing.allocation.include._tier_preference': 'data_warm,data_hot,data_content'}
  - job_name_20230731_redact_cold:
      pattern: restored-cold-*
      query: {'match': {'nested.key': 'nested19'}}
      fields: ['nested.key']
      message: REDACTED
      expected_docs: 1
      restore_settings: {'index.routing.allocation.include._tier_preference': 'data_warm,data_hot,data_content'}
  - job_name_20230731_redact_frozen:
      pattern: partial-frozen-*
      query: {'range': {'number': {'gte': 8, 'lte': 11}}}
      fields: ['deep.l1.l2.l3']
      message: REDACTED
      expected_docs: 4

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

elasticsearch_pii_redacter-1.9.0.tar.gz (26.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

elasticsearch_pii_redacter-1.9.0-py3-none-any.whl (31.2 kB view details)

Uploaded Python 3

File details

Details for the file elasticsearch_pii_redacter-1.9.0.tar.gz.

File metadata

File hashes

Hashes for elasticsearch_pii_redacter-1.9.0.tar.gz
Algorithm Hash digest
SHA256 dcba06c967f5325816f3b531d614f50fe74fb90ea1fd82e8aba86effa47891ea
MD5 2ac0a286481d2c50a7870792b75e9f2d
BLAKE2b-256 0b6673da28647475f226366ef8696dbce66ee4886fde43267c7e17d3d68f52ee

See more details on using hashes here.

File details

Details for the file elasticsearch_pii_redacter-1.9.0-py3-none-any.whl.

File metadata

File hashes

Hashes for elasticsearch_pii_redacter-1.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b4539d4ee54aa4da62e1839cc9b1abf1499ea79e8e847a42cdf1687eb09a1115
MD5 5d17b1c862accd2e0b21a8015f90c175
BLAKE2b-256 7906c1091ff158fa3b3b25d17636fe16ee9f59915f752ee76df16cf1cfce2dd1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page