Skip to content

Redaction occurring in non-user-input fields #792

Description

@ferg-dev

Describe the bug
Redaction is checked on all keys in request/response objects outside the specific exclusion of FirstSeen and LastSeen, this can lead to invalid data and failed import to OpenSearch. Adding more keys to the exclusion list is possible but there are potentially over 100 keys that would need to be added to the list to cover all scenarios.

To Reproduce
Comprehend needs to identify PII. Seems most impactful when it identifies a single digit/character or a common element (like QID). This appears to only show up in higher volume usage.

Expected behavior
User input should be redacted when enabled, but bot information, session IDs, timestamps, and settings should be skipped.

Please complete the following information about the solution:

  • Version: v6.1.1
  • Region: us-west-2
  • Was the solution modified from the version published on this repository? Yes
  • If the answer to the previous question was yes, are the changes available on GitHub? No
  • Have you checked your service quotas for the services this solution uses? I checked to ensure Comprehend average usage was lower than service threshold
  • Were there any errors in the CloudWatch Logs? No errors found in Fulfillment Lambda logs with debug enabled.

Screenshots
Comprehend identified '2' as a problematic digit:
1_question
All 2's were redacted out of other string fields (with the exception of FirstSeen and LastSeen):
2_other_values_redacted
The invalid date caused error importing into OpenSearch:
Screenshot 2024-12-11 174337

Additional context
Solution appears to use Comprehend to analyze the input transcript/question for the specific locations with detected PII, then stores the strings at those locations as regex capture groups in an environment variable. Regex then uses this env variable to redact data in all fields. So if Comprehend recognizes "QID" as PII that QID is then removed from all string values within request and response.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions