Skip to content

Commit

Permalink
[cleaner] Improve IPV6 MAC address RE
Browse files Browse the repository at this point in the history
Current RE obfuscates also UUID strings, let be more strict.

Resolves: #3767
Relevant: #3736

Signed-off-by: Pavel Moravec <[email protected]>
  • Loading branch information
pmoravec committed Aug 29, 2024
1 parent 3886534 commit b0f5530
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sos/cleaner/parsers/mac_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
r'[0-9a-fA-F]{2}(\'|\")?(\/|\,|\-|\.|\s|$))'
)
# aabb:ccee:ddee:ffaa
IPV6_REG_4HEX = (
r'((?<!([0-9a-fA-F\'\"]:)|::)(([^:\-]?[0-9a-fA-F]{4}(:|-)){3}'
r'[0-9a-fA-F]{4}(\'|\")?(\/|\,|\-|\.|\s|$)))'
IPV6_REG_4HEX_NEW = (
r'((?<!\w)(([0-9a-fA-F]{4}:){3}[0-9a-fA-F]{4})(?!\w))|'
r'((?<!\w)(([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{4})(?!\w))'
)
# aa:bb:cc:dd:ee:ff avoiding ipv6 substring matches
IPV4_REG = (
Expand Down

0 comments on commit b0f5530

Please sign in to comment.