OpenMetadata icon indicating copy to clipboard operation
OpenMetadata copied to clipboard

Avro parser logs actual file content when it fails to parse the file in S3 ingestion

Open Jezreel-Zamora-Paidy opened this issue 11 months ago • 5 comments

Affected module Ingestion Framework

Describe the bug When running S3 ingestion with avro formatting, if the avro parser fails to parse the file then it will logs the content of the file in the warning logs. This can lead to leaking sensitive data in to the log storage.

Offending line of code is here. https://github.com/open-metadata/OpenMetadata/blob/9ef83fa166b29c2bf39bc599009d78a04658f742/ingestion/src/metadata/parsers/avro_parser.py#L265 To Reproduce

To easily replicate the issue, simply run the following code

import avro.schema as avroschema
import logging

logger = logging.getLogger()

try:

    avroschema.parse('{"test": "invalid_avro"}')
except Exception as exc:
    logger.warning(f"Unable to parse the avro schema: {exc}")

Which will result in the following warning message that includes that actual data.

Unable to parse the avro schema: No "type" property: {'test': 'invalid_avro'}

Expected behavior Do not log the actual exception message when avro schema fails to parse the json since this will include the actual data which may contain sensitive data. Version:

  • OS: [e.g. iOS]
  • Python version: 3.11.4
  • OpenMetadata version: 1.9.13
  • OpenMetadata Ingestion package version: [e.g. openmetadata-ingestion[docker]==1.9.13]

Additional context Add any other context about the problem here.

Jezreel-Zamora-Paidy avatar Dec 12 '25 01:12 Jezreel-Zamora-Paidy

@harshach can I get this issue assigned ?

sksingh2005 avatar Apr 13 '26 16:04 sksingh2005

Hi! I'd like to work on this issue. I'm participating in the WeMakeDevs x OpenMetadata hackathon (Apr 17–26) and this fits well. Thanks! @harshach

rajattiwari-stack avatar Apr 16 '26 18:04 rajattiwari-stack

@rajattiwari-stack assigned it to you, make sure to write a integation test there is alreay minio storage connector tests that exists and you should be able to reproduce this

harshach avatar Apr 16 '26 21:04 harshach

Sure @harshach ! Thanks

rajattiwari-stack avatar Apr 17 '26 20:04 rajattiwari-stack

Opened a fix for this: #27498

rajattiwari-stack avatar Apr 17 '26 21:04 rajattiwari-stack