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.1.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.1-py3-none-any.whl (31.2 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for elasticsearch_pii_redacter-1.9.1.tar.gz
Algorithm Hash digest
SHA256 4b4df1cec0df33d0f01d27ad3ca06806730dcc4abb62bc03b535db08771779cf
MD5 c8d63464af03131aace401682bab0cb6
BLAKE2b-256 0cb99ec2da213f5161e781ce8d94a58d09f39abb732f9d0a546a1b4ddc005678

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for elasticsearch_pii_redacter-1.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e6af09a86f2f3b38d81d53e829134853ea42c09691e262abf251f2e84e6283d2
MD5 925b337bb7e5c0e2ee7f75a3b09f7c02
BLAKE2b-256 1c93364f10eed5d42dfdc68c9318db2e5417191068830c13c54684d4a70fa142

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