Skip to content

Commit

Permalink
[MBOX] Remove credentials from origin and tag
Browse files Browse the repository at this point in the history
This code redefines the method _fix_item for the
MBOX raw data to remove credentials that may appear
in the origin.

Signed-off-by: Jose Javier Merchante <[email protected]>
  • Loading branch information
jjmerchante committed Apr 11, 2024
1 parent 9252163 commit 505cd5e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions grimoire_elk/raw/mbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

from .elastic import ElasticOcean
from ..elastic_mapping import Mapping as BaseMapping
from ..enriched.utils import anonymize_url


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -79,3 +80,7 @@ def _fix_item(self, item):
for field in fields:
if field.lower().startswith("x-"):
item["data"].pop(field)

# Remove credentials from URL
item['origin'] = anonymize_url(item['origin'])
item['tag'] = anonymize_url(item['tag'])
7 changes: 7 additions & 0 deletions releases/unreleased/mbox-origin-url-anonymized.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: MBOX origin URL anonymized
category: fixed
author: Jose Javier Merchante <[email protected]>
issue: null
notes: >
Remove credentials from MBOX origin URL and tag fields.

0 comments on commit 505cd5e

Please sign in to comment.